Repository navigation
ci: run each test shard's packages, not the whole module first - #2516
Open
im-apratap wants to merge 1 commit into
Open
im-apratap wants to merge 1 commit into
im-apratap wants to merge 1 commit into
Conversation
`nsgo test` read its argument as a project directory and always ran ./... inside it, so the suite's first shard tested every package and then its own list again, 4975 tests against the 4850 the single job ran, and the shard was slower than the job it replaced. test now takes Go package patterns from the module's root, so a directory names its own package and /... its tree, and one run tests exactly the packages named. An app's directory or TSX entry is still taken whole. Each shard is one run, its job names are short, and the guard expands patterns as test does and checks the dev client's nsgodev variant runs in one shard. Fixes nsgo-dev#2504. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2504.
nsgo testread its argument as a project directory and always ran./...inside it, sonsgo test .tested the whole module and the first shard then tested its own list again — 4975 tests against the 4850 a single job ran, with a slower shard than the job the split replaced.What changes
nsgo testtakes Go package patterns, counted from the module's root, asgo testdoes: a directory names its own package,/...its tree. One run tests exactly the packages named. No pattern still tests every package under the working directory, and a target run takes one pattern.nsgo.yaml) or a TSX entry is taken whole as before, so app and steps runs are unchanged.test.ymlis onensgo testrun over its patterns instead of a loop of runs, so each package is built and reported once; the matrix has short names (test-suite (app),test-suite (core)).TestSuiteShardsCoverEveryPackage) expands each shard's patterns the waytestdoes, rejects a package named twice or by no shard, and now also checks the dev client'snsgodevvariant runs in exactly one shard — the runtestadds only when the patterns nameinternal/dev.docs/public/en/testing.md,docs/public/zh/testing.mdandskills/nsgo/SKILL.mdsay what a pattern names.Verification
go tool nsgo check -target linux— vetted forlinux_arm64andlinux_x64.go tool nsgo test -run 'TestSuiteShardsCoverEveryPackage|TestTestTakesPackagePatterns|TestTestEntryTakesAnAppButNotAModule|TestForwardedTestFlagsDoNotNameADirectory|TestTestArgumentsKeepGoTestFlags|TestTestCommandRegistersJSON|TestRunTestsRejectsAPackageAmongItsFlags' ./cmd/nsgo— 7 passed.go tool nsgo test -run '^$' . ./core— exited 0 and built exactly two packages (github.com/nsgo-dev/nsgoandgithub.com/nsgo-dev/nsgo/core); before this change.alone expanded to every package of the module.go run ./tools/changelog check— 27 fragments, valid.The shard timings themselves need a CI run: this machine has no Actions runner, so I did not measure the new shard durations.
🤖 Generated with Codebuff