Skip to content

Commit

Permalink
test: verify distinct error code is returned from large output test
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-fields committed Aug 4, 2022
1 parent 0e031ae commit 5161d68
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 19 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:

jobs:
# runs on branch pushes only
ci_unuit:
ci_unit:
name: Run Unit Tests
if: startsWith(github.ref, 'refs/heads')
runs-on: ubuntu-latest
Expand Down Expand Up @@ -46,8 +46,8 @@ jobs:
max_attempts: 2
command: node -e 'console.log(process.env.NODE_OPTIONS)'

ci_integration_sigpipe:
name: Run Integration Issue#76 Tests
ci_integration_large_output:
name: Run Integration Large Output Tests
if: startsWith(github.ref, 'refs/heads')
runs-on: ubuntu-latest
strategy:
Expand All @@ -61,18 +61,24 @@ jobs:
node-version: 16
- name: Install dependencies
run: npm ci
- name: 100MiB
- name: Test 100MiB of output can be processed
id: large-output
continue-on-error: true
uses: ./
with:
max_attempts: 1
timeout_minutes: 5
command: 'make bytes-102400'
- uses: nick-invision/assert-action@v1
command: 'make -C ./test-data/large-output bytes-102400'
- name: Assert test had expected result
uses: nick-invision/assert-action@v1
with:
expected: failure
actual: ${{ steps.large-output.outcome }}
- name: Assert exit code is expected
uses: nick-invision/assert-action@v1
with:
expected: 33
actual: ${{ steps.large-output.outputs.exit_code }}

ci_integration:
name: Run Integration Tests
Expand Down
9 changes: 0 additions & 9 deletions Makefile

This file was deleted.

12 changes: 8 additions & 4 deletions sample.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# these are the bare minimum envvars required
INPUT_TIMEOUT_MINUTES=1
INPUT_MAX_ATTEMPTS=3
INPUT_COMMAND="node -e 'process.exit(99)'"
INPUT_RETRY_WAIT_SECONDS=10
SHELL=pwsh
INPUT_POLLING_INTERVAL_SECONDS=1
INPUT_RETRY_ON=any
INPUT_CONTINUE_ON_ERROR=false

# these are optional
#INPUT_RETRY_WAIT_SECONDS=10
#SHELL=pwsh
#INPUT_POLLING_INTERVAL_SECONDS=1
#INPUT_RETRY_ON=any
13 changes: 13 additions & 0 deletions test-data/large-output/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SHELL = bash

# this tests fix for the following issues
# https://github.com/nick-fields/retry/issues/76
# https://github.com/nick-fields/retry/issues/84

bytes-%:
for i in {1..$*}; do cat kibibyte.txt; done; exit 33
.PHONY: bytes-%

lines-%:
for i in {1..$*}; do echo a; done; exit 33
.PHONY: lines-%
File renamed without changes.

0 comments on commit 5161d68

Please sign in to comment.