Skip to content

Comments

Tests tracks selectively based on PR changes#858

Merged
NickDris merged 20 commits intomasterfrom
selective-tests
Oct 3, 2025
Merged

Tests tracks selectively based on PR changes#858
NickDris merged 20 commits intomasterfrom
selective-tests

Conversation

@NickDris
Copy link
Contributor

@NickDris NickDris commented Sep 17, 2025

  • Test will now use the --track-filter options from pytest-rally plugin in order to run tests only on selected tracks of the repo based on the changes introduced by the PRs.
  • Changes are tracked on the topmost level folders.

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

@NickDris NickDris requested a review from Copilot September 17, 2025 06:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@NickDris NickDris requested a review from a team September 17, 2025 06:28
Copy link
Contributor

@gbanasiak gbanasiak left a comment

Choose a reason for hiding this comment

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

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.

@NickDris
Copy link
Contributor Author

@elasticmachine update branch

elasticmachine and others added 5 commits September 22, 2025 16:14
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.
@NickDris NickDris requested a review from gbanasiak September 23, 2025 16:15
@NickDris NickDris self-assigned this Sep 23, 2025
@NickDris NickDris requested review from a team and removed request for a team September 25, 2025 14:21
@NickDris NickDris requested a review from gbanasiak October 1, 2025 17:53
NickDris added a commit that referenced this pull request Oct 6, 2025
Run full CI If there are no file differences 
between HEAD and master branch
@NickDris
Copy link
Contributor Author

NickDris commented Oct 6, 2025

I will be testing more things before backporting to the correct version

NickDris added a commit to NickDris/rally-tracks that referenced this pull request Oct 7, 2025
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.
NickDris added a commit to NickDris/rally-tracks that referenced this pull request Oct 7, 2025
* 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.
NickDris added a commit to NickDris/rally-tracks that referenced this pull request Oct 7, 2025
* 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.
@NickDris NickDris added the v9.2 label Oct 7, 2025
@esbenchmachine
Copy link
Collaborator

💔 All backports failed

Status Branch Result
8.15 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

backport --pr 858

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

NickDris added a commit that referenced this pull request Oct 7, 2025
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.
NickDris added a commit that referenced this pull request Oct 7, 2025
Run full CI If there are no file differences 
between HEAD and master branch
@esbenchmachine
Copy link
Collaborator

💔 All backports failed

Status Branch Result
9.2 An unhandled error occurred. Please see the logs for details

Manual backport

To create the backport manually run:

backport --pr 858

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

@NickDris NickDris added v9.2 and removed v9.2 labels Oct 7, 2025
@esbenchmachine
Copy link
Collaborator

💔 All backports failed

Status Branch Result
9.2 An unhandled error occurred. Please see the logs for details

Manual backport

To create the backport manually run:

backport --pr 858

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

@esbenchmachine
Copy link
Collaborator

💚 All backports created successfully

Status Branch Result
9.2

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

NickDris added a commit that referenced this pull request Oct 8, 2025
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>
gbanasiak pushed a commit to gbanasiak/rally-tracks that referenced this pull request Dec 5, 2025
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
@gbanasiak
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.15

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

gbanasiak pushed a commit to gbanasiak/rally-tracks that referenced this pull request Dec 5, 2025
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.
NickDris added a commit to NickDris/rally-tracks that referenced this pull request Dec 10, 2025
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.
NickDris added a commit that referenced this pull request Dec 12, 2025
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.
NickDris added a commit to NickDris/rally-tracks that referenced this pull request Dec 18, 2025
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.
NickDris added a commit that referenced this pull request Dec 20, 2025
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants