renderdiff: fix upload issue second try (#8972)

- Move upload step to later so that comparison result is also
    included in the upload
 - Fix the wrong relative paths in the comparison_result.json
 - Fix viewer logic to pick only the latest run for a PR.
This commit is contained in:
Powei Feng
2025-07-22 11:47:18 -07:00
committed by GitHub
parent 2abacaa030
commit b129e5df4a
3 changed files with 31 additions and 14 deletions

View File

@@ -45,8 +45,8 @@ def _compare_goldens(base_dir, comparison_dir, out_dir=None):
output_fname = os.path.join(output_test_dir, "compare_results.json")
results_meta = {
'results': results,
'base_dir': os.path.relpath(output_test_dir, base_test_dir),
'comparison_dir': os.path.relpath(output_test_dir, comp_test_dir),
'base_dir': os.path.relpath(base_test_dir, output_test_dir),
'comparison_dir': os.path.relpath(comp_test_dir, output_test_dir)
}
with open(output_fname, 'w') as f:
f.write(json.dumps(results_meta, indent=2))