Skip to content

Commit

Permalink
chore: updating tests to tap18
Browse files Browse the repository at this point in the history
  • Loading branch information
ruyadorno committed Nov 15, 2023
1 parent b28c55e commit 1456db9
Show file tree
Hide file tree
Showing 11 changed files with 1,322 additions and 1,686 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:

- name: Calculate base code coverage
run: |
export CUR_COVER=$(npx c8 tap | xargs -0 node -p 'parseInt(process.argv[1].split("\nAll files")[1].split("|")[1].trim(), 10)')
export CUR_COVER=$(npx tap | xargs -0 node -p 'parseInt(process.argv[1].split("\nAll files")[1].split("|")[1].trim(), 10)')
echo "CUR_COVER=$CUR_COVER" >> $GITHUB_ENV
- name: Checkout PR branch
Expand All @@ -75,7 +75,7 @@ jobs:

- name: Calculate PR code coverage
run: |
export PR_COVER=$(npx c8 tap | xargs -0 node -p 'parseInt(process.argv[1].split("\nAll files")[1].split("|")[1].trim(), 10)')
export PR_COVER=$(npx tap | xargs -0 node -p 'parseInt(process.argv[1].split("\nAll files")[1].split("|")[1].trim(), 10)')
echo "PR_COVER=$PR_COVER" >> $GITHUB_ENV
- name: Verify code coverage. If your reading this and the step has failed, please add tests to cover your changes.
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,23 @@ jobs:
- name: Transpile TypeScript
run: npm run prepare

- name: Setup v14.x-compatible tap
if: "${{ matrix.node-version == 'v14.x' }}"
run: npm uninstall tap && npm install tap@16 && npx npm@10 pkg delete tap

- name: Run Tests
run: npx c8 tap -c -t0 -o test_results.tap
if: "${{ matrix.node-version != 'v14.x' }}"
run: npx tap -c -t0 -o test_results.tap
timeout-minutes: 5

- name: Run Tests v14.x
if: "${{ matrix.node-version == 'v14.x' }}"
run: npx tap -c -t0 --no-coverage --no-ts --node-arg="--require" --node-arg="./scripts/tap16-adapter.js" --node-arg="--no-warnings" --node-arg="--loader" --node-arg="ts-node/esm"
timeout-minutes: 5

- name: Convert test output to XML
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && always() }}
run: cat test_results.tap | npx tap - --reporter=xunit > sponge_log.xml
run: cat test_results.tap | npx tap - --reporter=junit > sponge_log.xml

- name: FlakyBot (Linux)
# only run flakybot on periodic (schedule) and continuous (push) events
Expand Down Expand Up @@ -231,12 +241,12 @@ jobs:
SQLSERVER_USER: '${{ steps.secrets.outputs.SQLSERVER_USER }}'
SQLSERVER_PASS: '${{ steps.secrets.outputs.SQLSERVER_PASS }}'
SQLSERVER_DB: '${{ steps.secrets.outputs.SQLSERVER_DB }}'
run: npx tap -c -t0 --no-coverage system-test -o test_results.tap
run: npx tap -c -t0 --disable-coverage --allow-empty-coverage system-test -o test_results.tap
timeout-minutes: 5

- name: Convert test output to XML
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && always() }}
run: cat test_results.tap | npx tap - --reporter=xunit > sponge_log.xml
run: cat test_results.tap | npx tap - --reporter=junit > sponge_log.xml

- name: FlakyBot (Linux)
# only run flakybot on periodic (schedule) and continuous (push) events
Expand Down
Loading

0 comments on commit 1456db9

Please sign in to comment.