Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: workflow file for testing cv_workflow #3829

Merged
74 changes: 74 additions & 0 deletions .github/workflows/new-cvp-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
name: "CV integration testing"

# on: pull_request
on: workflow_dispatch

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
jobs:
# ----------------------------------------------- #
# CV INTEGRATION MOLECULE TEST FOR CV_WORKFLOW #
# ----------------------------------------------- #
molecule_cv_workflow:
name: Run molecule test for new cvp integration
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
avd_scenario:
- 'cv_workflow'
ansible_version:
- 'ansible-core<2.17.0 --upgrade'
steps:
- name: 'Set environment variables'
run: |
echo "PY_COLORS=1" >> $GITHUB_ENV
echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Run molecule action
env:
CVAAS_AAWG_CI: ${{ secrets.CVAAS_AAWG_CI }}
ClausHolbechArista marked this conversation as resolved.
Show resolved Hide resolved
uses: arista-netdevops-community/action-molecule-avd@v1.7
with:
molecule_parentdir: 'ansible_collections/arista/avd'
molecule_command: 'test'
molecule_args: '--scenario-name ${{ matrix.avd_scenario }}'
pip_file: ansible_collections/arista/avd/requirements.txt
galaxy_file: "ansible_collections/arista/avd/collections.yml"
ansible: ${{ matrix.ansible_version }}
check_git: true
check_git_enforced: true

# ------------------------------------------- #
# CV INTEGRATION MOLECULE TEST FOR CV_DEPLOY #
# ------------------------------------------- #
molecule_cv_deploy:
name: Run molecule test for new cvp integration
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
avd_scenario:
- 'cv_deploy'
ansible_version:
- 'ansible-core<2.17.0 --upgrade'
steps:
- name: 'Set environment variables'
run: |
echo "PY_COLORS=1" >> $GITHUB_ENV
echo "ANSIBLE_FORCE_COLOR=1" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Run molecule action
env:
CVAAS_AAWG_CI: ${{ secrets.CVAAS_AAWG_CI }}
uses: arista-netdevops-community/action-molecule-avd@v1.7
with:
molecule_parentdir: 'ansible_collections/arista/avd'
molecule_command: 'test'
molecule_args: '--scenario-name ${{ matrix.avd_scenario }}'
pip_file: ansible_collections/arista/avd/requirements.txt
galaxy_file: "ansible_collections/arista/avd/collections.yml"
ansible: ${{ matrix.ansible_version }}
check_git: true
check_git_enforced: true
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
- name: Get workspace information
delegate_to: localhost
run_once: true
no_log: true
ansible.builtin.uri:
url: '{{ configlet_url + "?key.workspaceId=" + ws_name + "&key.configlet_id=" + item }}'
return_content: true
Expand All @@ -122,6 +123,7 @@

- name: Set configlets facts
run_once: true
no_log: true
vars:
configs: ["{{ configuration_dir ~ '/test_configs' }}/ci-s1-leaf1.cfg",
"{{ configuration_dir ~ '/test_configs' }}/ci-s1-leaf2.cfg",
Expand All @@ -141,6 +143,7 @@
- name: Get Device Tag information
delegate_to: localhost
run_once: true
no_log: true
ansible.builtin.uri:
url: '{{ tag_url }}'
return_content: true
Expand All @@ -164,6 +167,7 @@
- name: Get and verify Interface Tag information
delegate_to: localhost
run_once: true
no_log: true
ansible.builtin.uri:
url: '{{ tag_url }}'
return_content: true
Expand Down Expand Up @@ -220,6 +224,7 @@
- name: Get Strict Device Tag information
delegate_to: localhost
run_once: true
no_log: true
ansible.builtin.uri:
url: '{{ tag_url }}'
return_content: true
Expand Down Expand Up @@ -275,6 +280,7 @@
- name: Get Value Device Tag information
delegate_to: localhost
run_once: true
no_log: true
vars:
ws_name_value: avd-static-studio-tag-value-change-{{ r }}
ansible.builtin.uri:
Expand Down Expand Up @@ -365,6 +371,7 @@
- name: Get workspace information
delegate_to: localhost
run_once: true
no_log: true
vars:
ws_name_dotted: avd-static-studio-test-dotted-{{ r }}
ansible.builtin.uri:
Expand All @@ -381,13 +388,13 @@

- name: Set configlets facts
run_once: true
no_log: true
vars:
configs: ["{{ configuration_dir ~ '/dotted_hostname/test_dotted_hostname' }}/ci-s1-leaf.1.cfg"]
ansible.builtin.set_fact:
dotted_response_configlet: "{{ response_configlet | default({}) | combine({item.0.json.value.body | trim: item.1}) }}"
loop: "{{ dotted_result.results | zip(configs) | list }}"

# XXX: fix me!
- name: Check configlets
ansible.builtin.assert:
that:
Expand Down
Loading