diff --git a/.github/workflows/go-basic-tests.yaml b/.github/workflows/go-basic-tests.yaml index f23080d..a159cf1 100644 --- a/.github/workflows/go-basic-tests.yaml +++ b/.github/workflows/go-basic-tests.yaml @@ -84,7 +84,6 @@ jobs: runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} - CGO_ENABLED: ${{ inputs.CGO_ENABLED }} # strategy: # matrix: # os: ${{ fromJSON(needs.Setup-Environment.outputs.matrix) }} @@ -127,7 +126,7 @@ jobs: fi if [[ ${TEST_COVERAGE:-false} == true ]]; then args+=(-covermode=count -coverprofile=coverage.out) - elif [[ $CGO_ENABLED == 1 ]]; then + else args+=(-race) fi @@ -227,7 +226,6 @@ jobs: path: ${{ steps.unit-test.outputs.results_dir }} retention-days: 7 if-no-files-found: error - - name: Initialize CodeQL continue-on-error: true uses: github/codeql-action/init@v3 diff --git a/tests/test_go_ci.py b/tests/test_go_ci.py index c34347c..6bd2905 100644 --- a/tests/test_go_ci.py +++ b/tests/test_go_ci.py @@ -48,7 +48,7 @@ def setUp(self): self.env = dict(os.environ, RUNNER_TEMP=str(self.root), GITHUB_JOB="test", GITHUB_OUTPUT=str(self.root / "outputs"), GITHUB_STEP_SUMMARY=str(self.root / "summary"), - CGO_ENABLED="0", UNIT_TESTS_PATH="./...", + UNIT_TESTS_PATH="./...", TEST_PARALLELISM="0", TEST_PACKAGE_PARALLELISM="0", TEST_COVERAGE="false", GOPROXY="off", GOSUMDB="off", GOTOOLCHAIN="local", GOFLAGS="", GOWORK="off") @@ -128,11 +128,11 @@ def fake_go(self, packages="example.com/ci\nexample.com/ci/e2e\n"): def test_flags_and_package_filtering(self): self.fake_go() - for coverage, cgo, parallel, package_parallel in ( - ("false", "1", "2", "3"), ("true", "1", "0", "0"), - ("false", "0", "0", "0")): - with self.subTest(coverage=coverage, cgo=cgo): - self.env.update(TEST_COVERAGE=coverage, CGO_ENABLED=cgo, + for coverage, parallel, package_parallel in ( + ("false", "2", "3"), ("true", "0", "0"), + ("false", "0", "0")): + with self.subTest(coverage=coverage, parallel=parallel): + self.env.update(TEST_COVERAGE=coverage, TEST_PARALLELISM=parallel, TEST_PACKAGE_PARALLELISM=package_parallel, UNIT_TESTS_PATH="./pkg/...\n./internal/... ./literal-$(touch-INJECTED)/*") @@ -146,7 +146,7 @@ def test_flags_and_package_filtering(self): expected += ["-parallel", parallel, "-p", package_parallel] if coverage == "true": expected += ["-covermode=count", "-coverprofile=coverage.out"] - elif cgo == "1": + else: expected += ["-race"] self.assertEqual(calls[-1], expected + ["example.com/ci"])