Skip to content

Commit

Permalink
updating cuzz with its own time limit
Browse files Browse the repository at this point in the history
  • Loading branch information
lastmjs committed Dec 20, 2024
1 parent 8f3f2e9 commit 4b0bb7b
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
required: false
type: string
default: '.1'
timeout:
time-limit:
description: 'Length of time (in minutes) after which the fuzz tests will automatically succeed'
required: false
type: string
Expand Down Expand Up @@ -41,5 +41,5 @@ jobs:
stable/test/end_to_end/candid_rpc/tuple_types
fuzz: true
call-delay: ${{ inputs.call-delay }}
timeout: ${{ inputs.timeout }}
time-limit: ${{ inputs.time-limit }}
link-azle: true
13 changes: 3 additions & 10 deletions .github/workflows/run_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
required: false
type: string
default: '.1'
timeout:
time-limit:
required: false
type: string
default: '300'
Expand Down Expand Up @@ -157,15 +157,7 @@ jobs:
echo "runs=$RUNS" >> $GITHUB_OUTPUT
- name: Run tests
run: |
timeout ${{ inputs.timeout }}m npm test
exit_code=$?
if [ $exit_code -eq 124 ] || [ $exit_code -eq 142 ]; then
# Exit code 124 is for timeout, 142 is for SIGALRM
exit 0
else
exit $exit_code
fi
run: npm test
working-directory: ${{ matrix.test.path }}
shell: bash -l {0}
env:
Expand All @@ -174,3 +166,4 @@ jobs:
AZLE_EXPERIMENTAL: ${{ inputs.run-experimental }}
AZLE_FUZZ: ${{ inputs.fuzz }}
AZLE_FUZZ_CALL_DELAY: ${{ inputs.call-delay }}
AZLE_FUZZ_TIME_LIMIT: ${{ inputs.time-limit }}

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

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"Method: stableMap17Insert \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught SyntaxError: unexpected data at the end",
"Method: stableMap17Remove \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught SyntaxError: unexpected token",
"Method: stableMap17Remove \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught SyntaxError: Unexpected end of JSON input",
"Method: stableMap17Remove \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught SyntaxError: unexpected data at the end",
"Method: stableMap17ContainsKey \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught SyntaxError: unexpected token",
"Method: stableMap17ContainsKey \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught SyntaxError: unexpected data at the end",
"Method: stableMap17ContainsKey \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught SyntaxError: Unexpected end of JSON input",
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"crypto-browserify": "^3.12.0",
"cuzz": "github:demergent-labs/cuzz#8f07ef174570bbb142e84516c55ec598a09c625c",
"cuzz": "github:demergent-labs/cuzz#e9dcc6fc2f4d55ef880469cbe836b8730b530d07",
"deep-is": "^0.1.4",
"esbuild": "^0.24.0",
"esbuild-plugin-tsc": "^0.4.0",
Expand Down
11 changes: 7 additions & 4 deletions test/fuzz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@ function fuzzTestCanister(canisterName: string, callDelay: string): void {
'--clear-console'
];

const cuzzArgs =
process.env.AZLE_FUZZ_TERMINAL === 'true'
? [...baseCuzzArgs, '--terminal']
: baseCuzzArgs;
const cuzzArgs = [
...baseCuzzArgs,
...(process.env.AZLE_FUZZ_TERMINAL === 'true' ? ['--terminal'] : []),
...(process.env.AZLE_FUZZ_TIME_LIMIT !== undefined
? ['--time-limit', process.env.AZLE_FUZZ_TIME_LIMIT]
: [])
];

let cuzzProcess = spawn('node_modules/.bin/cuzz', cuzzArgs, {
stdio: 'inherit'
Expand Down

0 comments on commit 4b0bb7b

Please sign in to comment.