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

More exhaustive assertions for native rule tag propagation tests #25050

Conversation

Silic0nS0ldier
Copy link
Contributor

In src/test/shell/bazel/tags_propagation_native_test.sh

  • assert_contains_n "Command Line:" n output1
    ExecutionInfo: { is inappropriate as TemplateExpand also have execution info.
  • assert_contains_n "(local|no-cache|no-remote):" n output1
    Counting n increases confidence that all expected actions have the execution info they should have. e.g. tags propagated for tests, but not other actions when --incompatible_allow_tags_propagation=false
  • --experimental_allow_tags_propagation -> --incompatible_allow_tags_propagation
    Addresses warnings in test logs.

Changes in src/test/shell/unittest.bash address a bug in assert_contains_n which on failure was using the wrong argument to refer to the input file. For consistency other places were also updated to use $file instead of the argument number.

@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Jan 24, 2025
@iancha1992 iancha1992 added the team-Rules-Java Issues for Java rules label Jan 27, 2025
@hvadehra hvadehra added team-Loading-API BUILD file and macro processing: labels, package(), visibility, glob team-Local-Exec Issues and PRs for the Execution (Local) team and removed team-Rules-Java Issues for Java rules team-Loading-API BUILD file and macro processing: labels, package(), visibility, glob labels Jan 29, 2025
@hvadehra hvadehra requested a review from coeuvre January 29, 2025 10:11
@coeuvre coeuvre added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Jan 29, 2025
@coeuvre
Copy link
Member

coeuvre commented Jan 29, 2025

It seems like the test failure on macOS is legit. @Silic0nS0ldier, can you take a look?

@Silic0nS0ldier
Copy link
Contributor Author

I've taken a look, this was caused by cc_library producing different outputs on different platforms. For Linux .a (from CppArchive action) and .so (from CppLink action) files are produced, while macOS only produces .a so there is one action fewer.

Easily fixed with a platform check which I'll have pushed up shortly.

@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Jan 31, 2025
coeuvre pushed a commit to bazelbuild/continuous-integration that referenced this pull request Feb 4, 2025
Test failures can require information present in undeclared outputs to
diagnose, which if not uploaded means needing to first reproduce the
failure locally.

e.g.
https://buildkite.com/bazel/bazel-bazel-github-presubmit/builds/25623#0194aa2c-7bd9-466b-bd15-d7eec8ef58dc
(failure in `test.log` references a file in `test.outputs`) from
bazelbuild/bazel#25050

This PR adds uploading of `test.outputs/*` files for tests that
fail/flake/timeout.

It also;
* Simplifies `local_exec_root.as_ref().map(|p| p.as_path()),` to
`local_exec_root.as_deref(),` (clippy suggestion)
* Lifts the upload decision (dubbed `include_output` in this PR) up a
level so it can be used in the new code branch. I'm fairly `test.log` is
a mandatory test output, so this change should not affect performance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Local-Exec Issues and PRs for the Execution (Local) team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants