diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index bbdcdd0176..1d995b79f0 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -8,32 +8,54 @@ 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 default: '300' jobs: + get-exclude-dirs: + name: Get exclude directories + runs-on: ubuntu-latest + outputs: + exclude-dirs: ${{ steps.get-exclude-dirs.outputs.exclude-dirs }} + steps: + - uses: actions/checkout@v4 + - id: get-exclude-dirs + uses: ./.github/actions/get_exclude_dirs + with: + exclude-slow: false + exclude-unstable: true + exclude-release-only: true + run-tests: name: ${{ matrix.test_group.name }} + needs: get-exclude-dirs strategy: fail-fast: false matrix: test_group: - { - name: 'E2E Class', - directories: './tests/end_to_end/candid_rpc/class_syntax' + name: 'Stable E2E CRPC', + directories: './examples/stable/test/end_to_end/candid_rpc' } - { - name: 'Property IC API', - directories: './tests/property/ic_api' + name: 'Stable Property IC API', + directories: './examples/stable/test/property/ic_api' } uses: ./.github/workflows/run_test.yml with: directories: ${{ matrix.test_group.directories }} - exclude-dirs: class_syntax/new + exclude-dirs: >- + stable/test/end_to_end/candid_rpc/new + stable/test/end_to_end/candid_rpc/ethereum_json_rpc + stable/test/end_to_end/candid_rpc/motoko_examples/superheroes + stable/test/end_to_end/candid_rpc/outgoing_http_requests + stable/test/end_to_end/candid_rpc/recursion + stable/test/end_to_end/candid_rpc/tuple_types + ${{ needs.get-exclude-dirs.outputs.exclude-dirs }} fuzz: true call-delay: ${{ inputs.call-delay }} - timeout: ${{ inputs.timeout }} + time-limit: ${{ inputs.time-limit }} link-azle: true diff --git a/.github/workflows/run_test.yml b/.github/workflows/run_test.yml index 3e74670e81..57dc01fe90 100644 --- a/.github/workflows/run_test.yml +++ b/.github/workflows/run_test.yml @@ -25,7 +25,7 @@ on: required: false type: string default: '.1' - timeout: + time-limit: required: false type: string default: '300' @@ -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: @@ -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 }} diff --git a/canister_templates/experimental.wasm b/canister_templates/experimental.wasm index b44384ef6d..e371c12459 100644 Binary files a/canister_templates/experimental.wasm and b/canister_templates/experimental.wasm differ diff --git a/canister_templates/stable.wasm b/canister_templates/stable.wasm index c8e6b7b328..e0803b4ada 100644 Binary files a/canister_templates/stable.wasm and b/canister_templates/stable.wasm differ diff --git a/examples/stable/test/end_to_end/candid_rpc/audio_recorder/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/audio_recorder/cuzz.json index a6eb35bb48..36f06780b7 100644 --- a/examples/stable/test/end_to_end/candid_rpc/audio_recorder/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/audio_recorder/cuzz.json @@ -1,3 +1,7 @@ { - "expectedErrors": ["User does not exist:", "Recording does not exist:"] + "expectedErrors": [ + "Method: deleteUser \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: User does not exist:", + "Method: createRecording \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: User does not exist:", + "Method: deleteRecording \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Recording does not exist:" + ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/call_raw/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/call_raw/cuzz.json index 04e8cacbf0..2fdf279cb4 100644 --- a/examples/stable/test/end_to_end/candid_rpc/call_raw/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/call_raw/cuzz.json @@ -1,3 +1,13 @@ { - "expectedErrors": ["Candid parser error"] + "expectedErrors": [ + "Method: executeCallRaw \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught: Candid parser error: Unrecognized token", + "Method: executeCallRaw \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught: Candid parser error: Unrecognized EOF found at", + "Method: executeCallRaw \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught: Candid parser error: Unknown token", + "Method: executeCallRaw \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught: Candid parser error: Unclosed string at", + "Method: executeCallRaw \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught: Candid parser error: Unknown escape character", + "Method: executeCallRaw \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught: Candid parser error: Unexpected string", + "Reject text:.*Uncaught: Candid parser error: Unknown token", + "Reject text:.*Uncaught: Candid parser error: Unrecognized token", + "Reject text:.*Uncaught: Candid parser error: Unrecognized EOF found at" + ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/candid_encoding/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/candid_encoding/cuzz.json index c13c97c20a..bc3fb5bc74 100644 --- a/examples/stable/test/end_to_end/candid_rpc/candid_encoding/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/candid_encoding/cuzz.json @@ -1,3 +1,11 @@ { - "expectedErrors": ["Cannot parse header", "Candid parser error"] + "expectedErrors": [ + "Method: candidDecode \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Cannot parse header", + "Method: candidEncode \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unrecognized token", + "Method: candidEncode \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unrecognized EOF found at", + "Method: candidEncode \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unknown token", + "Method: candidEncode \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unclosed string at", + "Method: candidEncode \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unknown escape character", + "Method: candidEncode \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unclosed comment at" + ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/canister/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/canister/cuzz.json index d38d911f35..d7b29a2e12 100644 --- a/examples/stable/test/end_to_end/candid_rpc/canister/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/canister/cuzz.json @@ -1,7 +1,7 @@ { "expectedErrors": [ - "No route to canister", - "Management canister has no method", - "not found" + "Method: canisterCrossCanisterCall \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, No route to canister", + "Method: canisterCrossCanisterCall \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 5, IC0536: Management canister has no method", + "Method: canisterCrossCanisterCall \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Canister .* not found" ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/complex_types/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/complex_types/cuzz.json index f5cb891e6d..e21f468a49 100644 --- a/examples/stable/test/end_to_end/candid_rpc/complex_types/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/complex_types/cuzz.json @@ -1,10 +1,19 @@ { - "callDelay": ".25", "expectedErrors": [ - "Author not found", - "Post not found", - "Thread not found", - "cannot read property 'Symbol.iterator' of undefined", - "Canister trapped: heap out of bounds" + "Reject text:.*Uncaught Error: Author not found", + "Reject text:.*Uncaught TypeError: cannot read property 'Symbol.iterator' of undefined", + "Reject text:.*Error from Canister .*: Canister trapped: heap out of bounds", + "Method: createPost \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Author not found", + "Method: createReaction \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Author not found", + "Method: createThread \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Author not found", + "Method: createPost \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Thread not found", + "Method: createReaction \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Post not found", + "Method: createPost \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught TypeError: cannot read property 'Symbol.iterator' of undefined", + "Method: createReaction \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught TypeError: cannot read property 'Symbol.iterator' of undefined", + "Method: createThread \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught TypeError: cannot read property 'Symbol.iterator' of undefined", + "Method: getAllUsers \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Canister trapped: heap out of bounds", + "Method: getAllPosts \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Canister trapped: heap out of bounds", + "Method: getAllReactions \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Canister trapped: heap out of bounds", + "Method: getAllThreads \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Canister trapped: heap out of bounds" ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/composite_queries/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/composite_queries/cuzz.json index d056d2453b..6ed12a3ed9 100644 --- a/examples/stable/test/end_to_end/candid_rpc/composite_queries/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/composite_queries/cuzz.json @@ -1,7 +1,7 @@ { "expectedErrors": [ - "Canister violated contract: \\\"ic0_call_new\\\" cannot be executed in non replicated query mode", - "Composite query cannot be called in replicated mode", + "Method: simpleQuery \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Canister violated contract: \\\\\"ic0_call_new\\\\\" cannot be executed in non replicated query mode", + "Method: simpleUpdate \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Composite query cannot be called in replicated mode", "Canister has no query method 'updateQuery'" ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/cross_canister_calls/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/cross_canister_calls/cuzz.json index 2043e153be..bf9d21892b 100644 --- a/examples/stable/test/end_to_end/candid_rpc/cross_canister_calls/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/cross_canister_calls/cuzz.json @@ -1,7 +1,11 @@ { "expectedErrors": [ - "hahahaha", - "Uncaught TypeError: cannot convert to bigint", - "Failed to encode Candid arguments" + "Reject text:.*Canister called `ic0.trap` with message: hahahaha", + "Reject text:.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid opt record {id:text; balance:nat64} argument", + "Method: trap \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Canister called `ic0.trap` with message: hahahaha", + "Method: trap \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Canister called `ic0.trap` with message: hahahaha", + "Method: account \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid opt record", + "Method: account \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid opt record", + "Method: transfer \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught TypeError: cannot convert to bigint" ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/date/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/date/cuzz.json index 50252e101f..bef7ff7994 100644 --- a/examples/stable/test/end_to_end/candid_rpc/date/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/date/cuzz.json @@ -1,9 +1,42 @@ { "expectedErrors": [ - "Date value is NaN", - "Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument: null", - "Uncaught Error: Failed to encode Candid arguments: Error: Invalid text argument: null", - "Uncaught RangeError: cannot convert NaN or Infinity to BigInt", - "Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat64 argument" + "Method: dateToJSONString \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid text argument: null", + "Method: dateToISOString \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught RangeError: Date value is NaN", + "Method: getDate \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getFullYear \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getMonth \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getDay \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getHours \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getMinutes \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getSeconds \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getMilliseconds \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getTimezoneOffset \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getUtcDate \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getUtcFullYear \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getUtcMonth \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getUtcHours \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getUtcMinutes \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getUtcSeconds \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getUtcMilliseconds \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getUtcDay \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: setDate \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: setFullYear \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: setMonth \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: setHours \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: setMinutes \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: setSeconds \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: setMilliseconds \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: setUtcDate \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: setUtcFullYear \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: setUtcMonth \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: setUtcHours \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: setUtcMinutes \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: setUtcSeconds \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: setUtcMilliseconds \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat32 argument", + "Method: getTime \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught RangeError: cannot convert NaN or Infinity to BigInt", + "Method: setTime \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught RangeError: cannot convert NaN or Infinity to BigInt", + "Method: parse \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught RangeError: cannot convert NaN or Infinity to BigInt", + "Method: utc \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught RangeError: cannot convert NaN or Infinity to BigInt", + "Method: utc \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat64 argument" ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/ic_api/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/ic_api/cuzz.json index 31c91198c0..177ac901f2 100644 --- a/examples/stable/test/end_to_end/candid_rpc/ic_api/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/ic_api/cuzz.json @@ -1,7 +1,7 @@ { "expectedErrors": [ - "Canister violated contract: ic0_certified_data_set failed because the passed data must be no larger than 32 bytes", - "Method: reject (query)", - "Method: trap (query)" + "Method: setCertifiedData \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Canister violated contract: ic0_certified_data_set failed because the passed data must be no larger than 32 bytes", + "Method: reject \\(query\\)", + "Method: trap \\(query\\)" ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/icrc/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/icrc/cuzz.json index 5fe258bfc4..fef3cb049c 100644 --- a/examples/stable/test/end_to_end/candid_rpc/icrc/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/icrc/cuzz.json @@ -1,7 +1,11 @@ { "expectedErrors": [ - "assertion failed at ICRC1.mo:262.5-262.37", - "assertion failed at ICRC1.mo:268.20-268.59", - "is larger than the max allowed 2097152" + "Method: icrc1_transfer \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*assertion failed at ICRC1.mo:262.5-262.37", + "Method: icrc1_transfer \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*assertion failed at ICRC1.mo:268.20-268.59", + "Method: icrc2_transfer_from \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*assertion failed at ICRC1.mo:262.5-262.37", + "Method: icrc2_transfer_from \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*assertion failed at ICRC1.mo:268.20-268.59", + "Method: icrc2_approve \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*assertion failed at ICRC1.mo:268.20-268.59", + "Method: icrc2_approve \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*assertion failed at ICRC1.mo:262.5-262.37", + "xis larger than the max allowed 2097152" ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/inspect_message/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/inspect_message/cuzz.json index d14d3eb54c..63fb2366c6 100644 --- a/examples/stable/test/end_to_end/candid_rpc/inspect_message/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/inspect_message/cuzz.json @@ -1,6 +1,6 @@ { "expectedErrors": [ - "Method \\\"alsoInaccessible\\\" not allowed", - "Method: inaccessible (update)" + "Uncaught: Method \\\\\"alsoInaccessible\\\\\" not allowed", + "Method: inaccessible \\(update\\)" ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/ledger_canister/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/ledger_canister/cuzz.json index fa251d4f79..c170dcc220 100644 --- a/examples/stable/test/end_to_end/candid_rpc/ledger_canister/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/ledger_canister/cuzz.json @@ -1,6 +1,14 @@ { "expectedErrors": [ - "Invalid account identifier: Checksum failed for", - "Deserialization Failed" + "Method: executeTransfer \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Invalid account identifier: Checksum failed for .*, expected check bytes .* but found", + "Method: getAccountBalance \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Invalid account identifier: Checksum failed for .*, expected check bytes .* but found", + "Method: account_balance \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Invalid account identifier: Checksum failed for .*, expected check bytes .* but found", + "Method: account_balance \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Deserialization Failed: \\\\\"Fail to decode argument 0 from table1 to record", + "Method: query_blocks \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Deserialization Failed: \\\\\"Fail to decode argument 0 from table0 to record", + "Method: executeTransfer \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Deserialization Failed: \\\\\"Fail to decode argument 0 from table5 to record", + "Method: transfer \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Deserialization Failed: \\\\\"Fail to decode argument 0 from table5 to record", + "Method: transfer \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Invalid account identifier: Checksum failed for .*, expected check bytes .* but found", + "Method: getAccountBalance \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Deserialization Failed: \\\\\"Fail to decode argument 0 from table1 to record", + "Method: getBlocks \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Deserialization Failed: \\\\\"Fail to decode argument 0 from table0 to record" ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/list_of_lists/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/list_of_lists/cuzz.json index 4d9a135b02..f3dca03937 100644 --- a/examples/stable/test/end_to_end/candid_rpc/list_of_lists/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/list_of_lists/cuzz.json @@ -1,8 +1,14 @@ { "expectedErrors": ["Anything you want"], - "maxLength": { - "text": 100, - "vec": 100, - "blob": 100 + "size": { + "text": { + "max": 100 + }, + "vec": { + "max": 100 + }, + "blob": { + "max": 100 + } } } diff --git a/examples/stable/test/end_to_end/candid_rpc/management_canister/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/management_canister/cuzz.json index bb70535cb3..51217388c1 100644 --- a/examples/stable/test/end_to_end/candid_rpc/management_canister/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/management_canister/cuzz.json @@ -1,6 +1,32 @@ { "expectedErrors": [ - "Uncaught Error: Rejection code 3, Unable to route management canister request", - "not found" + "Method: executeClearChunkStore \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Unable to route management canister request", + "Method: executeClearChunkStore \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Canister .* not found", + "Method: executeDeleteCanister \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Unable to route management canister request", + "Method: executeDeleteCanister \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Canister .* not found", + "Method: executeInstallCode \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Unable to route management canister request", + "Method: executeInstallCode \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Canister .* not found", + "Method: executeInstallChunkedCode \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Unable to route management canister request", + "Method: executeInstallChunkedCode \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, InstallChunkedCode Error: Store canister .* was not found on subnet .* of target canister", + "Method: executeStopCanister \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Unable to route management canister request", + "Method: executeStopCanister \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Canister .* not found", + "Method: executeUninstallCode \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Unable to route management canister request", + "Method: executeUninstallCode \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Canister .* not found", + "Method: executeUpdateSettings \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Unable to route management canister request", + "Method: executeUpdateSettings \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Canister .* not found", + "Method: executeUploadChunk \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Unable to route management canister request", + "Method: executeUploadChunk \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Canister .* not found", + "Method: getStoredChunks \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Unable to route management canister request", + "Method: getStoredChunks \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Canister .* not found", + "Method: getCanisterStatus \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Unable to route management canister request", + "Method: getCanisterStatus \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Canister .* not found", + "Method: provisionalTopUpCanister \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Unable to route management canister request", + "Method: provisionalTopUpCanister \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Canister .* not found", + "Method: executeStartCanister \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Unable to route management canister request", + "Method: executeStartCanister \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Canister .* not found", + "Method: executeDepositCycles \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Unable to route management canister request", + "Method: executeDepositCycles \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Canister .* not found", + "Method: getCanisterInfo \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Unable to route management canister request", + "Method: getCanisterInfo \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Rejection code 3, Canister .* not found" ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/motoko_examples/cert-var/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/motoko_examples/cert-var/cuzz.json index f0cf2b8715..04f23be934 100644 --- a/examples/stable/test/end_to_end/candid_rpc/motoko_examples/cert-var/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/motoko_examples/cert-var/cuzz.json @@ -1,3 +1,5 @@ { - "expectedErrors": ["Uncaught Error: Invalid nat32 argument: 4294967296"] + "expectedErrors": [ + "Method: inc \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: Invalid nat32 argument: 4294967296" + ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/motoko_examples/factorial/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/motoko_examples/factorial/cuzz.json index 5ef1c67243..702aae2180 100644 --- a/examples/stable/test/end_to_end/candid_rpc/motoko_examples/factorial/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/motoko_examples/factorial/cuzz.json @@ -1,3 +1,5 @@ { - "expectedErrors": ["Canister trapped: heap out of bounds"] + "expectedErrors": [ + "Method: fac \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Canister trapped: heap out of bounds" + ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/motoko_examples/http_counter/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/motoko_examples/http_counter/cuzz.json index b039a5d043..a937aa52ac 100644 --- a/examples/stable/test/end_to_end/candid_rpc/motoko_examples/http_counter/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/motoko_examples/http_counter/cuzz.json @@ -1,3 +1,5 @@ { - "expectedErrors": ["should not happen"] + "expectedErrors": [ + "Method: http_streaming \\(query\\)[\\s\\S]*should not happen" + ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/motoko_examples/threshold_ecdsa/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/motoko_examples/threshold_ecdsa/cuzz.json index 080ce623c3..3d3a5def79 100644 --- a/examples/stable/test/end_to_end/candid_rpc/motoko_examples/threshold_ecdsa/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/motoko_examples/threshold_ecdsa/cuzz.json @@ -1,3 +1,5 @@ { - "expectedErrors": ["messageHash must be 32 bytes"] + "expectedErrors": [ + "Method: sign \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*messageHash must be 32 bytes" + ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/primitive_types/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/primitive_types/cuzz.json index fb5e40afb2..a5aa7262ac 100644 --- a/examples/stable/test/end_to_end/candid_rpc/primitive_types/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/primitive_types/cuzz.json @@ -1,6 +1,6 @@ { "expectedErrors": [ - "Uncaught: Anything you want", + "Method: getEmpty \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Anything you want", "Error: Invalid empty argument: undefined" ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/principal/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/principal/cuzz.json index d898ee0a42..028be4198f 100644 --- a/examples/stable/test/end_to_end/candid_rpc/principal/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/principal/cuzz.json @@ -1,6 +1,6 @@ { "expectedErrors": [ - "Uncaught Error: Invalid character", - "does not have a valid checksum" + "Method: principalFromText \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Invalid character", + "Method: principalFromText \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: .*does not have a valid checksum" ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/rejections/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/rejections/cuzz.json index 766c48abb7..7f564a9a20 100644 --- a/examples/stable/test/end_to_end/candid_rpc/rejections/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/rejections/cuzz.json @@ -1,3 +1,6 @@ { - "expectedErrors": ["Method: reject (query)", "Method: error (query)"] + "expectedErrors": [ + "Method: reject \\(query\\)", + "Method: error \\(query\\)" + ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/simple_erc20/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/simple_erc20/cuzz.json index d143fac90c..fae4b647a7 100644 --- a/examples/stable/test/end_to_end/candid_rpc/simple_erc20/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/simple_erc20/cuzz.json @@ -1,6 +1,6 @@ { "expectedErrors": [ - "Uncaught TypeError: cannot convert to bigint", - "Uncaught Error: Failed to encode Candid arguments: Error: Invalid nat64 argument" + "Method: transfer \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught TypeError: cannot convert to bigint", + "xUncaught Error: Failed to encode Candid arguments: Error: Invalid nat64 argument" ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/simple_user_accounts/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/simple_user_accounts/cuzz.json index 7b9dc1bf48..48a9b201ab 100644 --- a/examples/stable/test/end_to_end/candid_rpc/simple_user_accounts/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/simple_user_accounts/cuzz.json @@ -1,6 +1,6 @@ { "expectedErrors": [ - "Canister called `ic0.trap` with message: Uncaught Error: Failed to encode Candid arguments: Error: Invalid opt record {id:text; username:text} argument: [null]", - "Canister called `ic0.trap` with message: Uncaught Error: Failed to encode Candid arguments: Error: Invalid opt record {id:text; username:text} argument: [{}]" + "Method: getUserById \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Canister called `ic0.trap` with message: Uncaught Error: Failed to encode Candid arguments: Error: Invalid opt record {id:text; username:text}", + "Method: createRecording \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Canister called `ic0.trap` with message: Uncaught Error: Failed to encode Candid arguments: Error: Invalid opt record {id:text; username:text}" ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/stable_structures/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/stable_structures/cuzz.json index 6d3fdcadca..f1a006099e 100644 --- a/examples/stable/test/end_to_end/candid_rpc/stable_structures/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/stable_structures/cuzz.json @@ -1,3 +1,24 @@ { - "expectedErrors": ["Uncaught SyntaxError"] + "expectedErrors": [ + "Method: stableMap16Insert \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught SyntaxError: unexpected token", + "Method: stableMap16Insert \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught SyntaxError: expecting property name", + "Method: stableMap16Insert \\(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: stableMap16Insert \\(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: stableMap17Insert \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught SyntaxError: unexpected token", + "Method: stableMap17Insert \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught SyntaxError: expecting property name", + "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: stableMap17Insert \\(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 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: stableMap17Remove \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught SyntaxError: unexpected end of string", + "Method: stableMap17Remove \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught SyntaxError: expecting property name", + "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", + "Method: stableMap17ContainsKey \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught SyntaxError: unexpected end of string", + "Method: stableMap17Get \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught SyntaxError: unexpected token", + "Method: stableMap17Get \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught SyntaxError: Unexpected end of JSON input", + "Method: stableMap17Get \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught SyntaxError: unexpected data at the end" + ] } diff --git a/examples/stable/test/end_to_end/candid_rpc/timers/cuzz.json b/examples/stable/test/end_to_end/candid_rpc/timers/cuzz.json index 89b6766b13..5b0a73acf5 100644 --- a/examples/stable/test/end_to_end/candid_rpc/timers/cuzz.json +++ b/examples/stable/test/end_to_end/candid_rpc/timers/cuzz.json @@ -1,6 +1,10 @@ { - "expectedErrors": ["field repeat -> Invalid int8 argument"], - "nat64": { - "max": 1000000000 + "expectedErrors": [ + "Method: statusReport \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught Error: Failed to encode Candid arguments: Error: Invalid record" + ], + "size": { + "nat64": { + "max": "1000000000" + } } } diff --git a/examples/stable/test/property/ic_api/arg_data_raw/cuzz.json b/examples/stable/test/property/ic_api/arg_data_raw/cuzz.json index 51220712ab..29351f95d3 100644 --- a/examples/stable/test/property/ic_api/arg_data_raw/cuzz.json +++ b/examples/stable/test/property/ic_api/arg_data_raw/cuzz.json @@ -1,3 +1,9 @@ { - "expectedErrors": ["Uncaught: Candid parser error"] + "expectedErrors": [ + "Method: candidEncode \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unrecognized token", + "Method: candidEncode \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unrecognized EOF found at", + "Method: candidEncode \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unknown token", + "Method: candidEncode \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unclosed string at", + "Method: candidEncode \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unknown escape character" + ] } diff --git a/examples/stable/test/property/ic_api/candid/cuzz.json b/examples/stable/test/property/ic_api/candid/cuzz.json index c13c97c20a..15c0d3c02a 100644 --- a/examples/stable/test/property/ic_api/candid/cuzz.json +++ b/examples/stable/test/property/ic_api/candid/cuzz.json @@ -1,3 +1,18 @@ { - "expectedErrors": ["Cannot parse header", "Candid parser error"] + "expectedErrors": [ + "Method: candidEncodeQuery \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unrecognized token", + "Method: candidEncodeQuery \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unrecognized EOF found at", + "Method: candidEncodeQuery \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unknown token", + "Method: candidEncodeQuery \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unclosed string at", + "Method: candidEncodeQuery \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unknown escape character", + "Method: candidEncodeQuery \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unclosed comment at", + "Method: assertCandidEncodeTypes \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unrecognized token", + "Method: assertCandidEncodeTypes \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unrecognized EOF found at", + "Method: assertCandidEncodeTypes \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unknown token", + "Method: assertCandidEncodeTypes \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unclosed string at", + "Method: assertCandidEncodeTypes \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unknown escape character", + "Method: assertCandidEncodeTypes \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Candid parser error: Unclosed comment at", + "Method: candidDecodeQuery \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Cannot parse header", + "Method: assertCandidDecodeTypes \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Uncaught: Cannot parse header" + ] } diff --git a/examples/stable/test/property/ic_api/certified_data/cuzz.json b/examples/stable/test/property/ic_api/certified_data/cuzz.json index e80c7dfdb5..1457bbb3a4 100644 --- a/examples/stable/test/property/ic_api/certified_data/cuzz.json +++ b/examples/stable/test/property/ic_api/certified_data/cuzz.json @@ -1,6 +1,7 @@ { "expectedErrors": [ - "Canister violated contract: \\\"ic0_certified_data_set\\\" cannot be executed in non replicated query mode", - "Canister violated contract: ic0_certified_data_set failed because the passed data must be no larger than 32 bytes" + "Method: setDataCertificateInQuery \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Canister violated contract: \\\\\"ic0_certified_data_set\\\\\" cannot be executed in non replicated query mode", + "Method: setData \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Canister violated contract: ic0_certified_data_set failed because the passed data must be no larger than 32 bytes", + "Method: assertSetCertifiedDataTypes \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Canister violated contract: ic0_certified_data_set failed because the passed data must be no larger than 32 bytes" ] } diff --git a/examples/stable/test/property/ic_api/cycles/cuzz.json b/examples/stable/test/property/ic_api/cycles/cuzz.json index 4e8514f7e9..8aa494060e 100644 --- a/examples/stable/test/property/ic_api/cycles/cuzz.json +++ b/examples/stable/test/property/ic_api/cycles/cuzz.json @@ -1,6 +1,7 @@ { "expectedErrors": [ - "Uncaught Error: numChunks cannot be 0", - "Canister trapped: heap out of bounds" + "Method: receiveCyclesByChunk \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: numChunks cannot be 0", + "Method: sendCyclesByChunk \\(update\\)[\\s\\S]*\"Request ID\":[\\s\\S]*\"Error code\":[\\s\\S]*\"Reject code\":[\\s\\S]*\"Reject message\":.*Uncaught Error: numChunks cannot be 0", + "xCanister trapped: heap out of bounds" ] } diff --git a/examples/stable/test/property/ic_api/performance_counter/cuzz.json b/examples/stable/test/property/ic_api/performance_counter/cuzz.json index ae68ffab38..1400002a00 100644 --- a/examples/stable/test/property/ic_api/performance_counter/cuzz.json +++ b/examples/stable/test/property/ic_api/performance_counter/cuzz.json @@ -1,6 +1,6 @@ { "expectedErrors": [ - "Error getting performance counter type", - "Uncaught Error: Rejection code 2, Couldn't send message" + "Method: assertTypes \\(query\\)[\\s\\S]*\"Status\":[\\s\\S]*\"Code\":[\\s\\S]*\"Message\":.*Canister violated contract: Error getting performance counter type", + "xUncaught Error: Rejection code 2, Couldn't send message" ] } diff --git a/package-lock.json b/package-lock.json index d1d5b36893..1dfe6f8275 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "class-transformer": "^0.5.1", "class-validator": "^0.14.1", "crypto-browserify": "^3.12.0", - "cuzz": "github:demergent-labs/cuzz#70f95363c64674ec2cf19b9eccfc1a773c3bf28f", + "cuzz": "^0.0.3", "deep-is": "^0.1.4", "esbuild": "^0.24.0", "esbuild-plugin-tsc": "^0.4.0", @@ -3519,9 +3519,9 @@ } }, "node_modules/cuzz": { - "version": "0.0.0", - "resolved": "git+ssh://git@github.com/demergent-labs/cuzz.git#70f95363c64674ec2cf19b9eccfc1a773c3bf28f", - "integrity": "sha512-yR8msDiAAECqDh2mcPH8DGmb64YajHzq2DQvnFalgyYlJTckAuoYa1V1QbqgxpsExQTqDMNMRU0ewCibp8WGAg==", + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/cuzz/-/cuzz-0.0.3.tgz", + "integrity": "sha512-5lJhrRv6KxDz71wwCUs3uBUgydB2RbkFTd8SLD6d9yPXs/oc7sk/dpX0tAq4odLQueeyZzLgzCTpxKFWH/dUZg==", "dependencies": { "@dfinity/agent": "^2.1.3", "@dfinity/candid": "^2.1.3", @@ -3530,7 +3530,7 @@ "tsx": "^4.19.2" }, "bin": { - "cuzz": "index.ts" + "cuzz": "src/index.ts" } }, "node_modules/cuzz/node_modules/commander": { diff --git a/package.json b/package.json index a9ad683206..a55aa6b104 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "class-transformer": "^0.5.1", "class-validator": "^0.14.1", "crypto-browserify": "^3.12.0", - "cuzz": "github:demergent-labs/cuzz#70f95363c64674ec2cf19b9eccfc1a773c3bf28f", + "cuzz": "^0.0.3", "deep-is": "^0.1.4", "esbuild": "^0.24.0", "esbuild-plugin-tsc": "^0.4.0", @@ -76,9 +76,9 @@ "husky": "9.1.7", "jest": "^29.7.0", "lint-staged": "15.2.11", - "semver": "^7.6.3", "prettier": "^3.4.2", "puppeteer": "^23.11.1", + "semver": "^7.6.3", "ts-jest": "^29.1.4", "typescript-eslint": "^8.18.0" }, diff --git a/src/build/experimental/commands/compile/wasm_binary/compile.ts b/src/build/experimental/commands/compile/wasm_binary/compile.ts index 8daf027410..8eb02f8171 100644 --- a/src/build/experimental/commands/compile/wasm_binary/compile.ts +++ b/src/build/experimental/commands/compile/wasm_binary/compile.ts @@ -1,6 +1,7 @@ import { IOType } from 'child_process'; import { execSyncPretty } from '../../../../stable/utils/exec_sync_pretty'; +import { AZLE_CARGO_TARGET_DIR } from '../../../../stable/utils/global_paths'; export function compile( manifestPath: string, @@ -8,12 +9,12 @@ export function compile( ioType: IOType ): void { execSyncPretty( - `CARGO_TARGET_DIR=target cargo build --target wasm32-wasi --manifest-path ${manifestPath} --release`, + `CARGO_TARGET_DIR=${AZLE_CARGO_TARGET_DIR} cargo build --target wasm32-wasi --manifest-path ${manifestPath} --release`, ioType ); execSyncPretty( - `wasi2ic target/wasm32-wasi/release/experimental_canister_template.wasm ${wasmDest}`, + `wasi2ic ${AZLE_CARGO_TARGET_DIR}/wasm32-wasi/release/experimental_canister_template.wasm ${wasmDest}`, ioType ); } diff --git a/src/build/stable/commands/compile/wasm_binary/compile.ts b/src/build/stable/commands/compile/wasm_binary/compile.ts index 3599832d52..2a80a2af0a 100644 --- a/src/build/stable/commands/compile/wasm_binary/compile.ts +++ b/src/build/stable/commands/compile/wasm_binary/compile.ts @@ -1,6 +1,7 @@ import { IOType } from 'child_process'; import { execSyncPretty } from '../../../utils/exec_sync_pretty'; +import { AZLE_CARGO_TARGET_DIR } from '../../../utils/global_paths'; export function compile( manifestPath: string, @@ -8,12 +9,12 @@ export function compile( ioType: IOType ): void { execSyncPretty( - `CARGO_TARGET_DIR=target cargo build --target wasm32-wasi --manifest-path ${manifestPath} --release`, + `CARGO_TARGET_DIR=${AZLE_CARGO_TARGET_DIR} cargo build --target wasm32-wasi --manifest-path ${manifestPath} --release`, ioType ); execSyncPretty( - `wasi2ic target/wasm32-wasi/release/stable_canister_template.wasm ${wasmDest}`, + `wasi2ic ${AZLE_CARGO_TARGET_DIR}/wasm32-wasi/release/stable_canister_template.wasm ${wasmDest}`, ioType ); } diff --git a/src/build/stable/utils/global_paths.ts b/src/build/stable/utils/global_paths.ts index 872b762080..2516b8b50d 100644 --- a/src/build/stable/utils/global_paths.ts +++ b/src/build/stable/utils/global_paths.ts @@ -9,6 +9,8 @@ export const AZLE_PACKAGE_PATH = join( '..' ); +export const AZLE_CARGO_TARGET_DIR = join(AZLE_PACKAGE_PATH, 'target'); + export const STABLE_STATIC_CANISTER_TEMPLATE_PATH = join( AZLE_PACKAGE_PATH, 'canister_templates', diff --git a/test/fuzz.ts b/test/fuzz.ts index 0aba65f9bf..afe645c263 100644 --- a/test/fuzz.ts +++ b/test/fuzz.ts @@ -1,6 +1,6 @@ import { spawn } from 'child_process'; import { CuzzConfig } from 'cuzz'; -import { readFile } from 'fs-extra'; +import { readFile } from 'fs/promises'; import { join } from 'path'; import { DfxJson } from '../src/build/stable/utils/types'; @@ -57,13 +57,17 @@ function fuzzTestCanister(canisterName: string, callDelay: string): void { canisterName, '--skip-deploy', '--call-delay', - callDelay + callDelay, + '--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'