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

bazel: bazci does not appropriately capture test logs for all tests, including pkg/server:server_test #63960

Closed
rickystewart opened this issue Apr 20, 2021 · 0 comments · Fixed by #64153
Assignees
Labels
A-build-system C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Comments

@rickystewart
Copy link
Collaborator

Unlike the majority of tests, server_test is sharded, so logs are also sharded:

cockroach$ find bazel-testlogs/pkg/server/server_test | sort
bazel-testlogs/pkg/server/server_test
bazel-testlogs/pkg/server/server_test/shard_10_of_16
bazel-testlogs/pkg/server/server_test/shard_10_of_16/test.cache_status
bazel-testlogs/pkg/server/server_test/shard_10_of_16/test.log
bazel-testlogs/pkg/server/server_test/shard_10_of_16/test.outputs
bazel-testlogs/pkg/server/server_test/shard_10_of_16/test.outputs_manifest
bazel-testlogs/pkg/server/server_test/shard_10_of_16/test.raw_splitlogs
bazel-testlogs/pkg/server/server_test/shard_10_of_16/test.xml
bazel-testlogs/pkg/server/server_test/shard_11_of_16
bazel-testlogs/pkg/server/server_test/shard_11_of_16/test.cache_status
bazel-testlogs/pkg/server/server_test/shard_11_of_16/test.log
bazel-testlogs/pkg/server/server_test/shard_11_of_16/test.outputs
bazel-testlogs/pkg/server/server_test/shard_11_of_16/test.outputs_manifest
bazel-testlogs/pkg/server/server_test/shard_11_of_16/test.raw_splitlogs
bazel-testlogs/pkg/server/server_test/shard_11_of_16/test.xml

bazci checks under the literal path bazel-testlogs/pkg/server/server_test/test.{log,xml}, so that doesn't work.

We should probably be globbing and then mirroring the directory structure into the artifacts directory.

Also, consider whether it makes sense to add assertions in some places when we expect an artifact will be present, but it's not.

@rickystewart rickystewart added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. A-build-system labels Apr 20, 2021
@rickystewart rickystewart self-assigned this Apr 20, 2021
craig bot pushed a commit that referenced this issue Apr 26, 2021
64153: bazel: bazci appropriately captures sharded test/log output r=rail a=rickystewart

Some tests, like `//pkg/server:server_test`, are sharded, meaning that
their `test.log`/`test.xml` files are split into many different folders
in the `bazel-testlogs` directory, like:

    bazel-testlogs/pkg/server/server_test/shard_1_of_16/test.log

Before this patch, `bazci` would only look in the `server_test`
directory for the `test.{log,xml}`, and would therefore miss these. Now,
`bazci` globs and mirrors the directory structure of the source test
directory.

Also add unit tests to cover this case.

Resolves #63960.

Release note: None

Co-authored-by: Ricky Stewart <ricky@cockroachlabs.com>
@craig craig bot closed this as completed in 44da455 Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-system C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant