diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index e618300e6..464ceda33 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -12,26 +12,23 @@ on: jobs: unit-tests: - # changing the following value will significantly affect github's cost. Be careful and consult with the team before changing it. - runs-on: ubuntu-latest-32 + runs-on: ubuntu-latest-16 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup backend uses: ./.github/actions/setup-backend - - name: Test with pytest - timeout-minutes: 6 - run: | - uv run pytest --cov \ - -o junit_suite_name="${{github.job}}" \ - -n auto \ - -vv \ - --cov \ - --cov-append \ - --timeout 50 \ - --cov-report=xml \ - tests/unit + - name: Run ATS and Tests + uses: ./.github/actions/run_ats + timeout-minutes: 15 + with: + default_tests: "tests/unit" + codecov_static_token: ${{ secrets.CODECOV_STATIC_TOKEN }} + codecov_token: ${{ secrets.CODECOV_TOKEN }} + collect_args: "--timeout 15" + codecov_flags: unit-tests + codemod-tests: # TODO: re-enable when this check is a develop required check if: false @@ -68,34 +65,6 @@ jobs: env: GITHUB_WORKSPACE: $GITHUB_WORKSPACE - # test_verified_codemods: - # # changing the following value will significantly affect github's cost. Be careful and consult with the team before changing it. - # if: false - # runs-on: ubuntu-latest-32 - # environment: testing - # concurrency: - # group: ${{ github.workflow }}-${{github.ref}}-${{github.event_name == 'push'&& github.sha}} - # cancel-in-progress: true - # name: "Verified Codemod tests: Sync Graph=false" - # steps: - # - uses: actions/checkout@v4 - # - name: Setup backend - # uses: ./.github/actions/setup-backend - # - name: Run ATS and Tests - # uses: ./.github/actions/run_ats - # with: - # default_tests: "tests/integration/codemod/test_verified_codemods.py" - # codecov_static_token: ${{ secrets.CODECOV_STATIC_TOKEN }} - # codecov_token: ${{ secrets.CODECOV_TOKEN }} - # collect_args: "--cli-api-key ${{ secrets.PROD_CLI_API_KEY }} --token ${{ secrets.CODEGEN_BOT_GHE_TOKEN }}" - # ats_collect_args: "--cli-api-key=${{ secrets.PROD_CLI_API_KEY }},--token=${{ secrets.CODEGEN_BOT_GHE_TOKEN }}," - # base_sha: ${{github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before}} - # job_name: ${{ github.job }} - # codecov_flags: smart-tests-verified-codemod-tests - # env: - # CODEGEN_BOT_GHE_TOKEN: ${{ secrets.CODEGEN_BOT_GHE_TOKEN }} - # GITHUB_WORKSPACE: $GITHUB_WORKSPACE - parse-tests: runs-on: ubuntu-latest-32 if: contains(github.event.pull_request.labels.*.name, 'parse-tests') || github.event_name == 'push' || github.event_name == 'workflow_dispatch' @@ -161,54 +130,7 @@ jobs: } ] } - # test_codemod_diffs: - # # changing the following value will significantly affect github's cost. Be careful and consult with the team before changing it. - # runs-on: ubuntu-latest-16 - # - # steps: - # - uses: actions/checkout@v4 - # - name: Setup backend - # uses: ./.github/actions/setup-backend - # - name: Cache oss-repos - # uses: ./.github/actions/setup-oss-repos - # with: - # CODEGEN_BOT_GHE_TOKEN: ${{ secrets.CODEGEN_BOT_GHE_TOKEN }} - # - name: Test with pytest - # timeout-minutes: 10 - # run: | - # ENV=local \ - # uv run pytest \ - # -n auto \ - # -vv \ - # --token $CODEGEN_BOT_GHE_TOKEN \ - # tests/codemod/test_diffs.py - # env: - # CODEGEN_BOT_GHE_TOKEN: ${{ secrets.CODEGEN_BOT_GHE_TOKEN }} - # GITHUB_WORKSPACE: $GITHUB_WORKSPACE - # - # - name: Publish Test Report (Verify diffs) - # uses: mikepenz/action-junit-report@v4 - # if: (success() || failure()) # always publish report even if the tests fail - # continue-on-error: true - # with: - # report_paths: "**/build/test-results/test/TEST.xml" - # detailed_summary: true - # annotate_only: true - # # Codecov is a required check but won't pass without a coverage report - # # Wwhen there are no changes in the backend (ex: frontend only change) we do an empty upload to force the check to pass - # - name: Upload empty coverage report to Codecov - # if: env.skip == '0' - # continue-on-error: true - # env: - # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - # run: | - # cd codegen-backend - # pip install codecov-cli - # codecovcli create-commit -C ${{ github.event.pull_request.head.sha }} - # codecovcli create-report -C ${{ github.event.pull_request.head.sha }} - # codecovcli do-upload --disable-search --file empty_coverage.xml -C ${{ github.event.pull_request.head.sha }} - # codecovcli empty-upload --force -C ${{ github.event.pull_request.head.sha }} integration-tests: runs-on: ubuntu-latest-16 steps: