Skip to content

Conversation

@shuLhan
Copy link
Contributor

@shuLhan shuLhan commented May 9, 2024

In environment where CGO_ENABLED=0, some tests that require CGO will fail, in example

<REDACTED>
=== RUN   TestCgoOk
level=info msg="[test] ran [/tmp/TestCgoOk3811517097/001/golangci-lint
run --internal-cmd-test --allow-parallel-runners --no-config
--timeout=3m --enable-all -D nosnakecase --go=1.22 testdata/cgo] in
1.032596905s"
    run_test.go:111:
                Error Trace: /home/ms/go/src/git.sr.ht/~shulhan/golangci-lint/test/testshared/runner.go:282
                                                        /home/ms/go/src/git.sr.ht/~shulhan/golangci-lint/test/run_test.go:111
                Error:          Not equal:
                                expected: ""
                                actual  : "level=error msg=\"[linters_context] typechecking error: build constraints exclude all Go files in /home/ms/go/src/git.sr.ht/~shulhan/golangci-lint/test/testdata/cgo\"\n"
<REDACTED>

In environment where CGO_ENABLED=0, some tests that require CGO will
fail, in example

----
<REDACTED>
=== RUN   TestCgoOk
level=info msg="[test] ran [/tmp/TestCgoOk3811517097/001/golangci-lint
run --internal-cmd-test --allow-parallel-runners --no-config
--timeout=3m --enable-all -D nosnakecase --go=1.22 testdata/cgo] in
1.032596905s"
    run_test.go:111:
                Error Trace: /home/ms/go/src/git.sr.ht/~shulhan/golangci-lint/test/testshared/runner.go:282
                                                        /home/ms/go/src/git.sr.ht/~shulhan/golangci-lint/test/run_test.go:111
                Error:          Not equal:
                                expected: ""
                                actual  : "level=error msg=\"[linters_context] typechecking error: build constraints exclude all Go files in /home/ms/go/src/git.sr.ht/~shulhan/golangci-lint/test/testdata/cgo\"\n"
<REDACTED>
----
@ldez ldez self-requested a review May 9, 2024 12:02
@ldez ldez added the area: tests Continuous integration, tests and other checks label May 9, 2024
@ldez ldez changed the title make: set CGO_ENABLED=1 when running "test" task dev: set CGO_ENABLED=1 when running "test" task May 9, 2024
@ldez ldez added the declined label May 9, 2024
@ldez

This comment was marked as outdated.

@ldez ldez closed this May 9, 2024
@shuLhan

This comment was marked as outdated.

@ldez ldez removed the declined label May 9, 2024
@ldez ldez reopened this May 9, 2024
@ldez ldez added this to the next milestone May 9, 2024
@ldez ldez merged commit c90d06b into golangci:master May 9, 2024
@ldez ldez modified the milestones: next, v1.58 May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Continuous integration, tests and other checks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants