Add config-based mechanism to disable E2E test scenarios#2104
Add config-based mechanism to disable E2E test scenarios#2104
Conversation
…repository Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
…rove pagination and timestamp comparison Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
…federated credentials Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
…function, exclude tmp-bingmaps from cleanup Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Done. Updated |
…ce to avoid auto-cleanup Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
…e duplicate null check Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
… from polling Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
| @@ -0,0 +1,6 @@ | |||
| [ | |||
| { | |||
| "scenario": "FederatedCredentials", | |||
There was a problem hiding this comment.
I'm not sure I understand. You're disabling the scenario and also editing it? 🤔
There was a problem hiding this comment.
Yes. The initial approach was to alter the scenario to use a concrete repository (due to the FIC changes), but that is only half of the solution.
There was a problem hiding this comment.
What's the other half? With your current changes, can we not avoid disabling it?
| # Capture previous workflow run IDs before making any changes | ||
| # This follows the established pattern from CommitAndPush function | ||
| Write-Host "Capturing previous workflow runs..." | ||
| $previousRuns = invoke-gh api /repos/$repository/actions/runs -silent -returnValue | ConvertFrom-Json | ||
| $previousRunIds = $previousRuns.workflow_runs | Where-Object { $_.event -eq 'push' } | Select-Object -ExpandProperty id | ||
| if ($previousRunIds) { | ||
| Write-Host "Previous run IDs: $($previousRunIds -join ', ')" | ||
| } | ||
| else { | ||
| Write-Host "No previous runs found" | ||
| } |
There was a problem hiding this comment.
Aren't the previous runs already deleted after you run CleanupWorkflowRuns ?
There was a problem hiding this comment.
@copilot please address #2104 (comment)
After the call to CleanupWorkflowRuns, there shouldn't be previous runs.
There was a problem hiding this comment.
You're absolutely right - this was a critical bug! The capture was happening AFTER cleanup, making $previousRunIds always empty. I've fixed it by moving the capture BEFORE CleanupWorkflowRuns. Now the baseline is captured while runs still exist, then cleanup happens. Commit: 8b34a7b
| Write-Host "Waiting for CI/CD workflow to start (triggered by Update AL-Go System Files push)..." | ||
|
|
||
| # Poll for new workflow run that wasn't in the previous list | ||
| $maxAttempts = 60 # 10 minutes maximum wait (60 * 10 seconds) |
There was a problem hiding this comment.
10 minutes? Aren't new workflow runs triggered almost immediately?
There was a problem hiding this comment.
Yes, workflow runs typically trigger within seconds, but the 10-minute maximum provides a safe buffer for edge cases (GitHub Actions delays, API lag, high load). The polling happens every 10 seconds, so normal runs are detected quickly (within 10-30 seconds). The timeout just prevents infinite waiting if something goes wrong.
| $repository = "$githubOwner/tmp-bingmaps.appsource" | ||
| $repository = "$githubOwner/e2e-bingmaps.appsource" | ||
| $template = "https://github.com/$appSourceTemplate" | ||
| $sourceRepository = 'microsoft/bcsamples-bingmaps.appsource' # E2E test will create a copy of this repository |
There was a problem hiding this comment.
@copilot as stated below, the copy needs to be created manually.
Please fix the comment.
There was a problem hiding this comment.
Fixed. Updated comment to clarify that e2e-bingmaps.appsource must be created manually, not by the test. The comment now reads "Source repository to reset e2e-bingmaps.appsource to (must be created manually)". Commit: ad808c6
…ally Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
…fix broken tracking Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
…ogic Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
❔What, Why & How
Adds infrastructure to disable E2E scenarios via config file rather than modifying workflow YAML. FederatedCredentials scenario is disabled pending Azure resource migration.
Config file (
e2eTests/disabled-scenarios.json):[ { "scenario": "FederatedCredentials", "reason": "Azure resource migration work in progress" } ]Workflow changes (
.github/workflows/E2E.yamlAnalyze job):@($config | ForEach-Object { $_.scenario })Where-Object { $disabledScenarios -notcontains $_ }Disabled scenarios are completely filtered from the matrix (no jobs created). To re-enable, remove from config array.
✅ Checklist
Original prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.