refactor(e2e): remove reliance on Repository.Status in wait functions#2789
refactor(e2e): remove reliance on Repository.Status in wait functions#2789zakisk wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the end-to-end tests to monitor and assert on Tekton PipelineRuns directly rather than waiting for Repository status updates. The feedback highlights a recurring issue across multiple test files where the code directly accesses the Conditions slice by index (e.g., Conditions[0]) on a PipelineRun status. Since the order of conditions is not guaranteed, it is highly recommended to use GetCondition(apis.ConditionSucceeded) to safely and reliably retrieve the 'Succeeded' condition.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2789 +/- ##
=======================================
Coverage 60.09% 60.09%
=======================================
Files 210 210
Lines 21135 21135
=======================================
Hits 12701 12701
Misses 7641 7641
Partials 793 793 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
c211bca to
51f1574
Compare
There was a problem hiding this comment.
[AI Reviews]
The ordering fixes and restoration of the Gitea on-comment golden coverage are the correctness issues that need attention here. I have left the condition-access findings out because Gemini already opened threads for those lines.
One semantic note on TestGitlabMergeRequest: restoring SHA: mr.SHA directly would make the new helper wait for five PipelineRuns with that SHA, unlike the old helper which counted all statuses and then selected a matching SHA. The current unfiltered wait avoids that timeout, but if explicit SHA validation remains part of the test contract it should be preserved separately from the total-count wait.
Please add ordering unit coverage with deliberately reversed creation timestamps. The relevant local checks are go test ./test/pkg/wait and go test -run '^$' -tags=e2e ./test; go build ./test/... does not compile the changed _test.go files.
|
there are many failures and they will be on next pushes as well because our E2E tests were heavily reliant on repo.Status field, working to resolve them locally instead of running here because they're time consuming... |
ea511da to
b51ebaf
Compare
yeah not a trivial task you took! but this would be great and more robust when we get there |
4a96909 to
778c5ae
Compare
The Repository CR's Status field is deprecated and will be removed. This refactors E2E test wait helpers to use PipelineRun objects directly instead of polling Repository.Status: - Remove UntilRepositoryUpdated and UntilRepositoryHasStatusReason - Remove FailOnRepoCondition from wait.Opts - Modify UntilPipelineRunCreated and UntilPipelineRunHasReason to return []PipelineRun so callers can inspect annotations and conditions - Add UntilPipelineRunsFinished for mixed-outcome tests (1 pass + 1 fail) - Rewrite Succeeded() helper to validate PipelineRun annotations instead of repo.Status fields - Migrate all ~40 call sites across 20 test files Signed-off-by: Zaki Shaikh <zashaikh@redhat.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
778c5ae to
3eaa9a0
Compare
📝 Description of the Change
The Repository CR's Status field is deprecated and will be removed. This refactors E2E test wait helpers to use PipelineRun objects directly instead of polling Repository.Status:
🔗 Linked GitHub Issue
Fixes #
🧪 Testing Strategy
🤖 AI Assistance
AI assistance can be used for various tasks, such as code generation,
documentation, or testing.
Please indicate whether you have used AI assistance
for this PR and provide details if applicable.
Important
Slop will be simply rejected, if you are using AI assistance you need to make sure you
understand the code generated and that it meets the project's standards. you
need at least know how to run the code and deploy it (if needed). See
startpaac to make it easy
to deploy and test your code changes.
If the majority of the code in this PR was generated by an AI, please add a
Co-authored-bytrailer to your commit message.For example:
Co-authored-by: Claude noreply@anthropic.com
✅ Submitter Checklist
fix:,feat:) matches the "Type of Change" I selected above.make testandmake lintlocally to check for and fix anyissues. For an efficient workflow, I have considered installing
pre-commit and running
pre-commit installtoautomate these checks.