diff options
-rwxr-xr-x | scripts/yocto_testresults_query.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/yocto_testresults_query.py b/scripts/yocto_testresults_query.py index 3b478822dc..3df9d6015f 100755 --- a/scripts/yocto_testresults_query.py +++ b/scripts/yocto_testresults_query.py | |||
@@ -30,9 +30,13 @@ def create_workdir(): | |||
30 | return workdir | 30 | return workdir |
31 | 31 | ||
32 | def get_sha1(pokydir, revision): | 32 | def get_sha1(pokydir, revision): |
33 | rev = subprocess.check_output(["git", "rev-list", "-n", "1", revision], cwd=pokydir).decode('utf-8').strip() | 33 | try: |
34 | logger.info(f"SHA-1 revision for {revision} in {pokydir} is {rev}") | 34 | rev = subprocess.check_output(["git", "rev-list", "-n", "1", revision], cwd=pokydir).decode('utf-8').strip() |
35 | return rev | 35 | logger.info(f"SHA-1 revision for {revision} in {pokydir} is {rev}") |
36 | return rev | ||
37 | except subprocess.CalledProcessError: | ||
38 | logger.error(f"Can not find SHA-1 for {revision} in {pokydir}") | ||
39 | return None | ||
36 | 40 | ||
37 | def fetch_testresults(workdir, sha1): | 41 | def fetch_testresults(workdir, sha1): |
38 | logger.info(f"Fetching test results for {sha1} in {workdir}") | 42 | logger.info(f"Fetching test results for {sha1} in {workdir}") |
@@ -65,6 +69,11 @@ def regression(args): | |||
65 | try: | 69 | try: |
66 | baserevision = get_sha1(poky_path, args.base) | 70 | baserevision = get_sha1(poky_path, args.base) |
67 | targetrevision = get_sha1(poky_path, args.target) | 71 | targetrevision = get_sha1(poky_path, args.target) |
72 | if not baserevision or not targetrevision: | ||
73 | logger.error("One or more revision(s) missing. You might be targeting nonexistant tags/branches, or are in wrong repository (you must use Poky and not oe-core)") | ||
74 | if not args.testresultsdir: | ||
75 | subprocess.check_call(["rm", "-rf", workdir]) | ||
76 | sys.exit(1) | ||
68 | fetch_testresults(workdir, baserevision) | 77 | fetch_testresults(workdir, baserevision) |
69 | fetch_testresults(workdir, targetrevision) | 78 | fetch_testresults(workdir, targetrevision) |
70 | report = compute_regression_report(workdir, baserevision, targetrevision) | 79 | report = compute_regression_report(workdir, baserevision, targetrevision) |