Skip to content

Commit

Permalink
test: move timeout tests to their own job to speed things up slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-fields committed Aug 3, 2022
1 parent 3dad7de commit 950013a
Show file tree
Hide file tree
Showing 3 changed files with 182 additions and 23 deletions.
56 changes: 35 additions & 21 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:

jobs:
# runs on branch pushes only
ci:
name: Run Tests
ci_integration:
name: Run Integration Tests
if: startsWith(github.ref, 'refs/heads')
runs-on: ubuntu-18.04
steps:
Expand Down Expand Up @@ -220,7 +220,39 @@ jobs:
expected: 2
actual: ${{ steps.retry_on_error.outputs.exit_code }}

# timeout tests (takes longer to run so run last)
- name: sad-path (wrong shell for OS)
id: wrong_shell
uses: ./
continue-on-error: true
with:
timeout_minutes: 1
max_attempts: 2
shell: cmd
command: 'dir'
- uses: nick-invision/assert-action@v1
with:
expected: 2
actual: ${{ steps.wrong_shell.outputs.total_attempts }}
- uses: nick-invision/assert-action@v1
with:
expected: failure
actual: ${{ steps.wrong_shell.outcome }}

ci_integration_timeout:
name: Run Integration Timeout Tests
if: startsWith(github.ref, 'refs/heads')
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install dependencies
run: npm ci

# timeout tests (takes longer to run so run last)
- name: sad-path (timeout)
id: sad_path_timeout
uses: ./
Expand Down Expand Up @@ -295,24 +327,6 @@ jobs:
expected: failure
actual: ${{ steps.sad_path_timeout.outcome }}

- name: sad-path (wrong shell for OS)
id: wrong_shell
uses: ./
continue-on-error: true
with:
timeout_minutes: 1
max_attempts: 2
shell: cmd
command: 'dir'
- uses: nick-invision/assert-action@v1
with:
expected: 2
actual: ${{ steps.wrong_shell.outputs.total_attempts }}
- uses: nick-invision/assert-action@v1
with:
expected: failure
actual: ${{ steps.wrong_shell.outcome }}

ci_windows:
name: Run Windows Tests
if: startsWith(github.ref, 'refs/heads')
Expand Down
143 changes: 142 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"prettier": "^2.7.1",
"semantic-release": "19.0.3",
"ts-node": "9.0.0",
"typescript": "^4.7.4"
"typescript": "^4.7.4",
"yaml-lint": "^1.7.0"
},
"lint-staged": {
"**/*.ts": [
Expand All @@ -53,6 +54,9 @@
],
"**/*.{md,yaml,yml}": [
"npm run style:base --"
],
"**/*.{yaml,yml}": [
"npx yamllint "
]
}
}

0 comments on commit 950013a

Please sign in to comment.