Tests tracks selectively based on PR changes#858
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements selective test execution based on PR changes by integrating pytest-rally plugin's --track-filter option. Tests will now only run for tracks affected by changes in the top-level directories of the repository.
- Updates test command configurations to support dynamic track filtering arguments
- Adds pytest track markers to associate test classes and methods with specific tracks
- Implements CI workflow changes to detect changed tracks and pass them as filter arguments
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Updates test scripts to accept arguments and adds track marker configuration |
| .github/workflows/ci.yml | Adds track filtering workflow and updates test execution to use filtered tracks |
| .github/scripts/track-filter.py | Creates script to generate track filters based on directory structure |
| .buildkite/it/run_serverless.sh | Implements track filtering for Buildkite serverless tests |
| it_serverless/test_logs.py | Adds track marker for elastic/logs track |
| it/test_synthetic_source.py | Adds track markers for tsdb and nyc_taxis tracks |
| it/test_security.py | Adds track marker for elastic/security track |
| it/test_custom_parameters.py | Adds track markers for tsdb track |
| it/logs/test_logs_unmapped.py | Adds track marker for elastic/logs track |
| it/logs/test_logs.py | Adds track marker for elastic/logs track |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
gbanasiak
left a comment
There was a problem hiding this comment.
This looks good, many thanks for tackling this. I think we also need to be able to specify files/paths that trigger full set of tests (e.g. .buildkite/**, pyproject.toml, .github/**) regardless of what specific top-level track folders were matched.
- 'elastic/logs' and 'elastic/security' marks changed to 'elastic' - Fix name for unit tests to include the value of --track-filter
|
@elasticmachine update branch |
We decided to go with a simple plan, where pytest-rally will just run everything from elastic top-level track if the elastic top-level directory was changed, which keeps it simple.
|
I will be testing more things before backporting to the correct version |
Implements test execution based on PR changes by integrating pytest-rally plugin's --track-filter option. Tests will now only run for tracks affected by changes in the top-level directories of the repository. - Updates test command configurations to support dynamic track filtering arguments - Adds pytest track markers to associate test classes and methods with specific tracks - Implements CI workflow changes to detect changed tracks and pass them as filter arguments - Defines RUN_FULL_CI_WHEN_CHANGED env variable which point to files that when changed full CI is executed.
* Tests tracks selectively based on PR changes (elastic#858) Implements test execution based on PR changes by integrating pytest-rally plugin's --track-filter option. Tests will now only run for tracks affected by changes in the top-level directories of the repository. - Updates test command configurations to support dynamic track filtering arguments - Adds pytest track markers to associate test classes and methods with specific tracks - Implements CI workflow changes to detect changed tracks and pass them as filter arguments - Defines RUN_FULL_CI_WHEN_CHANGED env variable which point to files that when changed full CI is executed. * CI builds ES revision from sources based on es-version file (elastic#875) - Github workflows now execute CI with the additional --revision option, effectively building Elasticsearch from sources using a revision SHA and according to [Rally --revision rules](https://esrally.readthedocs.io/en/stable/command_line_reference.html#revision) - es-version added to root directory which determine what is the value of the --revision argument that will be used in CI.
* Tests tracks selectively based on PR changes (elastic#858) Implements test execution based on PR changes by integrating pytest-rally plugin's --track-filter option. Tests will now only run for tracks affected by changes in the top-level directories of the repository. - Updates test command configurations to support dynamic track filtering arguments - Adds pytest track markers to associate test classes and methods with specific tracks - Implements CI workflow changes to detect changed tracks and pass them as filter arguments - Defines RUN_FULL_CI_WHEN_CHANGED env variable which point to files that when changed full CI is executed. * CI builds ES revision from sources based on es-version file (elastic#875) - Github workflows now execute CI with the additional --revision option, effectively building Elasticsearch from sources using a revision SHA and according to [Rally --revision rules](https://esrally.readthedocs.io/en/stable/command_line_reference.html#revision) - es-version added to root directory which determine what is the value of the --revision argument that will be used in CI.
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
Implements test execution based on PR changes by integrating pytest-rally plugin's --track-filter option. Tests will now only run for tracks affected by changes in the top-level directories of the repository. - Updates test command configurations to support dynamic track filtering arguments - Adds pytest track markers to associate test classes and methods with specific tracks - Implements CI workflow changes to detect changed tracks and pass them as filter arguments - Defines RUN_FULL_CI_WHEN_CHANGED env variable which point to files that when changed full CI is executed.
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
Implements test execution based on PR changes by integrating pytest-rally plugin's --track-filter option. Tests will now only run for tracks affected by changes in the top-level directories of the repository. - Updates test command configurations to support dynamic track filtering arguments - Adds pytest track markers to associate test classes and methods with specific tracks - Implements CI workflow changes to detect changed tracks and pass them as filter arguments - Defines RUN_FULL_CI_WHEN_CHANGED env variable which point to files that when changed full CI is executed. (cherry picked from commit 714442d) Co-authored-by: Nick Dris <nick.dris@elastic.co>
Implements test execution based on PR changes by integrating pytest-rally plugin's --track-filter option. Tests will now only run for tracks affected by changes in the top-level directories of the repository. - Updates test command configurations to support dynamic track filtering arguments - Adds pytest track markers to associate test classes and methods with specific tracks - Implements CI workflow changes to detect changed tracks and pass them as filter arguments - Defines RUN_FULL_CI_WHEN_CHANGED env variable which point to files that when changed full CI is executed. (cherry picked from commit 714442d) # Conflicts: # it/logs/test_logs_unmapped.py # it/test_custom_parameters.py # pyproject.toml
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Implements test execution based on PR changes by integrating pytest-rally plugin's --track-filter option. Tests will now only run for tracks affected by changes in the top-level directories of the repository. - Updates test command configurations to support dynamic track filtering arguments - Adds pytest track markers to associate test classes and methods with specific tracks - Implements CI workflow changes to detect changed tracks and pass them as filter arguments - Defines RUN_FULL_CI_WHEN_CHANGED env variable which point to files that when changed full CI is executed.
Implements test execution based on PR changes by integrating pytest-rally plugin's --track-filter option. Tests will now only run for tracks affected by changes in the top-level directories of the repository. - Updates test command configurations to support dynamic track filtering arguments - Adds pytest track markers to associate test classes and methods with specific tracks - Implements CI workflow changes to detect changed tracks and pass them as filter arguments - Defines RUN_FULL_CI_WHEN_CHANGED env variable which point to files that when changed full CI is executed.
Implements test execution based on PR changes by integrating pytest-rally plugin's --track-filter option. Tests will now only run for tracks affected by changes in the top-level directories of the repository. - Updates test command configurations to support dynamic track filtering arguments - Adds pytest track markers to associate test classes and methods with specific tracks - Implements CI workflow changes to detect changed tracks and pass them as filter arguments - Defines RUN_FULL_CI_WHEN_CHANGED env variable which point to files that when changed full CI is executed.
Implements test execution based on PR changes by integrating pytest-rally plugin's --track-filter option. Tests will now only run for tracks affected by changes in the top-level directories of the repository. - Updates test command configurations to support dynamic track filtering arguments - Adds pytest track markers to associate test classes and methods with specific tracks - Implements CI workflow changes to detect changed tracks and pass them as filter arguments - Defines RUN_FULL_CI_WHEN_CHANGED env variable which point to files that when changed full CI is executed.
* Tests tracks selectively based on PR changes (#858) * CI builds ES revision from sources based on es-version file (#875) * Drop Python 3.9 and introduce Python 3.13 in CI (#877) * [ES-13188] Update GH macOS hosted runner image (#883) * Address pytest deprecations (#911) * CI determines Elasticsearch build arguments using unified job in gh workflow [stateful] (#925) * Fix an error where ci arguments were not applied properly (#928) * Fix an error where ci arguments were not applied properly * Test the change * Test failed retry with another fix * Previous fix failed retry * Revert es-version to current * Keep the indents if if/else * Add backport reminder and reorganize the backporting actions. (#889) * Rename IT folders (#938) * Fix pytest skip argument (#905) * Backport reminders - fix missing default values in workflow (#947) * Upgrade pip to 25.2 * Fix conflict in it_tracks * Update deprecated gh actions * Track changes for 8.19 * Fix test job which does not require the output of other jobs * Add backport reminder and reorganize the backporting actions. (#889) * Fix an error where ci arguments were not applied properly (#928) * Reduce filtering scope in CI workflow (#908) * Add pytest marker for cars * Address merge conflicts * Run serverless CI only on PRs targeting master (#859) * Accept pragma risks for joins esql * Make esql-full-text-functions a snapshot_only_challenge * Set index template for ingest_mode: data_stream (#849)
e.g. if big5/README.md was only changed in a PR, CI will now only run the test for big5 track in both stateful and serverless.
Note: This needs pytest-rally plugin updates #5 #7