Skip to content

Commit

Permalink
tmp: run ci
Browse files Browse the repository at this point in the history
  • Loading branch information
snamiki1212 committed Dec 28, 2023
1 parent 855f3a7 commit 1f0d569
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /app
COPY . .

# Define Healthcheck fot the container
HEALTHCHECK --interval=5s --timeout=5s --start-period=5s --retries=20 CMD [ "curl","http://0.0.0.0:8080/api/healthcheck" ]
# HEALTHCHECK --interval=5s --timeout=5s --start-period=5s --retries=20 CMD [ "curl","http://0.0.0.0:8080/api/healthcheck" ]

# Upgrade the system and install dependencies for PostgreSQL
RUN apt-get update && \
Expand Down
16 changes: 8 additions & 8 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ services:
container_name: app
build: .
command: 'bash -c "diesel setup && cargo watch --exec run"'
healthcheck:
test: ["CMD", "curl", "http://app:8080/api/healthcheck"]
interval: 5s
timeout: 5s
retries: 100
start_period: 30s
# healthcheck:
# test: ["CMD", "curl", "http://app:8080/api/healthcheck"]
# interval: 5s
# timeout: 5s
# retries: 100
# start_period: 30s
volumes:
- .:/app
depends_on:
Expand Down Expand Up @@ -40,12 +40,12 @@ services:
dockerfile: "Dockerfile_tester"
environment:
- APIURL=http://app:8080/api
command: sh ./e2e/run-api-tests.sh
command: ["sh", "./e2e/run-api-tests.sh"]
volumes:
- .:/app
depends_on:
app:
condition: service_healthy
condition: service_started
networks:
- network_for_test
profiles: ["test_e2e"]
Expand Down
12 changes: 10 additions & 2 deletions e2e/run-api-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ EMAIL=${EMAIL:-$USERNAME@mail.com}
PASSWORD=${PASSWORD:-password}

# Show env
echo "showing env..."
echo "Showing env..."
echo "APIURL=$APIURL"
echo "USERNAME=$USERNAME"
echo "EMAIL=$EMAIL"
Expand All @@ -18,8 +18,16 @@ echo "PASSWORD=$PASSWORD"
# Ready for E2E
npm install -g newman

# Wait for API
echo "Wait until app is ready..."
sh ./wait-for-it.sh http://app:8080 --timeout=120 --strict -- echo "Waked up container"

# check
echo "Running healthcheck..."
curl ${APIURL}/healthcheck

# Run E2E test
echo "running e2e..."
echo "Running e2e..."
npx newman run ./e2e/Conduit.postman_collection.json \
--delay-request 500 \
--global-var "APIURL=$APIURL" \
Expand Down
File renamed without changes.

0 comments on commit 1f0d569

Please sign in to comment.