-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
22 additions
and
90 deletions.
There are no files selected for viewing
85 changes: 0 additions & 85 deletions
85
localstack-core/localstack/testing/testselection/opt_in.py
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
localstack-core/localstack/testing/testselection/opt_out.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import fnmatch | ||
from typing import Iterable | ||
|
||
OPT_OUT = [] | ||
|
||
|
||
def opted_out(changed_files: list[str], opt_out: Iterable[str] | None = None) -> bool: | ||
""" | ||
Do not perform test selection if at least one file is opted out | ||
:param changed_files: List of changed file paths | ||
:param opt_out: Iterable of globs to match the changed files against. Defaults to the rules defined in OPT_OUT | ||
:return: True if any changed file matches at least one glob, False otherwise | ||
""" | ||
if opt_out is None: | ||
opt_out = OPT_OUT | ||
|
||
return any(any(fnmatch.fnmatch(cf, glob) for glob in opt_out) for cf in changed_files) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters