Lines Matching +full:repo +full:- +full:path
2 # SPDX-License-Identifier: Apache-2.0
16 from pathlib import Path
17 from git import Repo
29 # however, pylint complains that it doesn't recognized them when used (used-before-assignment).
30 zephyr_base = Path(os.environ['ZEPHYR_BASE'])
32 repo_to_scan = Repo(zephyr_base)
37 sys.path.append(os.path.join(zephyr_base, 'scripts'))
67 # The glob regexes must anchor to the beginning of the path, since we
68 # return search(). (?:) is a non-capturing group.
92 def _contains(self, path): argument
93 # Returns True if the area contains 'path', and False otherwise
95 return self._match_fn and self._match_fn(path) and not \
96 (self._exclude_match_fn and self._exclude_match_fn(path))
130 cmd = [f"{zephyr_base}/scripts/twister", "-c"] + options + ["--save-tests", fname ]
132 cmd += ["--no-detailed-test-id"]
135 cmd+=["-T", root]
137 cmd.append("--integration")
140 cmd += ["--quarantine-list", q]
148 if os.path.exists(fname):
155 old_manifest_content = repo_to_scan.git.show(f"{args.commits[:-2]}:west.yml")
166 old_projs - new_projs))
169 new_projs - old_projs))
171 aprojs = new_projs - old_projs - uprojs
184 _options.extend(["-t", p ])
188 _options.extend(["-p", platform])
209 _options.extend(["-a", arch ])
215 _options.extend(["-p", platform])
246 for file in glob.glob(os.path.join(board.dir, f"{board.name}*.yaml")):
266 _options.extend(["-p", board ])
277 d = os.path.dirname(f)
280 head, tail = os.path.split(d)
281 if os.path.exists(os.path.join(d, "testcase.yaml")) or \
282 os.path.exists(os.path.join(d, "sample.yaml")):
294 tests.add(os.path.dirname(yaml))
298 d = os.path.dirname(d)
300 d = os.path.dirname(d)
304 _options.extend(["-T", t ])
315 _options.extend(["-p", platform])
329 # tag._match_fn(path) tests if the path matches files and/or
330 # files-regex
331 tag._match_fn = _get_match_fn(x.get("files"), x.get("files-regex"))
333 # Like tag._match_fn(path), but for files-exclude and
334 # files-regex-exclude
336 _get_match_fn(x.get("files-exclude"), x.get("files-regex-exclude"))
351 self.tag_options.extend(["-e", tag ])
380 _options.extend(["-p", platform])
394 parser.add_argument('-c', '--commits', default=None,
396 parser.add_argument('-m', '--modified-files', default=None,
398 parser.add_argument('-o', '--output-file', default="testplan.json",
400 parser.add_argument('-P', '--pull-request', action="store_true",
402 parser.add_argument('-p', '--platform', action="append",
404 parser.add_argument('-t', '--tests_per_builder', default=700, type=int,
406 parser.add_argument('-n', '--default-matrix', default=10, type=int,
408 parser.add_argument('--testcase-roots-threshold', default=20, type=int,
411 parser.add_argument('--detailed-test-id', action='store_true',
413 parser.add_argument("--no-detailed-test-id", dest='detailed_test_id', action="store_false",
415 parser.add_argument('-r', '--repo-to-scan', default=None,
416 help="Repo to scan")
417 parser.add_argument('--ignore-path',
418 default=os.path.join(zephyr_base, 'scripts', 'ci', 'twister_ignore.txt'),
419 help="Path to a text file with patterns of files to be matched against changed files")
420 parser.add_argument('--alt-tags',
421 default=os.path.join(zephyr_base, 'scripts', 'ci', 'tags.yaml'),
422 help="Path to a file describing relations between directories and tags")
424 "-T", "--testsuite-root", action="append", default=[],
430 "--quarantine-list", action="append", metavar="FILENAME",
448 repository_path = Path(args.repo_to_scan)
449 repo_to_scan = Repo(repository_path)
451 commit = repo_to_scan.git.diff("--name-only", args.commits)