Skip to content

ci: use CGO for tests to enable race detector#10261

Merged
milas merged 1 commit intodocker:v2from
milas:ci-win-e2e
Feb 9, 2023
Merged

ci: use CGO for tests to enable race detector#10261
milas merged 1 commit intodocker:v2from
milas:ci-win-e2e

Conversation

@milas
Copy link
Contributor

@milas milas commented Feb 9, 2023

What I did
Explicitly enable CGO for e2e tests to avoid errors:

go: -race requires cgo; enable cgo by setting CGO_ENABLED=1

We're explicitly using CGO on macOS now for FSEvents support and purposefully NOT using CGO on other platforms since we don't need it.

The race detector (-race) requires it, however, so for the e2e make task, it should alway be on.

Related issue
See sample failed run from v2 on Windows: https://github.com/docker/compose/actions/runs/4136372230/jobs/7150139071

(not mandatory) A picture of a cute animal, if possible in relation to what you did
fisher cat

@milas milas requested a review from a team February 9, 2023 18:29
@milas milas self-assigned this Feb 9, 2023
@milas milas requested review from StefanScherer, glours, laurazard, ndeloof, nicksieger and ulyssessouza and removed request for a team February 9, 2023 18:29
```
go: -race requires cgo; enable cgo by setting CGO_ENABLED=1
```

We're explicitly using CGO on macOS now for FSEvents support and
purposefully NOT using CGO on other platforms since we don't need
it.

The race detector (`-race`) requires it, however, so for the e2e
make task, it should alway be on.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
@codecov
Copy link

codecov bot commented Feb 9, 2023

Codecov Report

Base: 73.89% // Head: 73.89% // No change to project coverage 👍

Coverage data is based on head (15f7104) compared to base (e6e2f78).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##               v2   #10261   +/-   ##
=======================================
  Coverage   73.89%   73.89%           
=======================================
  Files           2        2           
  Lines         272      272           
=======================================
  Hits          201      201           
  Misses         60       60           
  Partials       11       11           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@milas milas merged commit d93da18 into docker:v2 Feb 9, 2023
@milas milas deleted the ci-win-e2e branch February 9, 2023 20:53
milas added a commit to milas/compose that referenced this pull request Feb 9, 2023
I misunderstood the cause of the symptom in docker#10261 - thought that
we'd explicitly turned off CGO for Windows with some of the build
changes recently, but we don't even have `gcc` on the CI node, so
it's actually just `-race` entirely that's the trouble.

For right now, going the easy route and disabling it. We can look
at getting a C toolchain on the Windows machine later.
milas added a commit to milas/compose that referenced this pull request Feb 9, 2023
I misunderstood the cause of the symptom in docker#10261 - thought that
we'd explicitly turned off CGO for Windows with some of the build
changes recently, but we don't even have `gcc` on the CI node, so
it's actually just `-race` entirely that's the trouble.

For right now, going the easy route and disabling it. We can look
at getting a C toolchain on the Windows machine later.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
ndeloof pushed a commit that referenced this pull request Feb 10, 2023
I misunderstood the cause of the symptom in #10261 - thought that
we'd explicitly turned off CGO for Windows with some of the build
changes recently, but we don't even have `gcc` on the CI node, so
it's actually just `-race` entirely that's the trouble.

For right now, going the easy route and disabling it. We can look
at getting a C toolchain on the Windows machine later.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants