-
Notifications
You must be signed in to change notification settings - Fork 694
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
Fixed broken //tests/docker/util:all
tests
#1817
Conversation
//tests/docker/util:all
tests//tests/docker/util:all
tests
//tests/docker/util:all
tests//tests/docker/util:all
tests
container/layer_tools.bzl
Outdated
@@ -120,8 +120,10 @@ def get_from_target(ctx, name, attr_target, file_target = None): | |||
else: | |||
if not hasattr(attr_target, "files"): | |||
return {} | |||
target = attr_target.files.to_list()[0] | |||
return _extract_layers(ctx, name, target) | |||
tar_files = [file for file in attr_target.files.to_list() if file.extension == "tar"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the bug was the toolchain was giving us more than one file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rule_test
was providing the files listed in generates
. The issue was that this code assumed that there was either one file or that the first file is a tar file. So the fix I went with was to search for tar files and require that only one was found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue originates from
rules_docker/tests/docker/util/BUILD
Lines 82 to 85 in 0adf8b2
generates = [ | |
"test_container_commit.build", | |
"test_container_commit_commit.tar", | |
], |
Oh so the bug was actually that we sorted that list? |
* Fix broken `//tests/docker/util:all` tests * just revert the breaking reordering change Co-authored-by: Alex Eagle <[email protected]>
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
RBE builds are currently failing when testing
//tests/docker/util:all
with the following errorWhat is the new behavior?
This PR introduces the fix for this.
Does this PR introduce a breaking change?
Other information