From db090e8b8f85f17ddc366eb1b8888313007bf389 Mon Sep 17 00:00:00 2001 From: "tomasz.tutka" Date: Fri, 10 Jan 2025 13:35:58 +0100 Subject: [PATCH 1/4] changed label to run tests --- .github/workflows/terratests-fcr-prod-suite.yaml | 2 +- .github/workflows/terratests-metal-nimf-suite.yaml | 2 +- .github/workflows/terratests-port-prod-suite.yaml | 2 +- .github/workflows/terratests-prod-suite-all.yaml | 2 +- .github/workflows/terratests-uat-suite.yaml | 6 +++--- .github/workflows/terratests-virtualdevice-prod-suite.yaml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/terratests-fcr-prod-suite.yaml b/.github/workflows/terratests-fcr-prod-suite.yaml index e735541..29a06ce 100644 --- a/.github/workflows/terratests-fcr-prod-suite.yaml +++ b/.github/workflows/terratests-fcr-prod-suite.yaml @@ -6,7 +6,7 @@ on: jobs: setup-tests: name: Setup PROD DIGP Tests - runs-on: ubuntu-latest + runs-on: ecx env: TF_VAR_equinix_client_id: ${{ secrets.EQUINIX_CLIENT_ID }} TF_VAR_equinix_client_secret: ${{ secrets.EQUINIX_CLIENT_SECRET }} diff --git a/.github/workflows/terratests-metal-nimf-suite.yaml b/.github/workflows/terratests-metal-nimf-suite.yaml index a1da696..9414738 100644 --- a/.github/workflows/terratests-metal-nimf-suite.yaml +++ b/.github/workflows/terratests-metal-nimf-suite.yaml @@ -6,7 +6,7 @@ on: jobs: setup-tests: name: Setup NIMF DIGP Tests - runs-on: ubuntu-latest + runs-on: ecx env: TF_VAR_equinix_client_id: ${{ secrets.EQUINIX_CLIENT_ID }} TF_VAR_equinix_client_secret: ${{ secrets.EQUINIX_CLIENT_SECRET }} diff --git a/.github/workflows/terratests-port-prod-suite.yaml b/.github/workflows/terratests-port-prod-suite.yaml index 13dc79a..01c8285 100644 --- a/.github/workflows/terratests-port-prod-suite.yaml +++ b/.github/workflows/terratests-port-prod-suite.yaml @@ -6,7 +6,7 @@ on: jobs: setup-tests: name: Setup PROD DIGP Tests - runs-on: ubuntu-latest + runs-on: ecx env: TF_VAR_equinix_client_id: ${{ secrets.EQUINIX_CLIENT_ID }} TF_VAR_equinix_client_secret: ${{ secrets.EQUINIX_CLIENT_SECRET }} diff --git a/.github/workflows/terratests-prod-suite-all.yaml b/.github/workflows/terratests-prod-suite-all.yaml index 35c8647..5a731e5 100644 --- a/.github/workflows/terratests-prod-suite-all.yaml +++ b/.github/workflows/terratests-prod-suite-all.yaml @@ -6,7 +6,7 @@ on: jobs: setup-tests: name: Setup PROD DIGP Tests - runs-on: ubuntu-latest + runs-on: ecx env: TF_VAR_equinix_client_id: ${{ secrets.EQUINIX_CLIENT_ID }} TF_VAR_equinix_client_secret: ${{ secrets.EQUINIX_CLIENT_SECRET }} diff --git a/.github/workflows/terratests-uat-suite.yaml b/.github/workflows/terratests-uat-suite.yaml index 5fbbe63..b365c3b 100644 --- a/.github/workflows/terratests-uat-suite.yaml +++ b/.github/workflows/terratests-uat-suite.yaml @@ -7,7 +7,7 @@ on: jobs: test-PNFV: name: Setup UAT PNFV Tests - runs-on: ubuntu-latest + runs-on: ecx env: TF_VAR_equinix_client_id: ${{ secrets.EQUINIX_CLIENT_ID_PNFV }} TF_VAR_equinix_client_secret: ${{ secrets.EQUINIX_CLIENT_SECRET_PNFV }} @@ -55,7 +55,7 @@ jobs: test-PFCR: name: Setup UAT PFCR Tests - runs-on: ubuntu-latest + runs-on: ecx env: TF_VAR_equinix_client_id: ${{ secrets.EQUINIX_CLIENT_ID_PFCR }} TF_VAR_equinix_client_secret: ${{ secrets.EQUINIX_CLIENT_SECRET_PFCR }} @@ -125,7 +125,7 @@ jobs: upload-test-report: name: Upload Testing Report needs: [test-PNFV, test-PFCR] - runs-on: ubuntu-latest + runs-on: ecx steps: - name: Set up Go diff --git a/.github/workflows/terratests-virtualdevice-prod-suite.yaml b/.github/workflows/terratests-virtualdevice-prod-suite.yaml index 5652197..9cba0d1 100644 --- a/.github/workflows/terratests-virtualdevice-prod-suite.yaml +++ b/.github/workflows/terratests-virtualdevice-prod-suite.yaml @@ -6,7 +6,7 @@ on: jobs: setup-tests: name: Setup PROD DIGP Tests - runs-on: ubuntu-latest + runs-on: ecx env: TF_VAR_equinix_client_id: ${{ secrets.EQUINIX_CLIENT_ID }} TF_VAR_equinix_client_secret: ${{ secrets.EQUINIX_CLIENT_SECRET }} From cae968a82643b4c3904018b337c272c9e575bf69 Mon Sep 17 00:00:00 2001 From: "tomasz.tutka" Date: Fri, 10 Jan 2025 14:01:00 +0100 Subject: [PATCH 2/4] added script to verify test results --- .github/workflows/terratests-fcr-prod-suite.yaml | 3 +++ .github/workflows/terratests-metal-nimf-suite.yaml | 3 +++ .github/workflows/terratests-port-prod-suite.yaml | 3 +++ .github/workflows/terratests-prod-suite-all.yaml | 3 +++ .../workflows/terratests-virtualdevice-prod-suite.yaml | 3 +++ check_tests.sh | 8 ++++++++ 6 files changed, 23 insertions(+) create mode 100644 check_tests.sh diff --git a/.github/workflows/terratests-fcr-prod-suite.yaml b/.github/workflows/terratests-fcr-prod-suite.yaml index 29a06ce..6b73b45 100644 --- a/.github/workflows/terratests-fcr-prod-suite.yaml +++ b/.github/workflows/terratests-fcr-prod-suite.yaml @@ -80,3 +80,6 @@ jobs: name: FCR Prod Suite Terraform Modules Testing Report path: fcr_prod_suite.html compression-level: 0 + + - name: Check if Tests are passed + run: sh check_tests.sh diff --git a/.github/workflows/terratests-metal-nimf-suite.yaml b/.github/workflows/terratests-metal-nimf-suite.yaml index 9414738..e37e891 100644 --- a/.github/workflows/terratests-metal-nimf-suite.yaml +++ b/.github/workflows/terratests-metal-nimf-suite.yaml @@ -87,3 +87,6 @@ jobs: name: Metal NIMF Prod Suite Terraform Modules Testing Report path: metal_prod_suite.html compression-level: 0 + + - name: Check if Tests are passed + run: sh check_tests.sh diff --git a/.github/workflows/terratests-port-prod-suite.yaml b/.github/workflows/terratests-port-prod-suite.yaml index 01c8285..d0d5f20 100644 --- a/.github/workflows/terratests-port-prod-suite.yaml +++ b/.github/workflows/terratests-port-prod-suite.yaml @@ -86,3 +86,6 @@ jobs: name: Port Prod Suite Terraform Modules Testing Report path: port_prod_suite.html compression-level: 0 + + - name: Check if Tests are passed + run: sh check_tests.sh diff --git a/.github/workflows/terratests-prod-suite-all.yaml b/.github/workflows/terratests-prod-suite-all.yaml index 5a731e5..99d7c7a 100644 --- a/.github/workflows/terratests-prod-suite-all.yaml +++ b/.github/workflows/terratests-prod-suite-all.yaml @@ -122,3 +122,6 @@ jobs: name: Prod Suite ALL Terraform Modules Testing Report path: prod_suite_all.html compression-level: 0 + + - name: Check if Tests are passed + run: sh check_tests.sh diff --git a/.github/workflows/terratests-virtualdevice-prod-suite.yaml b/.github/workflows/terratests-virtualdevice-prod-suite.yaml index 9cba0d1..1295c73 100644 --- a/.github/workflows/terratests-virtualdevice-prod-suite.yaml +++ b/.github/workflows/terratests-virtualdevice-prod-suite.yaml @@ -72,3 +72,6 @@ jobs: name: Virtual Device Prod Suite Terraform Modules Testing Report path: vd_prod_suite.html compression-level: 0 + + - name: Check if Tests are passed + run: sh check_tests.sh diff --git a/check_tests.sh b/check_tests.sh new file mode 100644 index 0000000..550daf4 --- /dev/null +++ b/check_tests.sh @@ -0,0 +1,8 @@ +file=$(find . -type f -iname "*suite.log") + +if grep -q Error "$file"; then + echo "### Tests are failed !!! Please verify report" >> $GITHUB_STEP_SUMMARY + exit 1 +else + echo "### Tests are passed !!! ::rocket::" >> $GITHUB_STEP_SUMMARY +fi \ No newline at end of file From 659fbac752b919c41a25b76a93a11de80a0f5f1d Mon Sep 17 00:00:00 2001 From: "tomasz.tutka" Date: Fri, 10 Jan 2025 19:02:53 +0100 Subject: [PATCH 3/4] back with label --- .github/workflows/terratests-fcr-prod-suite.yaml | 2 +- .github/workflows/terratests-metal-nimf-suite.yaml | 2 +- .github/workflows/terratests-port-prod-suite.yaml | 2 +- .github/workflows/terratests-prod-suite-all.yaml | 2 +- .github/workflows/terratests-uat-suite.yaml | 6 +++--- .github/workflows/terratests-virtualdevice-prod-suite.yaml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/terratests-fcr-prod-suite.yaml b/.github/workflows/terratests-fcr-prod-suite.yaml index 6b73b45..88d2298 100644 --- a/.github/workflows/terratests-fcr-prod-suite.yaml +++ b/.github/workflows/terratests-fcr-prod-suite.yaml @@ -6,7 +6,7 @@ on: jobs: setup-tests: name: Setup PROD DIGP Tests - runs-on: ecx + runs-on: ubuntu-latest env: TF_VAR_equinix_client_id: ${{ secrets.EQUINIX_CLIENT_ID }} TF_VAR_equinix_client_secret: ${{ secrets.EQUINIX_CLIENT_SECRET }} diff --git a/.github/workflows/terratests-metal-nimf-suite.yaml b/.github/workflows/terratests-metal-nimf-suite.yaml index e37e891..3b1f05c 100644 --- a/.github/workflows/terratests-metal-nimf-suite.yaml +++ b/.github/workflows/terratests-metal-nimf-suite.yaml @@ -6,7 +6,7 @@ on: jobs: setup-tests: name: Setup NIMF DIGP Tests - runs-on: ecx + runs-on: ubuntu-latest env: TF_VAR_equinix_client_id: ${{ secrets.EQUINIX_CLIENT_ID }} TF_VAR_equinix_client_secret: ${{ secrets.EQUINIX_CLIENT_SECRET }} diff --git a/.github/workflows/terratests-port-prod-suite.yaml b/.github/workflows/terratests-port-prod-suite.yaml index d0d5f20..9399eb2 100644 --- a/.github/workflows/terratests-port-prod-suite.yaml +++ b/.github/workflows/terratests-port-prod-suite.yaml @@ -6,7 +6,7 @@ on: jobs: setup-tests: name: Setup PROD DIGP Tests - runs-on: ecx + runs-on: ubuntu-latest env: TF_VAR_equinix_client_id: ${{ secrets.EQUINIX_CLIENT_ID }} TF_VAR_equinix_client_secret: ${{ secrets.EQUINIX_CLIENT_SECRET }} diff --git a/.github/workflows/terratests-prod-suite-all.yaml b/.github/workflows/terratests-prod-suite-all.yaml index 99d7c7a..0b52705 100644 --- a/.github/workflows/terratests-prod-suite-all.yaml +++ b/.github/workflows/terratests-prod-suite-all.yaml @@ -6,7 +6,7 @@ on: jobs: setup-tests: name: Setup PROD DIGP Tests - runs-on: ecx + runs-on: ubuntu-latest env: TF_VAR_equinix_client_id: ${{ secrets.EQUINIX_CLIENT_ID }} TF_VAR_equinix_client_secret: ${{ secrets.EQUINIX_CLIENT_SECRET }} diff --git a/.github/workflows/terratests-uat-suite.yaml b/.github/workflows/terratests-uat-suite.yaml index b365c3b..5fbbe63 100644 --- a/.github/workflows/terratests-uat-suite.yaml +++ b/.github/workflows/terratests-uat-suite.yaml @@ -7,7 +7,7 @@ on: jobs: test-PNFV: name: Setup UAT PNFV Tests - runs-on: ecx + runs-on: ubuntu-latest env: TF_VAR_equinix_client_id: ${{ secrets.EQUINIX_CLIENT_ID_PNFV }} TF_VAR_equinix_client_secret: ${{ secrets.EQUINIX_CLIENT_SECRET_PNFV }} @@ -55,7 +55,7 @@ jobs: test-PFCR: name: Setup UAT PFCR Tests - runs-on: ecx + runs-on: ubuntu-latest env: TF_VAR_equinix_client_id: ${{ secrets.EQUINIX_CLIENT_ID_PFCR }} TF_VAR_equinix_client_secret: ${{ secrets.EQUINIX_CLIENT_SECRET_PFCR }} @@ -125,7 +125,7 @@ jobs: upload-test-report: name: Upload Testing Report needs: [test-PNFV, test-PFCR] - runs-on: ecx + runs-on: ubuntu-latest steps: - name: Set up Go diff --git a/.github/workflows/terratests-virtualdevice-prod-suite.yaml b/.github/workflows/terratests-virtualdevice-prod-suite.yaml index 1295c73..f38872d 100644 --- a/.github/workflows/terratests-virtualdevice-prod-suite.yaml +++ b/.github/workflows/terratests-virtualdevice-prod-suite.yaml @@ -6,7 +6,7 @@ on: jobs: setup-tests: name: Setup PROD DIGP Tests - runs-on: ecx + runs-on: ubuntu-latest env: TF_VAR_equinix_client_id: ${{ secrets.EQUINIX_CLIENT_ID }} TF_VAR_equinix_client_secret: ${{ secrets.EQUINIX_CLIENT_SECRET }} From 729a7fb041abbbfe215e99d99e2eea66037755b9 Mon Sep 17 00:00:00 2001 From: "tomasz.tutka" Date: Tue, 14 Jan 2025 09:20:30 +0100 Subject: [PATCH 4/4] updated script to verify test status --- .github/workflows/terratests-fcr-prod-suite.yaml | 2 +- .github/workflows/terratests-metal-nimf-suite.yaml | 2 +- .github/workflows/terratests-port-prod-suite.yaml | 2 +- .github/workflows/terratests-prod-suite-all.yaml | 2 +- .github/workflows/terratests-uat-suite.yaml | 7 +++++++ .github/workflows/terratests-virtualdevice-prod-suite.yaml | 2 +- check_tests.sh | 7 ++++--- 7 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/terratests-fcr-prod-suite.yaml b/.github/workflows/terratests-fcr-prod-suite.yaml index 88d2298..d67dca6 100644 --- a/.github/workflows/terratests-fcr-prod-suite.yaml +++ b/.github/workflows/terratests-fcr-prod-suite.yaml @@ -82,4 +82,4 @@ jobs: compression-level: 0 - name: Check if Tests are passed - run: sh check_tests.sh + run: sh check_tests.sh *suite.log diff --git a/.github/workflows/terratests-metal-nimf-suite.yaml b/.github/workflows/terratests-metal-nimf-suite.yaml index 3b1f05c..7d85378 100644 --- a/.github/workflows/terratests-metal-nimf-suite.yaml +++ b/.github/workflows/terratests-metal-nimf-suite.yaml @@ -89,4 +89,4 @@ jobs: compression-level: 0 - name: Check if Tests are passed - run: sh check_tests.sh + run: sh check_tests.sh *suite.log diff --git a/.github/workflows/terratests-port-prod-suite.yaml b/.github/workflows/terratests-port-prod-suite.yaml index 9399eb2..0f9899e 100644 --- a/.github/workflows/terratests-port-prod-suite.yaml +++ b/.github/workflows/terratests-port-prod-suite.yaml @@ -88,4 +88,4 @@ jobs: compression-level: 0 - name: Check if Tests are passed - run: sh check_tests.sh + run: sh check_tests.sh *suite.log diff --git a/.github/workflows/terratests-prod-suite-all.yaml b/.github/workflows/terratests-prod-suite-all.yaml index 0b52705..45b40d7 100644 --- a/.github/workflows/terratests-prod-suite-all.yaml +++ b/.github/workflows/terratests-prod-suite-all.yaml @@ -124,4 +124,4 @@ jobs: compression-level: 0 - name: Check if Tests are passed - run: sh check_tests.sh + run: sh check_tests.sh *suite_all.log diff --git a/.github/workflows/terratests-uat-suite.yaml b/.github/workflows/terratests-uat-suite.yaml index 5fbbe63..0c0404b 100644 --- a/.github/workflows/terratests-uat-suite.yaml +++ b/.github/workflows/terratests-uat-suite.yaml @@ -53,6 +53,9 @@ jobs: name: pnfv_test_logs path: pnfv_test_output.log + - name: Check if Tests are passed + run: sh check_tests.sh output.log + test-PFCR: name: Setup UAT PFCR Tests runs-on: ubuntu-latest @@ -122,8 +125,12 @@ jobs: name: pfcr_test_logs path: pfcr_test_output.log + - name: Check if Tests are passed + run: sh check_tests.sh output.log + upload-test-report: name: Upload Testing Report + if: always() needs: [test-PNFV, test-PFCR] runs-on: ubuntu-latest diff --git a/.github/workflows/terratests-virtualdevice-prod-suite.yaml b/.github/workflows/terratests-virtualdevice-prod-suite.yaml index f38872d..f8f41a5 100644 --- a/.github/workflows/terratests-virtualdevice-prod-suite.yaml +++ b/.github/workflows/terratests-virtualdevice-prod-suite.yaml @@ -74,4 +74,4 @@ jobs: compression-level: 0 - name: Check if Tests are passed - run: sh check_tests.sh + run: sh check_tests.sh *suite.log diff --git a/check_tests.sh b/check_tests.sh index 550daf4..0e32be2 100644 --- a/check_tests.sh +++ b/check_tests.sh @@ -1,7 +1,8 @@ -file=$(find . -type f -iname "*suite.log") -if grep -q Error "$file"; then - echo "### Tests are failed !!! Please verify report" >> $GITHUB_STEP_SUMMARY +file=$(find . -type f -iname "*$1") + +if grep -q error "$file"; then + echo "### Tests are failed !!! Please verify report and log file $file" >> $GITHUB_STEP_SUMMARY exit 1 else echo "### Tests are passed !!! ::rocket::" >> $GITHUB_STEP_SUMMARY