ci(integration-cli): split test suites in a matrix#43682
ci(integration-cli): split test suites in a matrix#43682thaJeztah merged 5 commits intomoby:masterfrom
Conversation
|
@thaJeztah Not linked to these changes but looks like we have an issue with criu repo: https://ci-next.docker.com/public/blue/organizations/jenkins/moby/detail/PR-43682/1/pipeline#step-163-log-428 |
|
Hmm that repo has had issues a couple of times; maybe it's temporary, or they're fixing it? |
e2bca75 to
931f7fa
Compare
|
Forced push and looks worse now 😅: |
b9a74e8 to
0e1f09c
Compare
|
Very interesting! I like the idea, but I'm concerned about how repetitive it is (both in the code and in the configuration) -- for example, maintaining that long list of tiny functions and/or the list of all their names in the YAML seems really error prone. 😬 |
0e1f09c to
15c8cf9
Compare
Yes I'm also worried about missing some tests in the future using this pattern. I will check if go tooling allows to have some stats with available tests and suites in a pkg and split them accordingly in the matrix workflow like this. |
15c8cf9 to
c123a46
Compare
|
@thaJeztah Looks like we are not able to update or add new tests in integration-cli: https://ci-next.docker.com/public/blue/organizations/jenkins/moby/detail/PR-43682/7/pipeline#step-256-log-7 😅 |
c434e01 to
27a8762
Compare
|
To dynamically generate and distribute tests in a matrix I checked I have created a small library called gotestlist to list tests in the given Go packages. Here is what it looks like if I run $ go install github.com/crazy-max/gotestlist/cmd/gotestlist@latest
$ cd integration-cli/
$ gotestlist -d 4 ./... | jq[
"DockerAPISuite|DockerBenchmarkSuite|DockerCliAttachSuite",
"DockerCliBuildSuite|DockerCliCommitSuite|DockerCliCpSuite|DockerCliCreateSuite|DockerCliEventSuite",
"DockerCliExecSuite|DockerCliHealthSuite|DockerCliHistorySuite|DockerCliImagesSuite|DockerCliImportSuite|DockerCliInfoSuite|DockerCliInspectSuite|DockerCliLinksSuite|DockerCliLoginSuite|DockerCliLogsSuite|DockerCliNetmodeSuite|DockerCliNetworkSuite|DockerCliPluginLogDriverSuite|DockerCliPluginsSuite|DockerCliPortSuite|DockerCliProxySuite|DockerCliPruneSuite|DockerCliPsSuite|DockerCliPullSuite|DockerCliPushSuite|DockerCliRestartSuite|DockerCliRmiSuite",
"DockerCliRunSuite|DockerCliSaveLoadSuite|DockerCliSearchSuite|DockerCliSniSuite|DockerCliStartSuite|DockerCliStatsSuite|DockerCliTopSuite|DockerCliUpdateSuite|DockerCliVolumeSuite|DockerDaemonSuite|DockerExternalVolumeSuite|DockerHubPullSuite|DockerNetworkSuite|DockerPluginSuite|DockerRegistryAuthHtpasswdSuite|DockerRegistryAuthTokenSuite|DockerRegistrySuite|DockerSchema1RegistrySuite|DockerSwarmSuite"
]
I don't calculate cyclomatic complexities of tests functions in gotestlist to add some "weight" and distribute a bit better but I think it's ok in the meantime. |
3f40d08 to
07bce15
Compare
|
@corhere @neersighted @thaJeztah As discussed on Slack, I looked at how we could aggregate data from JSON reports of Go tests. Last commit adds a step for unit and integration tests that will render the output as markdown and create a GitHub summary in our workflow: There are also some useful stats about slow tests: Summary also includes failed tests with logs: |
Nice! Looks like teststat was a solid find -- everything here looks good to me as long as there's no interest in templating/generating the workflows to avoid duplication. |
|
Nice, |
f72ad34 to
06e949a
Compare
Yes exactly, here are the current stats for tests in {
"DockerAPISuite": 151,
"DockerBenchmarkSuite": 2,
"DockerCliAttachSuite": 7,
"DockerCliBuildSuite": 249,
"DockerCliCommitSuite": 9,
"DockerCliCpSuite": 43,
"DockerCliCreateSuite": 20,
"DockerCliEventSuite": 43,
"DockerCliExecSuite": 27,
"DockerCliHealthSuite": 2,
"DockerCliHistorySuite": 6,
"DockerCliImagesSuite": 17,
"DockerCliImportSuite": 7,
"DockerCliInfoSuite": 5,
"DockerCliInspectSuite": 29,
"DockerCliLinksSuite": 14,
"DockerCliLoginSuite": 1,
"DockerCliLogsSuite": 15,
"DockerCliNetmodeSuite": 6,
"DockerCliNetworkSuite": 14,
"DockerCliPluginLogDriverSuite": 2,
"DockerCliPluginsSuite": 6,
"DockerCliPortSuite": 5,
"DockerCliProxySuite": 1,
"DockerCliPruneSuite": 4,
"DockerCliPsSuite": 18,
"DockerCliPullSuite": 2,
"DockerCliPushSuite": 2,
"DockerCliRestartSuite": 13,
"DockerCliRmiSuite": 15,
"DockerCliRunSuite": 298,
"DockerCliSaveLoadSuite": 16,
"DockerCliSearchSuite": 5,
"DockerCliSniSuite": 1,
"DockerCliStartSuite": 9,
"DockerCliStatsSuite": 6,
"DockerCliTopSuite": 4,
"DockerCliUpdateSuite": 13,
"DockerCliVolumeSuite": 24,
"DockerDaemonSuite": 123,
"DockerExternalVolumeSuite": 18,
"DockerHubPullSuite": 6,
"DockerNetworkSuite": 48,
"DockerPluginSuite": 11,
"DockerRegistryAuthHtpasswdSuite": 8,
"DockerRegistryAuthTokenSuite": 5,
"DockerRegistrySuite": 38,
"DockerSchema1RegistrySuite": 11,
"DockerSwarmSuite": 121
}With [
"DockerAPISuite|DockerBenchmarkSuite|DockerCliAttachSuite",
"DockerCliBuildSuite|DockerCliCommitSuite|DockerCliCpSuite|DockerCliCreateSuite|DockerCliEventSuite",
"DockerCliExecSuite|DockerCliHealthSuite|DockerCliHistorySuite|DockerCliImagesSuite|DockerCliImportSuite|DockerCliInfoSuite|DockerCliInspectSuite|DockerCliLinksSuite|DockerCliLoginSuite|DockerCliLogsSuite|DockerCliNetmodeSuite|DockerCliNetworkSuite|DockerCliPluginLogDriverSuite|DockerCliPluginsSuite|DockerCliPortSuite|DockerCliProxySuite|DockerCliPruneSuite|DockerCliPsSuite|DockerCliPullSuite|DockerCliPushSuite|DockerCliRestartSuite|DockerCliRmiSuite",
"DockerCliRunSuite|DockerCliSaveLoadSuite|DockerCliSearchSuite|DockerCliSniSuite|DockerCliStartSuite|DockerCliStatsSuite|DockerCliTopSuite|DockerCliUpdateSuite|DockerCliVolumeSuite|DockerDaemonSuite|DockerExternalVolumeSuite|DockerHubPullSuite|DockerNetworkSuite|DockerPluginSuite|DockerRegistryAuthHtpasswdSuite|DockerRegistryAuthTokenSuite|DockerRegistrySuite|DockerSchema1RegistrySuite|DockerSwarmSuite"
] |
2ea1f8e to
ac55feb
Compare
tianon
left a comment
There was a problem hiding this comment.
Nice! I'm still a little worried about all those duplicated tiny "test suite" function entrypoints, but at least we now don't also have the hand-maintained lists in the YAML too 👍
thaJeztah
left a comment
There was a problem hiding this comment.
this looks really nice! I left comments about the capitalisation not being "correct" CamelCase; I realise that'd be a lot of work to change though 🙈
Happy to spend some time to make those changes though.
We should also have a look at (finally) renaming all the c *testing.T to t *testing.T, but that's gonna be more fun to do (there's some tests that will have a conflicting variable, so may not be a straight "rename").
a2aef49 to
ac12c09
Compare
Signed-off-by: CrazyMax <[email protected]>
Signed-off-by: CrazyMax <[email protected]>
Signed-off-by: CrazyMax <[email protected]>
Signed-off-by: CrazyMax <[email protected]>
Signed-off-by: CrazyMax <[email protected]>
ac12c09 to
15716fc
Compare
Yes let's do that in a follow-up |
| } | ||
|
|
||
| func TestDockerAPISuite(t *testing.T) { | ||
| ensureTestEnvSetup(t) |
There was a problem hiding this comment.
Not a blocker; mostly wondering if this should be part of / handled by suite.Run()
|
I'm bringing this one in; there was some discussion on Slack about the large number of jobs (as there's a job limit in GitHub actions); we'll likely run into that limit if we're gonna add Linux as well, but I think this gives the foundation to be flexible, and we can re-slice-and-dice once we run into those limits |



Split
DockerSuiteforintegration-clitests so we can create a matrix to reduce build time in our pipeline (windows atm). We could also usetagsfor this purpose. Let me know what sounds better to you. Keeping the working tree like this for visibility but will squash commits if it sgty.Here is the overall build time for each of them after splitting (still windows):
Before ~1h20m
After ~42m