fix: Gitea test TestGiteaParamsChangedFilesCEL flakiness#2049
Merged
pipelines-as-code[bot] merged 1 commit intotektoncd:mainfrom Apr 16, 2025
Merged
fix: Gitea test TestGiteaParamsChangedFilesCEL flakiness#2049pipelines-as-code[bot] merged 1 commit intotektoncd:mainfrom
pipelines-as-code[bot] merged 1 commit intotektoncd:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
A work-in-progress pull request aiming to fix flakiness in the TestGiteaParamsChangedFilesCEL test by adjusting event expectations and iteration logic.
- Introduces a new parameter "ExpectEventsNumber" to determine the expected count of events.
- Updates iteration constructs in TestPR and NewPR functions for looping over a fixed number of iterations.
- Enhances event logging and failure conditions based on the updated event expectations.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/pkg/gitea/test.go | Added "ExpectEventsNumber" field, modified loop constructions for pull request creation and event handling. |
| test/gitea_params_test.go | Updated test configuration to include "ExpectEventsNumber" with a value of 1. |
Comments suppressed due to low confidence (3)
test/pkg/gitea/test.go:375
- [nitpick] The variable name 'event' is used as an index when iterating over events.Items; consider renaming it to 'i' or 'idx' or using a two-value range loop for clarity.
for event := range events.Items {
test/pkg/gitea/test.go:206
- The loop 'for i := range 5' is not valid Go syntax for iterating a fixed number of times. Consider reverting to 'for i := 0; i < 5; i++' or using a slice with a range.
for i := range 5 {
test/pkg/gitea/test.go:360
- The change to 'for range 30' does not correctly iterate 30 times in Go. Use a traditional loop such as 'for i := 0; i < 30; i++' to achieve the intended iteration.
for range 30 {
12f46f1 to
5740efc
Compare
• Changed event reason from RepositoryPipelineRun to CancelInProgress for pipeline run cancellation messages. • Updated end-to-end tests to ignore events with the CancelInProgress reason. • This provided clearer event reporting specific to cancellation actions. • This prevented tests from spuriously failing due to expected cancellation events Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
5740efc to
977ac26
Compare
Member
|
/lgtm |
There was a problem hiding this comment.
Congrats @chmouel your PR Has been approved 🎉
✅ Pull Request Approved
Approval Status:
- Required Approvals: 1
- Current Approvals: 1
👥 Reviewers Who Approved:
| Reviewer | Permission Level | Approval Status |
|---|---|---|
| @zakisk | admin |
✅ |
📝 Next Steps
- Ensure all required checks pass
- Comply with branch protection rules
- Request a maintainer to merge using the
/mergecommand (or merge it
directly if you have repository permission).
Automated by the PAC Boussole 🧭
Member
Author
|
/merge |
✅ PR Successfully Merged
Approvals Summary:
Thank you @chmouel for your valuable contribution! 🎉 Automated by the PAC Boussole 🧭 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR refines the event reporting for PipelineRun cancellations to provide clearer messaging and prevent test failures from
expected cancellation events.
Changes:
RepositoryPipelineRuntoCancelInProgressfor cancellation-related messages, making theintent more explicit.
CancelInProgressreason, preventing false negatives in test assertions.checkEvents) to filter out cancellation-related events during test validation.Impact:
Testing:
Related Issues:
(N/A – or reference relevant issues if applicable)