Skip to content

Commit

Permalink
feat: more parallel test changes (rubyforgood#5730)
Browse files Browse the repository at this point in the history
If statements were incorrect on main branch,
updated with corrections (was not passing secrets
in when they were needed).

Removed code climate from parallel tests
  • Loading branch information
elasticspoon authored May 21, 2024
1 parent b9d6bd5 commit 28b0684
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/combine_and_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,29 @@ on:
jobs:
combine_and_report:
runs-on: ubuntu-latest
env:
AZURE_STORAGE_KEY: ${{ secrets.STORAGE_ACCESS_KEY }}
AZURE_STORAGE_ACCOUNT: ${{ secrets.ACCOUNT_NAME }}
STORAGE_CONTAINER: ${{ secrets.STORAGE_CONTAINER }}
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Decompress chunk test reports
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 != ''
run: |
cat artifacts/**/parallel_runtime_rspec*.log > parallel_runtime.log
- name: Upload log file to Azure Blob Storage
env:
AZURE_STORAGE_KEY: ${{ secrets.STORAGE_ACCESS_KEY }}
AZURE_STORAGE_ACCOUNT: ${{ secrets.ACCOUNT_NAME }}
STORAGE_CONTAINER: ${{ secrets.STORAGE_CONTAINER }}
if: env.AZURE_STORAGE_KEY != ''
run: |
az storage blob upload \
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/rspec_parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
BUNDLE_WITHOUT: "development"
CI_TOTAL_JOBS: ${{ inputs.group_count }}
CI_JOB_INDEX: ${{ inputs.groups }}
AZURE_STORAGE_KEY: ${{ secrets.STORAGE_ACCESS_KEY }}
AZURE_STORAGE_ACCOUNT: ${{ secrets.ACCOUNT_NAME }}
STORAGE_CONTAINER: ${{ secrets.STORAGE_CONTAINER }}
services:
db:
image: postgres:14.8
Expand All @@ -42,10 +45,6 @@ jobs:
- uses: actions/checkout@v4

- name: Download parallel runtime log from Azure Blob Storage
env:
AZURE_STORAGE_KEY: ${{ secrets.STORAGE_ACCESS_KEY }}
AZURE_STORAGE_ACCOUNT: ${{ secrets.ACCOUNT_NAME }}
STORAGE_CONTAINER: ${{ secrets.STORAGE_CONTAINER }}
if: env.AZURE_STORAGE_KEY != ''
run: |
az storage blob download \
Expand Down Expand Up @@ -104,18 +103,18 @@ jobs:
CC_TEST_REPORTER_ID: 31464536e34ab26588cb951d0fa6b5898abdf401dbe912fd47274df298e432ac
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
./cc-test-reporter before-build
# curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
# chmod +x ./cc-test-reporter
# ./cc-test-reporter before-build
RUBYOPT='-W:no-deprecated -W:no-experimental' bundle exec parallel_rspec \
-n "${CI_TOTAL_JOBS}" \
--only-group "${CI_JOB_INDEX}" \
--runtime-log old_parallel_runtime.log \
--verbose ./spec
echo 'Tests completed. Uploading to Code Climate'
./cc-test-reporter after-build --exit-code $?
# echo 'Tests completed. Uploading to Code Climate'
# ./cc-test-reporter after-build --exit-code $?
cat tmp/spec_summary.log
- name: Compress reports
Expand Down

0 comments on commit 28b0684

Please sign in to comment.