Skip to content

improve tests selection #11721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 22, 2024
Merged

improve tests selection #11721

merged 2 commits into from
Oct 22, 2024

Conversation

cloutierMat
Copy link
Contributor

@cloutierMat cloutierMat commented Oct 21, 2024

Motivation

This PR aims to expand on the functionality of the Matcher for tests selection. The changes included will allow us to use the directory method to add an argument for which directory should be executed.

Changes

We can now enter the following rule to explicitly target test folders when files in my_feature modules are changed.

Matchers.glob("localstack/my_feature/**").directory(
    paths=["tests/integration/my_feature"]
)

Copy link

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 42m 25s ⏱️ +33s
3 509 tests ±0  3 096 ✅ ±0  413 💤 ±0  0 ❌ ±0 
3 511 runs  ±0  3 096 ✅ ±0  415 💤 ±0  0 ❌ ±0 

Results for commit 2fe2d5f. ± Comparison against base commit 7fe55a1.

@cloutierMat cloutierMat self-assigned this Oct 21, 2024
@cloutierMat cloutierMat added area: ci Running LocalStack in CI environments semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases labels Oct 21, 2024
@cloutierMat cloutierMat added this to the 4.0 milestone Oct 21, 2024
@cloutierMat cloutierMat marked this pull request as ready for review October 21, 2024 22:47
Copy link
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

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

Nice enhancement to the matcher functionality! It's great to see this tooling being enhanced to match new requirements! 💯
I added two nits, they shouldn't be blocking a merge if you need to move fast though.

Comment on lines 96 to 97
def directory(self, paths: list[str] = None):
return lambda t: (paths or [get_directory(t)]) if self.matching_func(t) else []
Copy link
Member

Choose a reason for hiding this comment

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

nits:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, I will write some tests and documentation for it.

@cloutierMat cloutierMat merged commit 56e0b77 into master Oct 22, 2024
28 of 30 checks passed
@cloutierMat cloutierMat deleted the replicator/add-test-selection branch October 22, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ci Running LocalStack in CI environments semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants