twister: do not modify testplan on subsequent runs

Do not modify testplan.json if it already exists. Testplan is only
created once and any work in the same worskpace should not change it.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2022-07-12 15:16:54 -04:00 committed by Carles Cufí
commit a0c3bdafbf

View file

@ -332,7 +332,9 @@ def main():
return 0 return 0
report = Reporting(tplan, env) report = Reporting(tplan, env)
report.json_report(os.path.join(options.outdir, "testplan.json")) plan_file = os.path.join(options.outdir, "testplan.json")
if not os.path.exists(plan_file):
report.json_report(plan_file)
if options.save_tests: if options.save_tests:
report.json_report(options.save_tests) report.json_report(options.save_tests)