Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/go-basic-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions tests/test_go_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)/*")
Expand All @@ -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"])

Expand Down
Loading