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

PI-2377 fix smoke tests #461

Merged
merged 11 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions Dockerfile.adjudications-api
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ FROM node:current-alpine3.17

RUN apk update && apk add bash curl --no-cache

RUN curl https://manage-adjudications-api-dev.hmpps.service.justice.gov.uk/v3/api-docs > adjudications_api.json && \
npm install -g @stoplight/prism-cli
COPY src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/prismMocks/adjudications_api.json /adjudications_api.json

RUN sed -i "s+\*/\*+application/json+g" adjudications_api.json

RUN npm install -g @stoplight/prism-cli

RUN adduser -D user

Expand Down
5 changes: 3 additions & 2 deletions Dockerfile.setup-prison-api
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ FROM node:current-alpine3.17

RUN apk update && apk add bash curl --no-cache

RUN curl https://prison-api-dev.prison.service.justice.gov.uk/v3/api-docs > prison-api.json && \
npm install -g @stoplight/prism-cli
COPY src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/prismMocks/prison-api.json /prison-api.json
RUN sed -i 's/\*\/\*/application\/json/g' prison-api.json
RUN npm install -g @stoplight/prism-cli

RUN adduser -D user

Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.setup-prisoner-search
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ FROM node:current-alpine3.17

RUN apk update && apk add bash curl --no-cache

RUN curl https://prisoner-search-dev.prison.service.justice.gov.uk/v3/api-docs > prisoner-offender-search.json && \
sed -i "s+\*/\*+application/json+g" prisoner-offender-search.json && \
npm install -g @stoplight/prism-cli
COPY src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/prismMocks/prisoner-offender-search.json /prisoner-offender-search.json
RUN sed -i 's/\*\/\*/application\/json/g' prisoner-offender-search.json
RUN npm install -g @stoplight/prism-cli

RUN adduser -D user

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.setup-probation-offender-search
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM node:current-alpine3.17

RUN apk update && apk add bash curl --no-cache

RUN curl https://probation-offender-search-dev.hmpps.service.justice.gov.uk/v3/api-docs > probation-offender-search.json && \
npm install -g @stoplight/prism-cli
COPY src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/prismMocks/probation-offender-search.json /probation-offender-search.json
RUN npm install -g @stoplight/prism-cli

RUN adduser -D user

Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ heartbeat:

test: unit-test smoke-test

e2e:
./gradlew smokeTest --warning-mode all

lint:
./gradlew ktlintCheck

Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
ports:
- "8080:8080"
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/health/ping" ]
test: [ "CMD", "echo", "1" ]
depends_on:
prison-api:
condition: service_healthy
Expand Down Expand Up @@ -62,7 +62,7 @@ services:
dockerfile: Dockerfile.setup-prisoner-search
container_name: prisoner-search
healthcheck:
test: 'wget --header="Authorization: Bearer abc" http://127.0.0.1:4010/prisoner/A1234AL -O /dev/null'
test: 'wget --header="Authorization: Bearer abc" http://0.0.0.0:4010/prisoner/nemo -O /dev/null'
ports:
- "4010:4010"

Expand All @@ -72,7 +72,7 @@ services:
dockerfile: Dockerfile.setup-probation-offender-search
container_name: probation-offender-search
healthcheck:
test: 'wget --header="Authorization: Bearer abc" http://0.0.0.0:4010/synthetic-monitor -O /dev/null'
test: 'wget --header="Authorization: Bearer abc" http://0.0.0.0:4010/search?crn=sit -O /dev/null'
ports:
- '4020:4010'

Expand Down Expand Up @@ -102,7 +102,7 @@ services:
dockerfile: Dockerfile.adjudications-api
container_name: adjudications-api
healthcheck:
test: 'wget --header="Authorization: Bearer abc" http://0.0.0.0:4010/reported-adjudications/prisoner/123 -O /dev/null'
test: 'wget --header="Authorization: Bearer abc" http://0.0.0.0:4010/reported-adjudications/hearings?hearingDate=1916-07-16 -O /dev/null'
ports:
- '4045:4010'

Expand Down
Loading
Loading