ci: testplan: error out if we find mis-configured tests

If we find errors during test plan creation, stop execution and report
out the issues.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2022-10-12 20:21:26 -04:00
parent cc7d337ea7
commit d8197f7535
1 changed files with 6 additions and 2 deletions

View File

@ -316,6 +316,7 @@ if __name__ == "__main__":
args = parse_args()
files = []
errors = 0
if args.commits:
repo = Repo(repository_path)
commit = repo.git.diff("--name-only", args.commits)
@ -342,11 +343,12 @@ if __name__ == "__main__":
n = ts.get("name")
a = ts.get("arch")
p = ts.get("platform")
if ts.get('status') == 'error':
logging.info(f"Error found: {n} on {p} ({ts.get('reason')})")
errors += 1
if (n, a, p,) not in dup_free_set:
dup_free.append(ts)
dup_free_set.add((n, a, p,))
else:
logging.info(f"skipped {n} on {p}")
logging.info(f'Total tests to be run: {len(dup_free)}')
with open(".testplan", "w") as tp:
@ -376,3 +378,5 @@ if __name__ == "__main__":
data['testsuites'] = dup_free
with open(args.output_file, 'w', newline='') as json_file:
json.dump(data, json_file, indent=4, separators=(',',':'))
sys.exit(errors)