-
Notifications
You must be signed in to change notification settings - Fork 80
Modify Scenario Test to check tagged pull requests #5422
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances scenario tests to support merging pull requests instead of just closing them during cleanup, and adds validation for PR comments on closed PRs.
- Added
PullRequestCleanupOperationenum to toggle between closing and merging PRs - Extended
WaitForPullRequestAsyncandWaitForPullRequestCommentto filter PRs by state (open/closed) - Updated test to merge the PR and verify comments appear on the closed PR
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/ProductConstructionService.ScenarioTests/ScenarioTestBase.cs | Added PullRequestCleanupOperation enum, MergePullRequest method, and updated CleanUpPullRequestAfter to support merge operations; moved using statements to top of file |
| test/ProductConstructionService.ScenarioTests/CodeFlowScenarioTestBase.cs | Updated CheckForwardFlowGitHubPullRequest and WaitForPullRequestComment to accept PullRequestCleanupOperation and ItemStateFilter parameters respectively |
| test/ProductConstructionService.ScenarioTests/ScenarioTests/ScenarioTests_CodeFlow.cs | Modified test to use merge cleanup operation and verify comments on closed PR with corrected expected comment format |
Comments suppressed due to low confidence (2)
test/ProductConstructionService.ScenarioTests/ScenarioTestBase.cs:1252
- Generic catch clause.
catch
{
// Closed already
}
test/ProductConstructionService.ScenarioTests/ScenarioTestBase.cs:1260
- Generic catch clause.
catch
{
// branch already deleted
}
| catch | ||
| { | ||
| // Closed already | ||
| } |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty catch block swallows all exceptions without logging. This should catch specific exceptions (e.g., ApiException) and log or rethrow unexpected errors to aid debugging test failures.
| // here we're testing for a URI with () around, since that's what we write during the codeflow udpates | ||
| [$"(https://github.com/maestro-auth-test/maestro-test1/pull/{testPrNumber})"]); | ||
|
|
||
| await WaitForPullRequestComment( | ||
| TestRepository.VmrTestRepoName, | ||
| targetBranchName, | ||
| // here we test for this specific format because that's how we tag PRs after merging the forward flow |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expected comment format wrapped in parentheses differs from the format on line 112 which uses - prefix. This inconsistency suggests these may be validating different comment formats. Consider adding a comment explaining why these two checks use different formats or consolidating if they should match.
| // here we're testing for a URI with () around, since that's what we write during the codeflow udpates | |
| [$"(https://github.com/maestro-auth-test/maestro-test1/pull/{testPrNumber})"]); | |
| await WaitForPullRequestComment( | |
| TestRepository.VmrTestRepoName, | |
| targetBranchName, | |
| // here we test for this specific format because that's how we tag PRs after merging the forward flow | |
| // We expect the URI to be wrapped in parentheses here because codeflow update comments use this format. | |
| // This matches the format written by the codeflow update logic, which intentionally differs from the merge tag format below. | |
| [$"(https://github.com/maestro-auth-test/maestro-test1/pull/{testPrNumber})"]); | |
| await WaitForPullRequestComment( | |
| TestRepository.VmrTestRepoName, | |
| targetBranchName, | |
| // We expect the '- ' prefix here because merged PRs are tagged with this format after forward flow completion. | |
| // This is distinct from the codeflow update format above, and is required for correct PR tracking. |
…)" This reverts commit 96285f6.
#5263