Skip to content

Commit

Permalink
[ci][microcheck] include step id from all step job flavors
Browse files Browse the repository at this point in the history
Signed-off-by: can <[email protected]>
  • Loading branch information
can-anyscale committed May 17, 2024
1 parent 8f9bea8 commit 2d47231
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
15 changes: 12 additions & 3 deletions release/ray_release/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,19 @@ def gen_high_impact_tests(cls, prefix: str) -> Dict[str, List]:
]
step_id_to_tests = {}
for test in high_impact_tests:
step_id = test.get_test_results(limit=1)[0].rayci_step_id
if not step_id:
recent_results = test.get_test_results()
if not recent_results:
continue
step_id_to_tests[step_id] = step_id_to_tests.get(step_id, []) + [test]
recent_commit = recent_results[0].commit
for result in recent_results:
# consider all results with the same recent commit; this is to make sure
# we will include different job flavors of the same test
if result.commit != recent_commit:
continue
step_id = result.rayci_step_id
if not step_id:
continue
step_id_to_tests[step_id] = step_id_to_tests.get(step_id, []) + [test]

return step_id_to_tests

Expand Down
15 changes: 9 additions & 6 deletions release/ray_release/tests/test_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ def _stub_test(val: dict) -> Test:


def _stub_test_result(
status: ResultStatus = ResultStatus.SUCCESS, rayci_step_id="123"
status: ResultStatus = ResultStatus.SUCCESS, rayci_step_id="123", commit="456"
) -> TestResult:
return TestResult(
status=status.value,
commit="1234567890",
commit=commit,
branch="master",
url="url",
timestamp=0,
Expand Down Expand Up @@ -340,7 +340,7 @@ def gen_high_impact_tests(mock_gen_from_s3) -> None:
"name": "core_test",
Test.KEY_IS_HIGH_IMPACT: "false",
"test_results": [
_stub_test_result(rayci_step_id="corebuild"),
_stub_test_result(rayci_step_id="corebuild", commit="123"),
],
}
)
Expand All @@ -349,7 +349,9 @@ def gen_high_impact_tests(mock_gen_from_s3) -> None:
"name": "data_test_01",
Test.KEY_IS_HIGH_IMPACT: "true",
"test_results": [
_stub_test_result(rayci_step_id="databuild"),
_stub_test_result(rayci_step_id="databuild", commit="123"),
_stub_test_result(rayci_step_id="data15build", commit="123"),
_stub_test_result(rayci_step_id="data12build", commit="456"),
],
}
)
Expand All @@ -358,15 +360,16 @@ def gen_high_impact_tests(mock_gen_from_s3) -> None:
"name": "data_test_02",
Test.KEY_IS_HIGH_IMPACT: "true",
"test_results": [
_stub_test_result(rayci_step_id="databuild"),
_stub_test_result(rayci_step_id="databuild", commit="321"),
],
}
)

mock_gen_from_s3.return_value = [core_test, data_test_01, data_test_02]

assert Test.gen_high_impact_tests("linux") == {
"databuild": [data_test_01, data_test_02]
"databuild": [data_test_01, data_test_02],
"data15build": [data_test_01],
}


Expand Down

0 comments on commit 2d47231

Please sign in to comment.