Skip to content

Commit

Permalink
Moved codebuild waiter tests to unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ckunki committed Apr 2, 2024
1 parent d676d3c commit 03a9ace
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ def batch_get_builds(ids: List[int]):
@pytest.mark.parametrize("interval", list(range(1, 5)))
def test_code_build_waiter_success(interval):
codebuild_mock = codebuild_client(
build_duration=ms(200),
build_duration=ms(50),
finish_status="SUCCEEDED",
)
waiter = CodeBuildWaiter(codebuild_mock, BUILD_ID)
waiter.wait(timeout=ms(300), interval=ms(interval*50))
waiter.wait(timeout=ms(100), interval=ms(interval*30))


@pytest.mark.parametrize("interval", list(range(1, 3)))
def test_code_build_waiter_timeout(interval):
codebuild_mock = codebuild_client(
build_duration=ms(200),
build_duration=ms(100),
finish_status="SUCCEEDED",
)
waiter = CodeBuildWaiter(codebuild_mock, BUILD_ID)
with pytest.raises(TimeoutError, match=f"Build {BUILD_ID} ran into timeout."):
waiter.wait(timeout=ms(150), interval=ms(interval*40))
waiter.wait(timeout=ms(80), interval=ms(interval*20))


@pytest.mark.parametrize("error_status", ['FAILED', 'FAULT', 'STOPPED', 'TIMED_OUT'])
Expand Down

0 comments on commit 03a9ace

Please sign in to comment.