TIAF script fixes (#3044)

* Fix typo in MARS document key.

Signed-off-by: John <jonawals@amazon.com>

* Add diff support for commits on different branches.

Signed-off-by: John <jonawals@amazon.com>

* Restore archiving of historic data objects.

Signed-off-by: John <jonawals@amazon.com>

* Correctly handle commit diffs for PR builds.

Signed-off-by: John <jonawals@amazon.com>

* Comment out archiving of historic data objects.

Signed-off-by: John <jonawals@amazon.com>

* Fix python typo

Signed-off-by: John <jonawals@amazon.com>

* Remove comment pertaining to s3 bucket.

Signed-off-by: John <jonawals@amazon.com>

* Fix test selection efficiency for MARS.

Signed-off-by: John <jonawals@amazon.com>
This commit is contained in:
jonawals
2021-08-12 10:21:33 +01:00
committed by GitHub
parent c410f1385c
commit f4e8ecd35e
4 changed files with 41 additions and 14 deletions
@@ -15,7 +15,7 @@ logger = get_logger(__file__)
MARS_JOB_KEY = "job"
SRC_COMMIT_KEY = "src_commit"
DST_COMMIT_KEY = "src_commit"
DST_COMMIT_KEY = "dst_commit"
COMMIT_DISTANCE_KEY = "commit_distance"
SRC_BRANCH_KEY = "src_branch"
DST_BRANCH_KEY = "dst_branch"
@@ -318,7 +318,7 @@ def generate_mars_sequence(sequence_report: dict, mars_job: dict, change_list:di
test_run_selection = {}
test_run_selection[SELECTED_KEY] = generate_mars_test_run_selections(sequence_report[SELECTED_TEST_RUNS_KEY], sequence_report[SELECTED_TEST_RUN_REPORT_KEY], t0_timestamp)
if sequence_report[SEQUENCE_TYPE_KEY] == IMPACT_ANALYSIS_SEQUENCE_TYPE_KEY or sequence_report[SEQUENCE_TYPE_KEY] == SAFE_IMPACT_ANALYSIS_SEQUENCE_TYPE_KEY:
total_test_runs = sequence_report[TOTAL_NUM_TEST_RUNS_KEY]
total_test_runs = sequence_report[TOTAL_NUM_TEST_RUNS_KEY] + len(sequence_report[DISCARDED_TEST_RUNS_KEY])
if total_test_runs > 0:
test_run_selection[SELECTED_KEY][EFFICIENCY_KEY] = (1.0 - (test_run_selection[SELECTED_KEY][TOTAL_NUM_TEST_RUNS_KEY] / total_test_runs)) * 100
else: