Skip to content

Commit

Permalink
NOISSUE - Add property based testing to bootstrap API (#2095)
Browse files Browse the repository at this point in the history
Signed-off-by: Rodney Osodo <[email protected]>
  • Loading branch information
rodneyosodo authored Apr 12, 2024
1 parent cdf18dc commit 3d06787
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 149 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ env:
THINGS_URL: http://localhost:9000
INVITATIONS_URL: http://localhost:9020
AUTH_URL: http://localhost:8189
BOOTSTRAP_URL: http://localhost:9013

jobs:
api-test:
Expand All @@ -50,7 +51,7 @@ jobs:
run: make all -j $(nproc) && make dockers_dev -j $(nproc)

- name: Start containers
run: make run up args="-d" && sleep 10
run: make run up args="-d" && make run_addons up args="-d"

- name: Set access token
run: |
Expand Down Expand Up @@ -159,6 +160,16 @@ jobs:
report: false
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --contrib-openapi-formats-uuid --hypothesis-suppress-health-check=filter_too_much --stateful=links'

- name: Run Bootstrap API tests
if: steps.changes.outputs.bootstrap == 'true'
uses: schemathesis/action@v1
with:
schema: api/openapi/bootstrap.yml
base-url: ${{ env.BOOTSTRAP_URL }}
checks: all
report: false
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --contrib-openapi-formats-uuid --hypothesis-suppress-health-check=filter_too_much --stateful=links'

- name: Stop containers
if: always()
run: make run down args="-v"
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ test_api_users: TEST_API_URL := http://localhost:9002
test_api_things: TEST_API_URL := http://localhost:9000
test_api_invitations: TEST_API_URL := http://localhost:9020
test_api_auth: TEST_API_URL := http://localhost:8189
test_api_bootstrap: TEST_API_URL := http://localhost:9013

$(TEST_API):
$(call test_api_service,$(@),$(TEST_API_URL))
Expand Down
Loading

0 comments on commit 3d06787

Please sign in to comment.