Skip to content

Commit

Permalink
fix: Improvements for testing (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
claytonparnell authored Mar 19, 2024
1 parent 41790a1 commit 4f15658
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
role-to-assume: ${{ secrets.START_CODEBUILD_ROLE }}
aws-region: us-east-1
# CodeBuild timeout of 8 hours
role-duration-seconds: 3840
role-duration-seconds: 28800
audience: https://sts.us-east-1.amazonaws.com
- name: Run CodeBuild
uses: dark-mechanicum/aws-codebuild@v1
Expand Down
9 changes: 7 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,16 @@ def _push_images_upstream(image_versions_to_push: list[dict[str, str]], region:

def _test_local_images(image_ids_to_test: list[str], target_version: str):
assert len(image_ids_to_test) == len(_image_generator_configs)
exit_codes = []
image_ids = []
for (image_id, config) in zip(image_ids_to_test, _image_generator_configs):
exit_code = pytest.main(['-n', 'auto', '-m', config['image_type'], '--local-image-version',
exit_code = pytest.main(['-n', '2', '-m', config['image_type'], '--local-image-version',
target_version, *config['pytest_flags']])
if exit_code != 0:
exit_codes.append(exit_code)
image_ids.append(image_id)

assert exit_code == 0, f'Tests failed with exit code: {exit_code} against: {image_id}'
assert len(exit_codes) == 0, f'Tests failed with exit codes: {exit_codes} against: {image_ids}'

print(f'Tests ran successfully against: {image_ids_to_test}')

Expand Down

0 comments on commit 4f15658

Please sign in to comment.