From de94d9469cf4d17c93cc4afa41b71f5b5a2e041a Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Fri, 24 Jan 2025 15:35:08 -0700 Subject: [PATCH] remove tests --- .github/workflows/run_test.yml | 166 -------------------------------- .github/workflows/test.yml | 168 --------------------------------- 2 files changed, 334 deletions(-) delete mode 100644 .github/workflows/run_test.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/run_test.yml b/.github/workflows/run_test.yml deleted file mode 100644 index 1ac49524da..0000000000 --- a/.github/workflows/run_test.yml +++ /dev/null @@ -1,166 +0,0 @@ -name: Run Test - -on: - workflow_call: - inputs: - directories: - required: true - type: string - exclude-dirs: - required: false - type: string - default: '' - link-azle: - required: true - type: boolean - run-experimental: - required: false - type: boolean - default: false - fuzz: - required: false - type: boolean - default: false - call-delay: - required: false - type: string - default: '.1' - time-limit: - required: false - type: string - default: '300' - -jobs: - get-test-infos: - name: Get test infos - runs-on: ubuntu-latest - outputs: - test-infos: ${{ steps.get-test-infos.outputs.test-infos }} - steps: - - uses: actions/checkout@v4 - - - id: get-test-infos - uses: ./.github/actions/get_test_infos - with: - directories: ${{ inputs.directories }} - exclude-dirs: ${{ inputs.exclude-dirs }} - - run-test: - name: '${{matrix.test.name}} | ${{matrix.test.displayPath}} | ${{matrix.azle_source}}' - needs: get-test-infos - runs-on: ${{ matrix.os }} - env: - ETHEREUM_URL: ${{ secrets.ETHEREUM_URL }} - AZLE_IDENTITY_STORAGE_MODE: 'plaintext' - AZLE_END_TO_END_TEST_LINK_AZLE: ${{ matrix.azle_source == 'repo' }} - AZLE_IS_MAIN_BRANCH_PUSH_FROM_FEATURE_MERGE: '' - AZLE_IS_MAIN_BRANCH_PUSH_FROM_RELEASE_MERGE: '' - AZLE_IS_RELEASE_BRANCH_PR: '' - AZLE_IS_FEATURE_BRANCH_PR: '' - AZLE_IS_FEATURE_BRANCH_DRAFT_PR: '' - - strategy: - fail-fast: false # We want to see which example tests succeed and which ones fail, we don't want one example test to cancel the rest - matrix: # spins up one job per combination of test and code source (repo or npm). - # os: [macos-latest, ubuntu-latest] - os: [ubuntu-latest] - azle_source: - - ${{ inputs.link-azle == true && 'repo' || 'npm' }} - test: ${{ fromJSON(needs.get-test-infos.outputs.test-infos) }} - steps: - - uses: actions/checkout@v4 - - - uses: ./.github/actions/determine_workflow_context - id: set-conditions - - - name: Set condition environment variables - run: | - echo "AZLE_IS_MAIN_BRANCH_PUSH_FROM_FEATURE_MERGE=${{ steps.set-conditions.outputs.is_main_branch_push_from_feature_merge }}" >> $GITHUB_ENV - echo "AZLE_IS_MAIN_BRANCH_PUSH_FROM_RELEASE_MERGE=${{ steps.set-conditions.outputs.is_main_branch_push_from_release_merge }}" >> $GITHUB_ENV - echo "AZLE_IS_RELEASE_BRANCH_PR=${{ steps.set-conditions.outputs.is_release_branch_pr }}" >> $GITHUB_ENV - echo "AZLE_IS_FEATURE_BRANCH_PR=${{ steps.set-conditions.outputs.is_feature_branch_pr }}" >> $GITHUB_ENV - echo "AZLE_IS_FEATURE_BRANCH_DRAFT_PR=${{ steps.set-conditions.outputs.is_feature_branch_draft_pr }}" >> $GITHUB_ENV - - - name: Print environment variables - run: | - echo "AZLE_IS_MAIN_BRANCH_PUSH_FROM_FEATURE_MERGE: $AZLE_IS_MAIN_BRANCH_PUSH_FROM_FEATURE_MERGE" - echo "AZLE_IS_MAIN_BRANCH_PUSH_FROM_RELEASE_MERGE: $AZLE_IS_MAIN_BRANCH_PUSH_FROM_RELEASE_MERGE" - echo "AZLE_IS_RELEASE_BRANCH_PR: $AZLE_IS_RELEASE_BRANCH_PR" - echo "AZLE_IS_FEATURE_BRANCH_PR: $AZLE_IS_FEATURE_BRANCH_PR" - echo "AZLE_IS_FEATURE_BRANCH_DRAFT_PR: $AZLE_IS_FEATURE_BRANCH_DRAFT_PR" - - - name: Report full path of test - # Just in case the path isn't obvious from the name, this will remove ambiguity - run: echo ${{matrix.test.path}} - - - uses: ./.github/actions/setup_node - - - uses: ./.github/actions/setup_dfx - - - name: Configure MacOS DNS (if needed) - if: matrix.os == 'macos-latest' - run: sudo networksetup -setdnsservers Ethernet 9.9.9.9 - - - run: npm install - - - run: npm link - if: matrix.azle_source == 'repo' - - - run: npm run lint - - - run: npm install - working-directory: ${{ matrix.test.path }} - - - run: npm link azle - if: matrix.azle_source == 'repo' - working-directory: ${{ matrix.test.path }} - - - name: Start dfx with artificial delay 0 - if: ${{ steps.set-conditions.outputs.is_feature_branch_pr == 'true' || steps.set-conditions.outputs.is_feature_branch_draft_pr == 'true' || steps.set-conditions.outputs.is_main_branch_push_from_feature_merge == 'true' }} - working-directory: ${{ matrix.test.path }} - run: dfx start --clean --background --host 127.0.0.1:8000 --artificial-delay 0 - - - name: Start dfx - if: ${{ steps.set-conditions.outputs.is_release_branch_pr == 'true' || steps.set-conditions.outputs.is_main_branch_push_from_release_merge == 'true' }} - working-directory: ${{ matrix.test.path }} - run: dfx start --clean --background --host 127.0.0.1:8000 - - - name: Calculate number of test runs - id: calc-runs - run: | - RUNS=1 - - if [[ "${{ steps.set-conditions.outputs.is_main_branch_push_from_feature_merge }}" == "true" ]]; then - RUNS=5 - fi - - if [[ "${{ steps.set-conditions.outputs.is_main_branch_push_from_release_merge }}" == "true" ]]; then - RUNS=100 - fi - - if [[ "${{ steps.set-conditions.outputs.is_release_branch_pr }}" == "true" ]]; then - RUNS=10 - fi - - if [[ "${{ steps.set-conditions.outputs.is_feature_branch_pr }}" == "true" ]]; then - RUNS=5 - fi - - if [[ "${{ steps.set-conditions.outputs.is_feature_branch_draft_pr }}" == "true" ]]; then - RUNS=1 - fi - - echo "Running tests $RUNS times" - echo "runs=$RUNS" >> $GITHUB_OUTPUT - - - name: Run tests - run: npm test - working-directory: ${{ matrix.test.path }} - shell: bash -l {0} - env: - AZLE_PROPTEST_NUM_RUNS: ${{ steps.calc-runs.outputs.runs }} - AZLE_PROPTEST_VERBOSE: true - 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/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 483b532e80..0000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,168 +0,0 @@ -# This GitHub Action flow works as follows: -# Each directory in the examples and tests directory represents an example project and is intended to have tests that ensure the canisters contained in that example function properly. -# These tests are currently written in TypeScript and are intended to be run in a Node.js environment. -# This GitHub Action takes care of deploying to npm and GitHub. - -name: Test - -on: - push: - branches: - - main - pull_request: - types: - - opened - - synchronize - - ready_for_review - - reopened - workflow_dispatch: - inputs: - fuzz: - description: 'Run fuzz tests' - required: true - type: boolean - default: false - exclude-slow-tests: - description: 'Exclude slow tests' - required: true - type: boolean - default: true - exclude-unstable-tests: - description: 'Exclude unstable tests' - required: true - type: boolean - default: true - exclude-release-only-tests: - description: 'Exclude release-only tests' - required: true - type: boolean - default: true - link-azle: - description: 'Link to development version of azle' - required: true - type: boolean - default: true - -jobs: - workflow-config: - name: Determine workflow config - runs-on: ubuntu-latest - outputs: - exclude-slow: ${{ steps.determine-workflow-config.outputs.exclude-slow }} - exclude-unstable: ${{ steps.determine-workflow-config.outputs.exclude-unstable }} - exclude-release-only: ${{ steps.determine-workflow-config.outputs.exclude-release-only }} - link-azle: ${{ steps.determine-workflow-config.outputs.link-azle }} - fuzz: ${{ steps.determine-workflow-config.outputs.fuzz }} - steps: - - uses: actions/checkout@v4 - - - id: determine-workflow-config - uses: ./.github/actions/determine_workflow_config - with: - is-workflow-dispatch: ${{ github.event_name == 'workflow_dispatch' }} - exclude-slow-dispatch-input-value: ${{ inputs.exclude-slow-tests }} - exclude-unstable-dispatch-input-value: ${{ inputs.exclude-unstable-tests }} - exclude-release-only-dispatch-input-value: ${{ inputs.exclude-release-only-tests }} - link-azle-dispatch-input-value: ${{ inputs.link-azle }} - fuzz-dispatch-input-value: ${{ inputs.fuzz }} - - get-exclude-dirs: - name: Get exclude directories - needs: workflow-config - 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: ${{ needs.workflow-config.outputs.exclude-slow }} - exclude-unstable: ${{ needs.workflow-config.outputs.exclude-unstable }} - exclude-release-only: ${{ needs.workflow-config.outputs.exclude-release-only }} - - run-tests: - name: ${{ matrix.test_group.name }} - needs: - - workflow-config - - get-exclude-dirs - strategy: - fail-fast: false - matrix: - test_group: - - { - name: 'Stable Demo', - directories: './examples/stable/demo' - } - - { - name: 'Stable Demo (Experimental)', - directories: './examples/stable/demo', - run-experimental: true - } - - { - name: 'Experimental Demo', - directories: './examples/experimental/demo' - } - - { - name: 'Stable E2E CRPC', - directories: './examples/stable/test/end_to_end/candid_rpc' - } - - { - name: 'Stable E2E CRPC (Experimental)', - directories: './examples/stable/test/end_to_end/candid_rpc', - run-experimental: true - } - - { - name: 'Experimental E2E CRPC', - directories: './examples/experimental/test/end_to_end/candid_rpc' - } - - { - name: 'Experimental E2E HTTP Server', - directories: './examples/experimental/test/end_to_end/http_server' - } - - { - name: 'Stable Property CRPC', - directories: './examples/stable/test/property/candid_rpc' - } - - { - name: 'Stable Property CRPC (Experimental)', - directories: './examples/stable/test/property/candid_rpc', - run-experimental: true - } - - { - name: 'Experimental Property CRPC', - directories: './examples/experimental/test/property/candid_rpc' - } - - { - name: 'Stable Property IC API', - directories: './examples/stable/test/property/ic_api' - } - - { - name: 'Stable Property IC API (Experimental)', - directories: './examples/stable/test/property/ic_api', - run-experimental: true - } - uses: ./.github/workflows/run_test.yml - with: - directories: ${{ matrix.test_group.directories }} - exclude-dirs: ${{ needs.get-exclude-dirs.outputs.exclude-dirs }} - link-azle: ${{ needs.workflow-config.outputs.link-azle == 'true' }} - run-experimental: ${{ matrix.test_group.run-experimental || false }} - fuzz: ${{ needs.workflow-config.outputs.fuzz == 'true' }} - - check-test-success: - name: Check Azle tests succeeded - needs: run-tests - runs-on: ubuntu-latest - if: success() - steps: - - run: exit 0 - - check-test-failure: - name: Check Azle tests didn't fail - needs: run-tests - runs-on: ubuntu-latest - if: failure() - steps: - - run: exit 1