diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 53e007d376..be1dc716c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,42 +4,12 @@ on: inputs: release-version: required: true - exclude-slow-tests: - description: 'Exclude slow tests' - required: true - type: boolean - default: false - exclude-unstable-tests: - description: 'Exclude unstable tests' - required: true - type: boolean - default: false - exclude-release-only-tests: - description: 'Exclude release tests' - required: true - type: boolean - default: false signing-key-id: required: true type: string default: C8B77BCBE16CD2B94B43F9C8757397B82D4ED7B0 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: ${{ github.event.inputs.exclude-slow-tests }} - exclude-unstable: ${{ github.event.inputs.exclude-unstable-tests }} - exclude-release-only: ${{ github.event.inputs.exclude-release-only-tests }} - create-branch-prefix: uses: ./.github/workflows/create_branch_prefix.yml with: @@ -52,7 +22,6 @@ jobs: prepare-release: name: Prepare Release needs: - - get-exclude-dirs - create-branch-prefix runs-on: ubuntu-latest env: @@ -111,9 +80,7 @@ jobs: - id: get-test-infos uses: ./.github/actions/get_test_infos with: - directories: | - ./examples - exclude-dirs: ${{ needs.get-exclude-dirs.outputs.exclude-dirs }} + directories: ./examples update-test-files-for-release-commit: needs: @@ -152,10 +119,10 @@ jobs: working-directory: ${{ matrix.test.path }} run: dfx start --clean --background --host 127.0.0.1:8000 --artificial-delay 0 - - name: Run npm test (continue on error) - working-directory: ${{ matrix.test.path }} - continue-on-error: true - run: npm test + # TODO we would like to also update the Candid files + # TODO what we should do is detect if there is a Candid file to generate + # TODO probably by looking at the dfx.json candid property of any azle canisters + # TODO if that is defined and if it does not go to .azle, we should probably generate it - name: Create branch name id: create-branch-name diff --git a/package-lock.json b/package-lock.json index 4a5e4c966e..e4768c3348 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,9 +41,7 @@ "wasmedge_quickjs": "github:demergent-labs/wasmedge-quickjs#3b3b0ee91248ccf9cd954ffafbac7e024648af92" }, "bin": { - "azle": "src/build/index.ts", - "cuzz": "node_modules/.bin/cuzz", - "tsc": "node_modules/.bin/tsc" + "azle": "src/build/index.ts" }, "devDependencies": { "@dfinity/identity": "^2.2.0", diff --git a/package.json b/package.json index d4d79f2c4f..a22929d5e7 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,7 @@ }, "type": "module", "bin": { - "azle": "./src/build/index.ts", - "cuzz": "./node_modules/.bin/cuzz", - "tsc": "./node_modules/.bin/tsc" + "azle": "./src/build/index.ts" }, "main": "./src/lib/stable/index.ts", "repository": { diff --git a/src/lib/experimental/globals.ts b/src/lib/experimental/globals.ts index e493d1ed96..2eb5ccf416 100644 --- a/src/lib/experimental/globals.ts +++ b/src/lib/experimental/globals.ts @@ -1,7 +1,7 @@ import './experimental'; import '../stable/globals'; // We import this to remove type errors having to do with the stable and experimental globals -// @ts-expect-error +// @ts-ignore import { TextDecoder, TextEncoder } from '@sinonjs/text-encoding'; import { Buffer } from 'buffer'; import * as process from 'process'; diff --git a/src/lib/stable/globals.ts b/src/lib/stable/globals.ts index 2b64ea7173..9145dfd5d1 100644 --- a/src/lib/stable/globals.ts +++ b/src/lib/stable/globals.ts @@ -1,4 +1,4 @@ -// @ts-expect-error +// @ts-ignore import { TextDecoder, TextEncoder } from '@sinonjs/text-encoding'; import { AzleIcExperimental } from '../experimental/ic/azle_ic_experimental'; diff --git a/src/lib/stable/ic_apis/reject_code.ts b/src/lib/stable/ic_apis/reject_code.ts index 2704abddde..179f13d990 100644 --- a/src/lib/stable/ic_apis/reject_code.ts +++ b/src/lib/stable/ic_apis/reject_code.ts @@ -1,5 +1,5 @@ // TODO this should be removed once https://github.com/demergent-labs/azle/issues/2271 is resolved -// @ts-expect-error +// @ts-ignore import { TextDecoder, TextEncoder } from '@sinonjs/text-encoding'; globalThis.TextDecoder = TextDecoder; globalThis.TextEncoder = TextEncoder; diff --git a/src/lib/stable/stable_structures/stable_json.ts b/src/lib/stable/stable_structures/stable_json.ts index 52974a09e2..defea82b21 100644 --- a/src/lib/stable/stable_structures/stable_json.ts +++ b/src/lib/stable/stable_structures/stable_json.ts @@ -1,5 +1,5 @@ import { Principal } from '@dfinity/principal'; -// @ts-expect-error +// @ts-ignore import { TextDecoder, TextEncoder } from '@sinonjs/text-encoding'; import { Serializable } from './stable_b_tree_map'; diff --git a/test/fuzz.ts b/test/fuzz.ts index afe645c263..5b87b4e0b5 100644 --- a/test/fuzz.ts +++ b/test/fuzz.ts @@ -53,6 +53,10 @@ function getCallDelay(cuzzConfig: CuzzConfig): string { function fuzzTestCanister(canisterName: string, callDelay: string): void { const baseCuzzArgs = [ + 'exec', + '--offline', + 'cuzz', + '--', '--canister-name', canisterName, '--skip-deploy', @@ -69,7 +73,7 @@ function fuzzTestCanister(canisterName: string, callDelay: string): void { : []) ]; - let cuzzProcess = spawn('node_modules/.bin/cuzz', cuzzArgs, { + let cuzzProcess = spawn('npm', cuzzArgs, { stdio: 'inherit' }); diff --git a/test/index.ts b/test/index.ts index 61bcb8ec09..6c9becce25 100644 --- a/test/index.ts +++ b/test/index.ts @@ -3,7 +3,6 @@ dns.setDefaultResultOrder('ipv4first'); import { describe, expect, test } from '@jest/globals'; import * as fc from 'fast-check'; -import { join } from 'path'; import { execSyncPretty } from '../src/build/stable/utils/exec_sync_pretty'; export { expect } from '@jest/globals'; @@ -17,7 +16,7 @@ export { getCanisterActor } from './get_canister_actor'; export function runTests( tests: Test, canisterNames: string | string[] | undefined = undefined, - cwd: string = process.cwd() + _cwd: string = process.cwd() ): void { const { shouldRunTests, @@ -35,12 +34,7 @@ export function runTests( it('checks types', () => { try { execSyncPretty( - `${join( - cwd, - 'node_modules', - '.bin', - 'tsc' - )} --noEmit --skipLibCheck --target es2020 --strict --moduleResolution node --allowJs`, + `npm exec --offline tsc -- --noEmit --skipLibCheck --target es2020 --strict --moduleResolution node --allowJs`, 'inherit' ); } catch {