Skip to content

Niels/investigation.flaky test hunter on pr - #8860

Open
nielsVoogt wants to merge 3 commits into
mainfrom
niels/investigation.flaky-test-hunter-on-pr
Open

nielsVoogt wants to merge 3 commits into
mainfrom
niels/investigation.flaky-test-hunter-on-pr

Conversation

@nielsVoogt

@nielsVoogt nielsVoogt commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

AB#44653

Describe your changes

TESTRUNNING - NOT READY YET

Checklist before requesting a code review

  • I have performed a self-review of my code
  • I have addressed all Copilot comments
  • I have asked the design team to review these changes, or: The changes do not touch the UI/UX
  • I have added tests for my changes, or: Adding tests is unnecessary/irrelevant
  • I have made sure that all automated checks pass before requesting a review
  • I do not need any deviation from our PR guidelines

Portal preview-deployment

This PR does not have any preview deployments yet.

Copilot AI lite review requested due to automatic review settings September 17, 2026 07:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical workflow and validation-fixture issues prevent reliable flaky-test detection.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds PR-based flaky-test detection for changed or new Portal E2E specs.

Changes:

  • Adds changed-spec selection tooling and an npm command.
  • Integrates candidate detection and repeated flaky-test runs into CI.
  • Adds temporary stable and flaky validation specs.
File summaries
File Description
tools/select-changed-e2e-tests.mjs Selects qualifying changed E2E specs.
tools/package.json Registers the selector command.
e2e/portal/tests/TestingCi/PurposlyStable.spec.ts Adds stable CI validation coverage.
e2e/portal/tests/TestingCi/PurposelyFlaky.spec.ts Adds temporary flaky-test validation.
.github/workflows/test_e2e_portal.yml Runs candidate detection and flaky-test jobs.
Review details

Suppressed comments (1)

.github/workflows/test_e2e_portal.yml:92

  • This new job is gated by path-filter, but that filter does not include tools/select-changed-e2e-tests.mjs. After this PR, a future change to the selector alone will make the E2E workflow skip candidate detection, so regressions in this CI-critical script can merge without the workflow exercising them. Include the selector in the path-filter inputs.
    if: ${{ needs.path-filter.outputs.should_skip != 'true' && github.event_name == 'pull_request' }}
  • Files reviewed: 5/5 changed files
  • Comments generated: 8
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

SPEC_FILE: ${{ matrix.file }}
REPEAT_COUNT: ${{ github.event.inputs.repeat_count || '30' }}
run: |
npm test -- "$SPEC_FILE" --fail-on-flaky-tests --retries=0 --repeat-each "$REPEAT_COUNT" -x --trace retain-on-failure --reporter=html
test-shard-resolution-e2e:
runs-on: ubuntu-slim
needs: [test-shard-e2e]
needs: [test-shard-e2e, find-flaky-changed-tests]
Comment on lines +3 to +4
// TEMPORARY — for validating the `find-flaky-changed-tests` CI job only.
// Delete this file before merging; do not commit it to `main`.
Comment on lines +11 to +14
repeat_count:
description: 'Number of repetitions per test when hunting flaky tests'
type: string
default: '30'
async function getChangedSpecFiles({ repositoryRoot, base, head }) {
const stdout = await execFileAsync(
'git',
['diff', '--no-renames', '--numstat', base, head],
@@ -0,0 +1,5 @@
import { expect, test } from '@playwright/test';
import { appendFileSync, readFileSync } from 'node:fs';
import { parseArgs } from 'node:util';

const execFileAsync = (command, commandArgs, options) =>
Comment on lines +142 to +147
function toE2eRelativePath(path) {
return path.slice('e2e/'.length);
}

function writeGithubOutput({ candidates }) {
const files = candidates.map(({ path }) => toE2eRelativePath(path));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants