Skip to content

Conversation

@Alan-TheGentleman
Copy link
Contributor

@Alan-TheGentleman Alan-TheGentleman commented Jan 21, 2026

Context

Optimizes CI by running only relevant tests based on changed files, reducing feedback time for developers.

Jira: PROWLER-738

Description

Adds a test impact analysis system that determines which tests to run based on changed files.

How It Works

  1. Ignored Paths (skip ALL tests): Changes to docs, configs, and non-code files

    • docs/**, *.md, examples/**, contrib/**, skills/**
    • .gitignore, .editorconfig, LICENSE, CODEOWNERS
    • IDE configs (.vscode/**, .idea/**)
  2. Critical Paths (run ALL tests): Changes to foundational code trigger full test suite

    • prowler/lib/**, prowler/config/**, prowler/exceptions/**
    • api/src/backend/api/models.py, api/src/backend/config/**
    • ui/lib/**, ui/types/**, ui/config/**
    • .github/workflows/**
  3. Module Paths (run targeted tests): Changes to specific modules run only related tests

    Change Tests Run
    prowler/providers/aws/** tests/providers/aws/**
    ui/components/providers/** ui/tests/providers/**
    ui/components/auth/** ui/tests/sign-in/** ui/tests/sign-up/**
    api/v1/serializers.py API tests + UI E2E (side effect)
  4. Side Effects Detection: API serializer/view changes trigger UI E2E tests

Files Added

File Purpose
.github/test-impact.yml Path → test mappings configuration
.github/scripts/test-impact.py Analysis script
.github/workflows/test-impact-analysis.yml Reusable workflow
.github/workflows/ui-e2e-tests-v2.yml Optimized E2E workflow

Benchmark Results

Tested on this PR with different change scenarios:

Test 1: Provider component changes (ui/components/providers/)

Workflow Duration Tests Run
UI - E2E Tests (Original) 12m 31s All specs
UI - E2E Tests (Optimized) 11m 39s providers/** only
Savings ~1 min (8%)

Test 2: Auth component changes (ui/components/auth/)

Workflow Duration Tests Run
UI - E2E Tests (Original) 12m 53s All specs
UI - E2E Tests (Optimized) 10m 13s sign-in/** sign-up/** only
Savings ~2m 40s (20%)

Test 3: Docs-only changes (docs/**, *.md)

Workflow Duration Tests Run
UI - E2E Tests (Original) 12m+ All specs
UI - E2E Tests (Optimized) ~20s SKIPPED
Savings ~12 min (100%)

Note: Setup time (k8s cluster, API, build) is ~8-9 min fixed for E2E. Biggest savings come when changes don't require any tests (docs, configs).

Steps to review

  1. Review .github/test-impact.yml for correct path → test mappings
  2. Review .github/scripts/test-impact.py for analysis logic
  3. Check workflow outputs in the Actions tab of this PR
  4. After merge, monitor subsequent PRs to validate selective test execution

Checklist

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

- Add test-impact.yml config mapping paths to test patterns
- Add test-impact.py script to analyze changed files
- Add reusable test-impact-analysis.yml workflow
- Add ui-e2e-tests-v2.yml as optimized E2E workflow example

This enables running only relevant tests based on changed files:
- Critical paths (lib, config, models) run ALL tests
- Module paths run only mapped tests
- Side effects detected (e.g., API serializers trigger UI E2E)

Testing: Added dummy change to ui/components/providers to verify
the analysis correctly identifies ui/tests/providers/** as target.
@Alan-TheGentleman Alan-TheGentleman requested review from a team as code owners January 21, 2026 12:26
@github-actions github-actions bot added github_actions Pull requests that update GitHub Actions code component/ui labels Jan 21, 2026
@github-actions
Copy link
Contributor

⚠️ Changes detected in the following folders without a corresponding update to the CHANGELOG.md:

  • ui

Please add an entry to the corresponding CHANGELOG.md file to maintain a clear history of changes.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 21, 2026

Conflict Markers Resolved

All conflict markers have been successfully resolved in this pull request.

@Alan-TheGentleman Alan-TheGentleman self-assigned this Jan 21, 2026
@Alan-TheGentleman Alan-TheGentleman added the no-changelog Skip including change in changelog/release notes label Jan 21, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 21, 2026

🔒 Container Security Scan

Image: prowler-ui:fb5ce58
Last scan: 2026-01-21 12:50:19 UTC

✅ No Vulnerabilities Detected

The container image passed all security checks. No known CVEs were found.

📋 Resources:

- Remove deprecated ::set-output format from debug output
- Revert dummy change to ui/components/providers/index.ts
- Re-enable .github/** as critical path
Testing that auth changes only trigger sign-in and sign-up E2E tests
Files matching ignored patterns (docs, markdown, configs, examples)
will not trigger any tests, saving CI resources.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code no-changelog Skip including change in changelog/release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants