-
Notifications
You must be signed in to change notification settings - Fork 120
Description
Area for Improvement
The 'unit-tests.yaml' workflow does not have logic to detect when code changes do not affect unit tests. Currently, unit tests always run even if the files changed in a PR do not require those tests.
Observed behavior
Functional test workflows (noncloud and cloud) use a change detection mechanism to skip running tests if only docs, markdown, or unrelated files are changed. The unit test workflow is missing this, leading to unnecessary test runs.
Desired behavior
Implement the same change detection logic in 'unit-tests.yaml' as seen in 'functional-test-cloud.yaml' and 'functional-test-noncloud.yaml'. The unit tests should only run on PRs if at least one changed file falls outside the excluded patterns (documentation, markdown, etc.), or otherwise be skipped.
Proposed Fix
- Review the change detection logic used in functional tests:
- Both 'functional-test-noncloud.yaml' and 'functional-test-cloud.yaml' call the '.github/workflows/__changes.yml' reusable workflow for change detection. See:
- These workflows use the output 'only_changed' from the reusable 'changes' job to conditionally execute tests.
- Apply the same pattern to 'unit-tests.yaml':
- Add a job to call '.github/workflows/__changes.yml' for change detection.
- Use the output (e.g., needs.changes.outputs.only_changed) to conditionally run or skip the unit tests job.
- Ensure patterns match those for functional tests (docs, markdown, etc.).
- Confirm the workflow handles PRs, pushes, and other triggers as needed.
Links to reference logic:
rad Version
edge
Operating system
No response
Additional context
No response