freedomcombination / monorepo

Freedom Combination Monorepo
https://ui.wsvvrijheid.nl
3 stars 0 forks source link

FEAT: Run Tests Only for Changed Files on Specific Branches #1870

Open 7alip opened 2 hours ago

7alip commented 2 hours ago

Description:

Implement a mechanism to run tests only for changed/updated files if the branch name starts with test/ or /onboarding.

Steps to Implement:

Suggestions:

7alip commented 2 hours ago

1. Run Tests Only for Changed/Updated Files Using Playwright

You can achieve this by using a combination of Playwright and Git commands. Here's a general approach:

2. Detect Branches Starting with test/ or /onboarding in the CI/CD Pipeline

You can configure your CI/CD pipeline (e.g., GitHub Actions) to check the branch name and run the tests accordingly.

  1. Identify Changed Files: Use Git commands to list the changed files.
  2. Filter Test Files: Extract the test files from the list of changed files.
  3. Run Tests Conditionally: Configure the CI/CD pipeline to run the tests based on branch names.