From b2391a9ef6f0f6f49eddb7fe5588026df2ef5d99 Mon Sep 17 00:00:00 2001 From: Dmitry Dunaev <83591011+dunaev-opsfleet@users.noreply.github.com> Date: Tue, 27 Dec 2022 18:26:57 +0300 Subject: [PATCH] [WIFI-11902] Chg: switch scheduled tests to latest release by default (#759) Signed-off-by: Dmitry Dunaev Signed-off-by: Dmitry Dunaev --- .github/workflows/advanced.yml | 29 ++++++++++++++++++++++ .github/workflows/interop.yml | 20 +++++++++++++++ .github/workflows/interop_modified.yml | 21 ++++++++++++++++ .github/workflows/interop_performance.yml | 20 +++++++++++++++ .github/workflows/manual.yml | 30 ++++++++++++++++++++++- .github/workflows/performance.yml | 20 +++++++++++++++ .github/workflows/quali-advanced.yml | 20 +++++++++++++++ .github/workflows/quali-basic-manual.yml | 27 ++++++++++++++++++++ .github/workflows/quali.yml | 22 +++++++++++++++++ .github/workflows/regression.yml | 20 +++++++++++++++ 10 files changed, 228 insertions(+), 1 deletion(-) diff --git a/.github/workflows/advanced.yml b/.github/workflows/advanced.yml index 67eac3950..ac98be053 100644 --- a/.github/workflows/advanced.yml +++ b/.github/workflows/advanced.yml @@ -10,16 +10,45 @@ env: on: workflow_dispatch: + inputs: + tests_release: + required: false + default: "" + description: "Tests release branch to use (i.e. 'release/v2.8.0' or 'master'). If left empty, latest release branch is used" defaults: run: shell: bash jobs: + vars: + runs-on: ubuntu-latest + outputs: + tests_release: ${{ steps.vars.outputs.tests_release }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: set variables + id: vars + run: | + LATEST_TESTS_RELEASE=$(git branch -r | grep 'release/v' | sed 's!\s*origin/!!' | tail -1) + if [[ -z "${{ github.event.inputs.tests_release }}" ]]; then + echo "Tests release was not passed, using branch $LATEST_TESTS_RELEASE" + echo "tests_release=$LATEST_TESTS_RELEASE" >> $GITHUB_OUTPUT + else + echo "Tests release was passed - ${{ github.event.inputs.tests_release }}" + echo "tests_release=${{ github.event.inputs.tests_release }}" >> $GITHUB_OUTPUT + fi + build: runs-on: ubuntu-latest + needs: ["vars"] steps: - uses: actions/checkout@v3 + with: + ref: ${{ needs.vars.outputs.tests_release }} - name: build and push Docker image uses: ./.github/actions/build-and-push-docker with: diff --git a/.github/workflows/interop.yml b/.github/workflows/interop.yml index 5dd1fea12..61effd967 100644 --- a/.github/workflows/interop.yml +++ b/.github/workflows/interop.yml @@ -23,6 +23,10 @@ on: marker_overwrite: description: overwrite the Pytest markers that will be selected, will disable report uploading required: false + tests_release: + required: false + default: "" + description: "Tests release branch to use (i.e. 'release/v2.8.0' or 'master'). If left empty, latest release branch is used" schedule: - cron: "35 20 * * *" @@ -42,8 +46,13 @@ jobs: firmware: ${{ steps.vars.outputs.firmware }} marker_expression: ${{ steps.vars.outputs.marker_expression }} existing_controller: ${{ steps.vars.outputs.existing_controller }} + tests_release: ${{ steps.vars.outputs.tests_release }} steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: set variables id: vars run: | @@ -59,11 +68,22 @@ jobs: echo "firmware=$(echo ${{ github.event.inputs.firmware || 'next-latest' }})" >> $GITHUB_OUTPUT echo "marker_expression=$(echo ${{ github.event.inputs.marker_expression || 'uc_sanity' }})" >> $GITHUB_OUTPUT echo "existing_controller=$(echo ${{ github.event.inputs.existing_controller || 'qa01' }})" >> $GITHUB_OUTPUT + LATEST_TESTS_RELEASE=$(git branch -r | grep 'release/v' | sed 's!\s*origin/!!' | tail -1) + if [[ -z "${{ github.event.inputs.tests_release }}" ]]; then + echo "Tests release was not passed, using branch $LATEST_TESTS_RELEASE" + echo "tests_release=$LATEST_TESTS_RELEASE" >> $GITHUB_OUTPUT + else + echo "Tests release was passed - ${{ github.event.inputs.tests_release }}" + echo "tests_release=${{ github.event.inputs.tests_release }}" >> $GITHUB_OUTPUT + fi build: runs-on: ubuntu-latest + needs: ["vars"] steps: - uses: actions/checkout@v3 + with: + ref: ${{ needs.vars.outputs.tests_release }} - name: build and push Docker image uses: ./.github/actions/build-and-push-docker with: diff --git a/.github/workflows/interop_modified.yml b/.github/workflows/interop_modified.yml index 7606c1e74..3634e7c5c 100644 --- a/.github/workflows/interop_modified.yml +++ b/.github/workflows/interop_modified.yml @@ -19,6 +19,10 @@ on: marker_overwrite: description: overwrite the Pytest markers that will be selected, will disable report uploading required: false + tests_release: + required: false + default: "" + description: "Tests release branch to use (i.e. 'release/v2.8.0' or 'master'). If left empty, latest release branch is used" schedule: - cron: "30 20 * * *" @@ -37,8 +41,13 @@ jobs: ap_version: ${{ steps.vars.outputs.ap_version}} marker_expression: ${{ steps.vars.outputs.marker_expression }} existing_controller: ${{ steps.vars.outputs.existing_controller }} + tests_release: ${{ steps.vars.outputs.tests_release }} steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: set variables id: vars run: | @@ -53,10 +62,22 @@ jobs: echo "ap_version=$(echo ${{ github.event.inputs.ap_version || 'next-latest' }})" >> $GITHUB_OUTPUT echo "marker_expression=$(echo ${{ github.event.inputs.marker_expression || 'uc_sanity' }})" >> $GITHUB_OUTPUT echo "existing_controller=$(echo ${{ github.event.inputs.existing_controller || 'qa01' }})" >> $GITHUB_OUTPUT + LATEST_TESTS_RELEASE=$(git branch -r | grep 'release/v' | sed 's!\s*origin/!!' | tail -1) + if [[ -z "${{ github.event.inputs.tests_release }}" ]]; then + echo "Tests release was not passed, using branch $LATEST_TESTS_RELEASE" + echo "tests_release=$LATEST_TESTS_RELEASE" >> $GITHUB_OUTPUT + else + echo "Tests release was passed - ${{ github.event.inputs.tests_release }}" + echo "tests_release=${{ github.event.inputs.tests_release }}" >> $GITHUB_OUTPUT + fi + build: runs-on: ubuntu-latest + needs: ["vars"] steps: - uses: actions/checkout@v3 + with: + ref: ${{ needs.vars.outputs.tests_release }} - name: build and push Docker image uses: ./.github/actions/build-and-push-docker with: diff --git a/.github/workflows/interop_performance.yml b/.github/workflows/interop_performance.yml index 811f006e0..555135a6f 100644 --- a/.github/workflows/interop_performance.yml +++ b/.github/workflows/interop_performance.yml @@ -23,6 +23,10 @@ on: description: Testbed to run on default: interop-02 required: false + tests_release: + required: false + default: "" + description: "Tests release branch to use (i.e. 'release/v2.8.0' or 'master'). If left empty, latest release branch is used" # schedule: # - cron: "0 2 ? * SAT" @@ -37,8 +41,13 @@ jobs: devices: ${{ steps.vars.outputs.devices }} marker_overwrite: ${{ steps.vars.outputs.marker_overwrite }} testbed: ${{ steps.vars.output.devices }} + tests_release: ${{ steps.vars.outputs.tests_release }} steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: set variables id: vars run: | @@ -50,11 +59,22 @@ jobs: devices=${DEVICES} EOF echo "testbed=${{ github.event.inputs.testbed || '' }}" >> $GITHUB_OUTPUT + LATEST_TESTS_RELEASE=$(git branch -r | grep 'release/v' | sed 's!\s*origin/!!' | tail -1) + if [[ -z "${{ github.event.inputs.tests_release }}" ]]; then + echo "Tests release was not passed, using branch $LATEST_TESTS_RELEASE" + echo "tests_release=$LATEST_TESTS_RELEASE" >> $GITHUB_OUTPUT + else + echo "Tests release was passed - ${{ github.event.inputs.tests_release }}" + echo "tests_release=${{ github.event.inputs.tests_release }}" >> $GITHUB_OUTPUT + fi build: runs-on: ubuntu-latest + needs: ["vars"] steps: - uses: actions/checkout@v3 + with: + ref: ${{ needs.vars.outputs.tests_release }} - name: build and push Docker image uses: ./.github/actions/build-and-push-docker with: diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 89a65cd84..92b909dab 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -32,16 +32,44 @@ on: default: "false" description: "check if the report should be uploaded to S3" required: false + tests_release: + required: false + default: "" + description: "Tests release branch to use (i.e. 'release/v2.8.0' or 'master'). If left empty, latest release branch is used" defaults: run: shell: bash jobs: - build: + vars: runs-on: ubuntu-latest + outputs: + tests_release: ${{ steps.vars.outputs.tests_release }} steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: set variables + id: vars + run: | + LATEST_TESTS_RELEASE=$(git branch -r | grep 'release/v' | sed 's!\s*origin/!!' | tail -1) + if [[ -z "${{ github.event.inputs.tests_release }}" ]]; then + echo "Tests release was not passed, using branch $LATEST_TESTS_RELEASE" + echo "tests_release=$LATEST_TESTS_RELEASE" >> $GITHUB_OUTPUT + else + echo "Tests release was passed - ${{ github.event.inputs.tests_release }}" + echo "tests_release=${{ github.event.inputs.tests_release }}" >> $GITHUB_OUTPUT + fi + + build: + runs-on: ubuntu-latest + needs: ["vars"] + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ needs.vars.outputs.tests_release }} - name: build and push Docker image uses: ./.github/actions/build-and-push-docker with: diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index b39485e23..664b1ef48 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -36,6 +36,10 @@ on: required: false default: "" description: "Use an existing cloud controller, e.g. like qa01 instead of dynamic one" + tests_release: + required: false + default: "" + description: "Tests release branch to use (i.e. 'release/v2.8.0' or 'master'). If left empty, latest release branch is used" schedule: - cron: "30 20 * * 6" @@ -49,8 +53,13 @@ jobs: ap_version: ${{ steps.vars.outputs.ap_version}} marker_expressions: ${{ steps.vars.outputs.marker_expressions }} existing_controller: ${{ steps.vars.outputs.existing_controller }} + tests_release: ${{ steps.vars.outputs.tests_release }} steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: set variables id: vars run: | @@ -69,12 +78,23 @@ jobs: cat >> $GITHUB_OUTPUT << EOF ap_models=${AP_MODELS} EOF + LATEST_TESTS_RELEASE=$(git branch -r | grep 'release/v' | sed 's!\s*origin/!!' | tail -1) + if [[ -z "${{ github.event.inputs.tests_release }}" ]]; then + echo "Tests release was not passed, using branch $LATEST_TESTS_RELEASE" + echo "tests_release=$LATEST_TESTS_RELEASE" >> $GITHUB_OUTPUT + else + echo "Tests release was passed - ${{ github.event.inputs.tests_release }}" + echo "tests_release=${{ github.event.inputs.tests_release }}" >> $GITHUB_OUTPUT + fi # Build test image build: runs-on: ubuntu-latest + needs: ["vars"] steps: - uses: actions/checkout@v3 + with: + ref: ${{ needs.vars.outputs.tests_release }} - name: build and push Docker image uses: ./.github/actions/build-and-push-docker with: diff --git a/.github/workflows/quali-advanced.yml b/.github/workflows/quali-advanced.yml index 0153250c3..3d230fc01 100644 --- a/.github/workflows/quali-advanced.yml +++ b/.github/workflows/quali-advanced.yml @@ -19,6 +19,10 @@ on: required: true default: 'advance' description: 'Marker expression to select tests to execute' + tests_release: + required: false + default: "" + description: "Tests release branch to use (i.e. 'release/v2.8.0' or 'master'). If left empty, latest release branch is used" schedule: - cron: '30 20 * * *' @@ -34,8 +38,13 @@ jobs: ap_models: ${{ steps.vars.outputs.ap_models}} ap_version: ${{ steps.vars.outputs.ap_version}} marker_expression: ${{ steps.vars.outputs.marker_expression }} + tests_release: ${{ steps.vars.outputs.tests_release }} steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: set variables id: vars run: | @@ -43,6 +52,14 @@ jobs: echo "ap_models=$(echo ${{ github.event.inputs.ap_models || 'edgecore_eap102,cig_wf194c4' }})" >> $GITHUB_OUTPUT echo "ap_version=$(echo ${{ github.event.inputs.ap_version || 'next-latest' }})" >> $GITHUB_OUTPUT echo "marker_expression=$(echo ${{ github.event.inputs.marker_expression || 'advance' }})" >> $GITHUB_OUTPUT + LATEST_TESTS_RELEASE=$(git branch -r | grep 'release/v' | sed 's!\s*origin/!!' | tail -1) + if [[ -z "${{ github.event.inputs.tests_release }}" ]]; then + echo "Tests release was not passed, using branch $LATEST_TESTS_RELEASE" + echo "tests_release=$LATEST_TESTS_RELEASE" >> $GITHUB_OUTPUT + else + echo "Tests release was passed - ${{ github.event.inputs.tests_release }}" + echo "tests_release=${{ github.event.inputs.tests_release }}" >> $GITHUB_OUTPUT + fi generate-matrix: name: generate AP model matrix @@ -63,8 +80,11 @@ jobs: build: runs-on: ubuntu-latest + needs: ["vars"] steps: - uses: actions/checkout@v3 + with: + ref: ${{ needs.vars.outputs.tests_release }} - name: build and push Docker image uses: ./.github/actions/build-and-push-docker with: diff --git a/.github/workflows/quali-basic-manual.yml b/.github/workflows/quali-basic-manual.yml index e5dff29c7..ef25d04be 100644 --- a/.github/workflows/quali-basic-manual.yml +++ b/.github/workflows/quali-basic-manual.yml @@ -29,20 +29,47 @@ on: marker_expression: description: "marker expression that will be passed to pytest's -m" required: true + tests_release: + required: false + default: "" + description: "Tests release branch to use (i.e. 'release/v2.8.0' or 'master'). If left empty, latest release branch is used" defaults: run: shell: bash jobs: + vars: + runs-on: ubuntu-latest + outputs: + tests_release: ${{ steps.vars.outputs.tests_release }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: set variables + id: vars + run: | + LATEST_TESTS_RELEASE=$(git branch -r | grep 'release/v' | sed 's!\s*origin/!!' | tail -1) + if [[ -z "${{ github.event.inputs.tests_release }}" ]]; then + echo "Tests release was not passed, using branch $LATEST_TESTS_RELEASE" + echo "tests_release=$LATEST_TESTS_RELEASE" >> $GITHUB_OUTPUT + else + echo "Tests release was passed - ${{ github.event.inputs.tests_release }}" + echo "tests_release=${{ github.event.inputs.tests_release }}" >> $GITHUB_OUTPUT + fi + build: runs-on: ubuntu-latest + needs: ["vars"] steps: # checkout needed repositories - name: Checkout Testing repo uses: actions/checkout@v3 with: path: wlan-testing + ref: ${{ needs.vars.outputs.tests_release }} - name: Checkout LANforge scripts uses: actions/checkout@v3 diff --git a/.github/workflows/quali.yml b/.github/workflows/quali.yml index 2f7c40c3c..97c108da6 100644 --- a/.github/workflows/quali.yml +++ b/.github/workflows/quali.yml @@ -36,6 +36,11 @@ on: required: false default: "" description: "Use an existing cloud controller, e.g. like qa01 instead of dynamic one" + tests_release: + required: false + default: "" + description: "Tests release branch to use (i.e. 'release/v2.8.0' or 'master'). If left empty, latest release branch is used" + schedule: - cron: "35 20 * * 0-4" @@ -49,8 +54,13 @@ jobs: ap_version: ${{ steps.vars.outputs.ap_version}} marker_expression: ${{ steps.vars.outputs.marker_expression }} existing_controller: ${{ steps.vars.outputs.existing_controller }} + tests_release: ${{ steps.vars.outputs.tests_release }} steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: set variables id: vars run: | @@ -76,12 +86,24 @@ jobs: cat >> $GITHUB_OUTPUT << EOF ap_models=${AP_MODELS} EOF + LATEST_TESTS_RELEASE=$(git branch -r | grep 'release/v' | sed 's!\s*origin/!!' | tail -1) + if [[ -z "${{ github.event.inputs.tests_release }}" ]]; then + echo "Tests release was not passed, using branch $LATEST_TESTS_RELEASE" + echo "tests_release=$LATEST_TESTS_RELEASE" >> $GITHUB_OUTPUT + else + echo "Tests release was passed - ${{ github.event.inputs.tests_release }}" + echo "tests_release=${{ github.event.inputs.tests_release }}" >> $GITHUB_OUTPUT + fi + cat $GITHUB_OUTPUT # Build test image build: runs-on: ubuntu-latest + needs: ["vars"] steps: - uses: actions/checkout@v3 + with: + ref: ${{ needs.vars.outputs.tests_release }} - name: build and push Docker image uses: ./.github/actions/build-and-push-docker with: diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 3fa944a2c..780cc20bb 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -36,6 +36,10 @@ on: required: false default: "" description: "Use an existing cloud controller, e.g. like qa01 instead of dynamic one" + tests_release: + required: false + default: "" + description: "Tests release branch to use (i.e. 'release/v2.8.0' or 'master'). If left empty, latest release branch is used" schedule: - cron: "30 20 * * 5" @@ -49,8 +53,13 @@ jobs: ap_version: ${{ steps.vars.outputs.ap_version}} marker_expressions: ${{ steps.vars.outputs.marker_expressions }} existing_controller: ${{ steps.vars.outputs.existing_controller }} + tests_release: ${{ steps.vars.outputs.tests_release }} steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: set variables id: vars run: | @@ -69,12 +78,23 @@ jobs: cat >> $GITHUB_OUTPUT << EOF ap_models=${AP_MODELS} EOF + LATEST_TESTS_RELEASE=$(git branch -r | grep 'release/v' | sed 's!\s*origin/!!' | tail -1) + if [[ -z "${{ github.event.inputs.tests_release }}" ]]; then + echo "Tests release was not passed, using branch $LATEST_TESTS_RELEASE" + echo "tests_release=$LATEST_TESTS_RELEASE" >> $GITHUB_OUTPUT + else + echo "Tests release was passed - ${{ github.event.inputs.tests_release }}" + echo "tests_release=${{ github.event.inputs.tests_release }}" >> $GITHUB_OUTPUT + fi # Build test image build: runs-on: ubuntu-latest + needs: ["vars"] steps: - uses: actions/checkout@v3 + with: + ref: ${{ needs.vars.outputs.tests_release }} - name: build and push Docker image uses: ./.github/actions/build-and-push-docker with: