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

test(scorecard): preserve CR when retrying on conflict #912

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

ebaron
Copy link
Member

@ebaron ebaron commented Jul 10, 2024

Welcome to Cryostat! 👋

Before contributing, make sure you have:

  • Read the contributing guidelines
  • Linked a relevant issue which this PR resolves
  • Linked any other relevant issues, PR's, or documentation, if any
  • Resolved all conflicts, if any
  • Rebased your branch PR on top of the latest upstream main branch
  • Attached at least one of the following labels to the PR: [chore, ci, docs, feat, fix, test]
  • Signed all commits: git commit -S -m "YOUR_COMMIT_MESSAGE"

Fixes: #841

Description of the change:

  • Avoids overwriting the cr variable when calling Update. If this fails due to a conflict, the update will be silently retried, but cr will now be nil.
  • Moves the update and retry to a helper function for convenience

Motivation for the change:

  • Fixes a sporadic scorecard test failure encountered downstream

How to manually test:

  1. make test-scorecard-local SCORECARD_TEST_SELECTION=cryostat-config-change
  2. In order to reliably reproduce the update conflict, you can use a patch similar to the one listed here: [Bug] Scorecard test can fail with "failed to get Cryostat CR: resource name may not be empty" #841 (comment)

@ebaron ebaron requested a review from a team July 10, 2024 17:38
@mergify mergify bot added the safe-to-test label Jul 10, 2024
@andrewazores
Copy link
Member

/build_test

@andrewazores
Copy link
Member

Copy link

/build_test completed successfully ✅.
View Actions Run.

@andrewazores
Copy link
Member

/build_test

Copy link

/build_test completed successfully ✅.
View Actions Run.

@ebaron ebaron merged commit e10f18d into cryostatio:main Jul 10, 2024
7 checks passed
mergify bot pushed a commit that referenced this pull request Jul 10, 2024
* test(scorecard): preserve CR when retrying on conflict

* Don't initialize return value

(cherry picked from commit e10f18d)
ebaron added a commit that referenced this pull request Jul 10, 2024
* test(scorecard): preserve CR when retrying on conflict

* Don't initialize return value

(cherry picked from commit e10f18d)

Co-authored-by: Elliott Baron <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug] Scorecard test can fail with "failed to get Cryostat CR: resource name may not be empty"
3 participants