Skip to content

Conversation

@timmy-wright
Copy link
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Makes debugging tests easier. We used to have the file contents in the test log when we logged the script execution. But that was removed because the logs were too large.

Which issue(s) this PR fixes:

Fixes #

Requirements:

  • uses conventional commit messages
  • includes documentation
  • adds unit tests
  • tested upgrade from previous version
  • commits are GPG signed and Github marks them as verified

Special notes for your reviewer:

Release note:

none

@timmy-wright timmy-wright changed the title cleanup: echo file contents in e2e test if a file contents check fails. test: echo file contents in e2e test if a file contents check fails. Jan 15, 2026
s.T.Fatalf("expected file %s to have contents %q, but it does not", fileName, contents)
actualContents, err := getFileContent(ctx, s, fileName)
if err != nil {
s.T.Fatalf("expected file %s to have contents %q, but it does not. Could not determine actual contents due to %s", fileName, contents, err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this error should just read Could not determine actual contents due to %s since we don't actually know if the contents match or not in this case

s.T.Fatalf("expected file %s to not have contents %q, but it does", fileName, contents)
actualContents, err := getFileContent(ctx, s, fileName)
if err != nil {
s.T.Fatalf("expected file %s to have contents %q, but it does. Could not determine actual contents due to %s", fileName, contents, err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

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

same thing here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants