Skip to content

Commit

Permalink
Merge pull request #5745 from elasticspoon/feat/enable-debug-logging-…
Browse files Browse the repository at this point in the history
…parallel-ci

testing parallel CI with debugging
  • Loading branch information
compwron authored May 26, 2024
2 parents 97c3cc0 + 8c90d50 commit 373fbb6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 5 additions & 4 deletions .github/workflows/combine_and_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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() }}
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/rspec_parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -101,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
Expand All @@ -115,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 }}
Expand Down
4 changes: 2 additions & 2 deletions .rspec_parallel
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 373fbb6

Please sign in to comment.