Skip to content

Commit 6287561

Browse files
authored
Run contract tests in pr- and main- build workflows (#54)
In this PR, we are adding contract test runs to the pr-build and main-build, following suit with ADOT Java's [pr-build](https://github.com/aws-observability/aws-otel-java-instrumentation/blob/61460af22255d5963df17c77a37ef71ff6f652d8/.github/workflows/pr-build.yml#L90) and [main-build](https://github.com/aws-observability/aws-otel-java-instrumentation/blob/61460af22255d5963df17c77a37ef71ff6f652d8/.github/workflows/main-build.yml#L184). Like in Java, we are running these steps after building and pushing artifacts so we can debug more effectively, if needed. Unlike Java, we are not separating into separate jobs, as there is no clear benefit to doing this, as it just incurs overhead of checking out and building code. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent 82f4767 commit 6287561

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/workflows/main_build.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,10 @@ jobs:
7676
name: aws_opentelemetry_distro-${{ steps.python_output.outputs.ADOT_PYTHON_VERSION}}-py3-none-any.whl
7777
path: dist/${{ steps.staging_wheel_output.outputs.STAGING_WHEEL}}
7878

79-
# TODO: Add Contract test and E2E test
79+
- name: Set up and run contract tests with pytest
80+
run: |
81+
bash contract-tests/set-up-contract-tests.sh
82+
pip install pytest
83+
pytest contract-tests/tests
84+
85+
# TODO: Add E2E tests

.github/workflows/pr_build.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,8 @@ jobs:
4444
- name: run spell check tox
4545
run: tox -e ${{ matrix.tox-environment }}
4646

47-
# TODO: Add Contract test.
47+
- name: Set up and run contract tests with pytest
48+
run: |
49+
bash contract-tests/set-up-contract-tests.sh
50+
pip install pytest
51+
pytest contract-tests/tests

0 commit comments

Comments
 (0)