-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: use groups of tests in gha (#15018)
* [no ci] use json for grouping packages for testing * [no ci] able to get packages in group * [no ci] able to run groups of tests * [no ci] more * [no ci] try disable circle unit tests * ci: use actions/checkout@v3 * ci: rename to quick * ci: need make dev in mods cache step * ci: make compile step depend on checks step * ci: bump consul and vault versions * ci: need make dev for group tests * ci: update ci unit testing docs * docs: spell plumbing correctly Co-authored-by: Tim Gross <[email protected]> Co-authored-by: Tim Gross <[email protected]>
- Loading branch information
Showing
11 changed files
with
184 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,3 +130,6 @@ e2e/remotetasks/input/ecs.vars | |
|
||
# local terraform overrides | ||
*.auto.tfvars | ||
|
||
# Tools files | ||
tools/missing/missing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# CI (unit testing) | ||
|
||
This README describes how the Core CI Tests Github Actions works, which provides | ||
Nomad with continuous integration unit testing. | ||
|
||
## Steps | ||
|
||
1. When a branch is pushed, GHA triggers `.github/workflows/test-core.yaml`. | ||
|
||
2. The first job is `mods` which creates a pre-cache of Go modules. | ||
- Only useful for the followup jobs on Linux runners | ||
- Is keyed on `hash(go.sum)`, so a cache is re-used until deps are modified. | ||
|
||
3. The `checks`, `test-api`, `test-*` jobs are started. | ||
- The checks job runs `make check` | ||
- The test job runs groups of tests, see below | ||
|
||
3i. The check step also runs `make missing` | ||
- Invokes `tools/missing` to scan `ci/test-cores.json` && nomad source. | ||
- Fails the build if any packages in Nomad are not covered. | ||
|
||
4a. The `test-*` jobs are run. | ||
- Configured as a matrix of "groups"; each group is a set of packages. | ||
- The GHA invokes `test-nomad` with $GOTEST_GROUP for each group. | ||
- The makefile uses `tools/missing` to translate the group into packages | ||
- Package groups are configured in `ci/test-core.json` | ||
|
||
4b. The `test-api` job is run. | ||
- Because `api` is a submodule, invokation of test command is special. | ||
- The GHA invokes `test-nomad-module` with the name of the submodule. | ||
|
||
5. The `compile` jobs are run | ||
- Waits on checks to complete first | ||
- Runs on each of `linux`, `macos`, `windows` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"nomad": ["nomad"], | ||
"client": [ | ||
"client", | ||
"client/allocrunner/..." | ||
], | ||
"command": ["command"], | ||
"drivers": ["drivers/..."], | ||
"quick": [ | ||
"acl/...", | ||
"client/allocdir/...", | ||
"client/allochealth/...", | ||
"client/allocwatcher/...", | ||
"client/config/...", | ||
"client/consul/...", | ||
"client/devicemanager/...", | ||
"client/dynamicplugins/...", | ||
"client/fingerprint/...", | ||
"client/interfaces/...", | ||
"client/lib/...", | ||
"client/logmon/...", | ||
"client/pluginmanager/...", | ||
"client/servers/...", | ||
"client/serviceregistration/...", | ||
"client/state/...", | ||
"client/stats/...", | ||
"client/structs/...", | ||
"client/taskenv/...", | ||
"command/agent/...", | ||
"command/raft_tools/...", | ||
"helper/...", | ||
"internal/...", | ||
"jobspec/...", | ||
"lib/...", | ||
"nomad/deploymentwatcher/...", | ||
"nomad/drainer/...", | ||
"nomad/state/...", | ||
"nomad/stream/...", | ||
"nomad/structs/...", | ||
"nomad/volumewatcher/...", | ||
"plugins/...", | ||
"scheduler/...", | ||
"testutil/..." | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.