Skip to content

make it easier to update image_test hashes#2148

Closed
zevdg wants to merge 1 commit into
bazelbuild:masterfrom
zevdg:golden-hashes
Closed

make it easier to update image_test hashes#2148
zevdg wants to merge 1 commit into
bazelbuild:masterfrom
zevdg:golden-hashes

Conversation

@zevdg
Copy link
Copy Markdown
Contributor

@zevdg zevdg commented Aug 22, 2022

We had to do this recently with #2098. This is also useful for organisations that link against different zlib implementations (namely zlib-ng). This change makes it possible to easily swap out the hashes without modifying the test code.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

test hashes are hardcoded into test, and must be updated manually

Issue Number: N/A

What is the new behavior?

test hashes are now encoded in testdata/goldens and can be regenerated by the test when needed.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@zevdg zevdg force-pushed the golden-hashes branch 12 times, most recently from e07807d to 725e45a Compare August 23, 2022 21:00
@zevdg
Copy link
Copy Markdown
Contributor Author

zevdg commented Aug 23, 2022

Ok, this is ready for reviewer now.

We had to do this recently with bazelbuild#2098.  This is also useful for organisations that link against different zlib implementations (namely zlib-ng). This change makes it possible to easily swap out the hashes without modifying the test code.
Comment thread testdata/BUILD
visibility = ["//visibility:private"],
)

filegroup(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to create an image hash json file? This way we could have testdata/image-hash.json which could have:

{
  "test_base_with_entrypoint": "..."
}

This might be a little easier to use outside of google3 but I'm not sure. WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain how that would make it easier? These files are only meant to be used in tests, and the test-helper I added in this CL is designed to be generic. It's essentially just a simple python port of a generic test helper like this. I don't see how making it less generic makes it better.

@github-actions
Copy link
Copy Markdown

This Pull Request has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

@github-actions github-actions Bot added the Can Close? Will close in 30 days unless there is a comment indicating why not label Mar 23, 2023
@github-actions
Copy link
Copy Markdown

This PR was automatically closed because it went 30 days without a reply since it was labeled "Can Close?"

@github-actions github-actions Bot closed this Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Can Close? Will close in 30 days unless there is a comment indicating why not

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants