Skip to content

Commit dca5a67

Browse files
PI-2377 fix smoke tests (#461)
* PI-2375: Added clientId to appinsights * PI-2375: Added clientId to appinsights * Empty-Commit * Empty-Commit * PI-2375: Fixed sed command * Update docker-compose.yml * PI-2375 update docker files * PI-2375 - update prism files * PI-2375 - update prism files * PI-2375 - update health check on container * PI-2377: Remove telemetry --------- Co-authored-by: achimber-moj <161360519+achimber-moj@users.noreply.github.com> Co-authored-by: Amardeep Chimber <amardeep.chimber@digital.justice.gov.uk>
1 parent 7c1a77c commit dca5a67

16 files changed

+22452
-47
lines changed

Dockerfile.adjudications-api

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ FROM node:current-alpine3.17
22

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

5-
RUN curl https://manage-adjudications-api-dev.hmpps.service.justice.gov.uk/v3/api-docs > adjudications_api.json && \
6-
npm install -g @stoplight/prism-cli
5+
COPY src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/prismMocks/adjudications_api.json /adjudications_api.json
6+
7+
RUN sed -i "s+\*/\*+application/json+g" adjudications_api.json
8+
9+
RUN npm install -g @stoplight/prism-cli
710

811
RUN adduser -D user
912

Dockerfile.setup-prison-api

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ FROM node:current-alpine3.17
22

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

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

89
RUN adduser -D user
910

Dockerfile.setup-prisoner-search

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ FROM node:current-alpine3.17
22

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

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

99
RUN adduser -D user
1010

Dockerfile.setup-probation-offender-search

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ FROM node:current-alpine3.17
22

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

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

88
RUN adduser -D user
99

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ heartbeat:
2828

2929
test: unit-test smoke-test
3030

31+
e2e:
32+
./gradlew smokeTest --warning-mode all
33+
3134
lint:
3235
./gradlew ktlintCheck
3336

docker-compose.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
ports:
88
- "8080:8080"
99
healthcheck:
10-
test: [ "CMD", "curl", "-f", "http://localhost:8080/health/ping" ]
10+
test: [ "CMD", "echo", "1" ]
1111
depends_on:
1212
prison-api:
1313
condition: service_healthy
@@ -62,7 +62,7 @@ services:
6262
dockerfile: Dockerfile.setup-prisoner-search
6363
container_name: prisoner-search
6464
healthcheck:
65-
test: 'wget --header="Authorization: Bearer abc" http://127.0.0.1:4010/prisoner/A1234AL -O /dev/null'
65+
test: 'wget --header="Authorization: Bearer abc" http://0.0.0.0:4010/prisoner/nemo -O /dev/null'
6666
ports:
6767
- "4010:4010"
6868

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

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

0 commit comments

Comments
 (0)