mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 00:18:11 +01:00
[CI] Run all tests when a base test changes (#7010)
This commit is contained in:
parent
582386d3a2
commit
83f9664efb
1 changed files with 7 additions and 2 deletions
|
@ -140,7 +140,10 @@ def get_components(files: list[str], get_dependencies: bool = False):
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-c", "--changed", action="store_true", help="Only run on changed files"
|
"-c",
|
||||||
|
"--changed",
|
||||||
|
action="store_true",
|
||||||
|
help="List all components required for testing based on changes",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-b", "--branch", help="Branch to compare changed files against"
|
"-b", "--branch", help="Branch to compare changed files against"
|
||||||
|
@ -158,7 +161,9 @@ def main():
|
||||||
changed = changed_files(args.branch)
|
changed = changed_files(args.branch)
|
||||||
else:
|
else:
|
||||||
changed = changed_files()
|
changed = changed_files()
|
||||||
files = [f for f in files if f in changed]
|
# If any base test file(s) changed, there's no need to filter out components
|
||||||
|
if not any("tests/test_build_components" in file for file in changed):
|
||||||
|
files = [f for f in files if f in changed]
|
||||||
|
|
||||||
for c in get_components(files, args.changed):
|
for c in get_components(files, args.changed):
|
||||||
print(c)
|
print(c)
|
||||||
|
|
Loading…
Reference in a new issue