From 6ceb3c89f9cc44313132972d6b5c50b90ec55443 Mon Sep 17 00:00:00 2001 From: elasticspoon Date: Wed, 22 May 2024 18:54:50 -0400 Subject: [PATCH 1/2] feat: enable debug logging in parallel CI feat: more debug logging --- .github/workflows/docker.yml | 2 +- .github/workflows/rspec_parallel.yml | 1 + .rspec_parallel | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cd223c8f87..eeaaf68f33 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -39,7 +39,7 @@ jobs: - name: compile js run: docker-compose exec -T web bundle exec rails javascript:build - name: Test - run: docker-compose exec -T web bundle exec rspec spec + run: docker-compose exec -T web bundle exec rspec spec --format documentation - name: Archive selenium screenshots if: ${{ failure() }} diff --git a/.github/workflows/rspec_parallel.yml b/.github/workflows/rspec_parallel.yml index ca99c34e3a..5d8b74331b 100644 --- a/.github/workflows/rspec_parallel.yml +++ b/.github/workflows/rspec_parallel.yml @@ -15,6 +15,7 @@ on: env: GROUPS_COMMA: ${{ join(fromJSON(inputs.groups), ',') }} GROUPS_UNDERSCORE: ${{ join(fromJSON(inputs.groups), '_') }} + ACTIONS_RUNNER_DEBUG: true jobs: rspec_parallel: diff --git a/.rspec_parallel b/.rspec_parallel index 3463e03292..976d0c8900 100644 --- a/.rspec_parallel +++ b/.rspec_parallel @@ -1,5 +1,5 @@ ---format RspecJunitFormatter ---out tmp/reports/rspec_<%= ENV["GROUPS_UNDERSCORE"] %>_<%= ENV["TEST_ENV_NUMBER"] %>.xml +--format RspecJunitFormatter --out tmp/reports/rspec_<%= ENV["GROUPS_UNDERSCORE"] %>_<%= ENV["TEST_ENV_NUMBER"] %>.xml +--format ParallelTests::RSpec::VerboseLogger --format ParallelTests::RSpec::RuntimeLogger --out tmp/parallel_runtime.log --format ParallelTests::RSpec::SummaryLogger --out tmp/spec_summary.log --format ParallelTests::RSpec::FailuresLogger --out tmp/failing_specs.log From 8c90d500a8f60e9726887b3d4dbefb8468e85657 Mon Sep 17 00:00:00 2001 From: elasticspoon Date: Wed, 22 May 2024 19:37:17 -0400 Subject: [PATCH 2/2] change how checks work --- .github/workflows/ci.yml | 1 + .github/workflows/combine_and_report.yml | 9 +++++---- .github/workflows/rspec_parallel.yml | 11 +++++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a94a206da2..860caa4b2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,7 @@ jobs: parallel_processes_count: 3 # the number of parallel processes to run tests in worker, must match the size of the # inner arrays in the matrix.groups combine_and_report: + if: ${{ !cancelled() }} uses: ./.github/workflows/combine_and_report.yml needs: [rspec_parallel] secrets: inherit diff --git a/.github/workflows/combine_and_report.yml b/.github/workflows/combine_and_report.yml index 60f68c3116..d08f2af9af 100644 --- a/.github/workflows/combine_and_report.yml +++ b/.github/workflows/combine_and_report.yml @@ -9,24 +9,27 @@ jobs: STORAGE_CONTAINER: ${{ secrets.STORAGE_CONTAINER }} steps: - name: Checkout Project + if: ${{ !cancelled() }} uses: actions/checkout@v4 - name: Download artifacts + if: ${{ !cancelled() }} uses: actions/download-artifact@v4 with: path: artifacts - name: Decompress chunk test reports + if: ${{ !cancelled() }} run: | find artifacts -name "test_reports*.zip" -exec unzip -d test_reports {} \; find test_reports -name "**/test_reports*.zip" -exec unzip -d test_reports {} \; - name: Merge parallel runtime log parts - if: env.AZURE_STORAGE_KEY != '' + if: ${{ !cancelled() && env.AZURE_STORAGE_KEY != '' }} run: | cat artifacts/**/parallel_runtime_rspec*.log > parallel_runtime.log - name: Upload log file to Azure Blob Storage - if: env.AZURE_STORAGE_KEY != '' + if: ${{ !cancelled() && env.AZURE_STORAGE_KEY != '' }} run: | az storage blob upload \ -c $STORAGE_CONTAINER \ @@ -41,8 +44,6 @@ jobs: paths: | test_reports/**/rspec*.xml - name: Set job status - # In this step we set the status of the job. Normally in case of failures, the next steps fail, so we have to - # use `if: always()` to make sure the next steps run. if: ${{ steps.test_summary.outputs.failed > 0 }} uses: actions/github-script@v7 with: diff --git a/.github/workflows/rspec_parallel.yml b/.github/workflows/rspec_parallel.yml index 5d8b74331b..c9adc25a5a 100644 --- a/.github/workflows/rspec_parallel.yml +++ b/.github/workflows/rspec_parallel.yml @@ -102,7 +102,7 @@ jobs: POSTGRES_PORT: 5432 RUN_SIMPLECOV: true CC_TEST_REPORTER_ID: 31464536e34ab26588cb951d0fa6b5898abdf401dbe912fd47274df298e432ac - continue-on-error: true + # continue-on-error: true run: | # curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter # chmod +x ./cc-test-reporter @@ -116,31 +116,34 @@ jobs: # echo 'Tests completed. Uploading to Code Climate' # ./cc-test-reporter after-build --exit-code $? - cat tmp/spec_summary.log + # cat tmp/spec_summary.log - name: Compress reports + if: ${{ !cancelled() }} run: | zip -r test_reports_${{ env.GROUPS_UNDERSCORE }}.zip tmp/reports - name: Compress log - if: env.AZURE_STORAGE_KEY != '' + if: ${{ !cancelled() && env.AZURE_STORAGE_KEY != '' }} run: | mv tmp/parallel_runtime.log parallel_runtime_rspec_${{ env.GROUPS_UNDERSCORE }}.log - name: Upload test reports + if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 with: name: test_reports_${{ env.GROUPS_UNDERSCORE }}.zip path: test_reports_${{ env.GROUPS_UNDERSCORE }}.zip - name: Upload file parallel tests runtime log - if: env.AZURE_STORAGE_KEY != '' + if: ${{ !cancelled() && env.AZURE_STORAGE_KEY != '' }} uses: actions/upload-artifact@v4 with: name: parallel_runtime_rspec_${{ env.GROUPS_UNDERSCORE }}.log path: parallel_runtime_rspec_${{ env.GROUPS_UNDERSCORE }}.log - name: Upload Selenium Screenshots + if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 with: name: screenshots_${{ env.GROUPS_UNDERSCORE }}