Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: combine go tests such that any test failure will report a failure for the entire task #3156

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

QxBytes
Copy link
Contributor

@QxBytes QxBytes commented Nov 18, 2024

Reason for Change:

When the go tests are split up, only the status of the last command run determines the status of the entire step/task. Any previous steps, even if they exited with a failure, won't cause the task to visibly fail. By combining all tests together in one command, if this single command fails (due to any of the tests failing), the step/task will visibly fail on the pipeline.

Issue Fixed:

See above

Requirements:

Notes:
Will fail in the pipeline until npm windows tests are fixed (this is expected, as previously those tests were silently failing).
When those npm changes are merged in, I will rebase this PR against master to resolve the errors.
Will be backported to release/v1.5

@QxBytes QxBytes self-assigned this Nov 18, 2024
@QxBytes QxBytes added ci Infra or tooling. release/latest Change affects latest release train needs-backport Change needs to be backported to previous release trains release/1.5 Change affects v1.5 release train labels Nov 18, 2024
cd ../platform/
go test ./...
cd azure-container-networking/
go test ./npm/... ./cni/... ./platform/...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add -race and -timeout as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I've tried adding -race but it seems to require CGO_ENABLED=1 (enabled), but on this particular node agent running the script (which is windows), it gives an error saying gcc is not found, making me believe this isn't possible at the moment, unless you have any other ideas of how to run -race? https://msazure.visualstudio.com/One/_build/results?buildId=108557696&view=logs&j=1e95c5bf-f785-5c1d-a4c1-33b038e882fb&t=4058cacc-5989-52ae-5341-5beff346fc28

Copy link
Member

@timraymond timraymond Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good to know it requires CGo. It is possible, and windows/amd64 is a supported GOOS/GOARCH for the race detector, however:

On Windows, the race detector runtime is sensitive to the version of the C compiler installed; as of Go 1.21, building a program with -race requires a C compiler that incorporates version 8 or later of the mingw-w64 runtime libraries

We can skip this for now, but CGo enablement will likely become required in the near future. The upside will be that we will be able to run the race detector once we're forced to turn CGo on.

I would still set a -timeout though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so if I'm understanding this correctly, the windows node at the moment doesn't have c compiler, and so we cannot have cgo enabled. In the future, we will need to somehow update the node agent to include gcc? In the meantime a -timeout has been added.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No C compiler is required on the node for CGO_ENABLED=1. CGo means that some dependencies are dynamically linked (e.g. DNS resolution). As long as the DLLs for performing those functions are present on the system, it will work.

@QxBytes
Copy link
Contributor Author

QxBytes commented Nov 19, 2024

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@QxBytes QxBytes force-pushed the alew/add-set-ex-ut branch 3 times, most recently from a16740d to ac91b06 Compare November 19, 2024 19:15
Copy link

github-actions bot commented Dec 6, 2024

This pull request is stale because it has been open for 2 weeks with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the stale Stale due to inactivity. label Dec 6, 2024
@QxBytes QxBytes added exempt-stale Keep this fresh and removed stale Stale due to inactivity. labels Dec 10, 2024
Copy link

This pull request is stale because it has been open for 2 weeks with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the stale Stale due to inactivity. label Dec 28, 2024
Copy link

github-actions bot commented Jan 5, 2025

Pull request closed due to inactivity.

@github-actions github-actions bot closed this Jan 5, 2025
@github-actions github-actions bot deleted the alew/add-set-ex-ut branch January 5, 2025 00:01
@QxBytes QxBytes restored the alew/add-set-ex-ut branch January 6, 2025 17:41
@QxBytes QxBytes reopened this Jan 6, 2025
@QxBytes QxBytes removed stale Stale due to inactivity. exempt-stale Keep this fresh labels Jan 6, 2025
@QxBytes QxBytes force-pushed the alew/add-set-ex-ut branch from 6b4e7df to 35d4e37 Compare January 15, 2025 19:18
@QxBytes
Copy link
Contributor Author

QxBytes commented Jan 15, 2025

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Infra or tooling. needs-backport Change needs to be backported to previous release trains release/latest Change affects latest release train release/1.5 Change affects v1.5 release train
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants