Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cat gateway logs #400

Merged
merged 2 commits into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions catalyst-gateway/tests/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package-schemathesis:
ARG max_examples=1000
ARG max_response_time=200
ARG wait_for_schema=15
ARG workers=1
ARG workers=2
ARG schema_version=30
ARG openapi_spec

Expand All @@ -31,7 +31,7 @@ package-schemathesis:
test-fuzzer-api:
FROM earthly/dind:alpine-3.19
RUN apk update && apk add iptables-legacy # workaround for https://github.com/earthly/earthly/issues/3784
RUN apk add yq
RUN apk add yq zstd
ARG DB_URL="postgres://catalyst-event-dev:CHANGE_ME@localhost/CatalystEventDev"
ARG CAT_ADDRESS="127.0.0.1:3030"
ARG OPENAPI_SPEC="http://127.0.0.1:3030/docs/cat-gateway.json"
Expand All @@ -46,21 +46,19 @@ test-fuzzer-api:
--service cat-gateway \
--allow-privileged
RUN docker run --net=host --name=st schemathesis:latest || echo fail > fail && \
docker logs cat-gateway > ./cat-gateway.log && \
docker logs cat-gateway > ./cat-gateway.log && zstd -9 cat-gateway.log && \
docker cp st:/results/junit-report.xml junit-report.xml && \
docker cp st:/results/cassette.yaml cassette.yaml
END
WAIT
SAVE ARTIFACT junit-report.xml AS LOCAL schemathesis.junit-report.xml
SAVE ARTIFACT cat-gateway.log AS LOCAL cat-gateway.log
SAVE ARTIFACT cat-gateway.log.zst AS LOCAL cat-gateway.log.zst
SAVE ARTIFACT cassette.yaml AS LOCAL cassette.yaml
END
IF [ -f fail ]
RUN echo -e "\033[0;31mSchemathesis test run failed\n" && \
RUN echo -e "\033[0;31mSchemathesis test run failed. Run the test locally to get Catalyst Gateway logs\n" && \
echo -e "\033[0;31mFailed tests:" && \
yq -PC '.http_interactions.[] | select(.status == "FAILURE")' cassette.yaml && \
echo -e "\033[0;31mCatalyst Gateway logs:" && \
jq --color-output . cat-gateway.log cat-gateway.log && \
exit 1
END

Expand Down
Loading