Skip to content

Commit

Permalink
second part
Browse files Browse the repository at this point in the history
  • Loading branch information
dtuchs committed Oct 17, 2024
1 parent de3272d commit 6f65c71
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,23 @@ jobs:
- name: Build back
run: |
./gradlew jibDockerBuild -x :rococo-e2e:test
docker image ls
docker image ls
- name: Pull browsers
run: |
docker pull selenoid/vnc_chrome:125.0
- name: Run tests
id: e2e-test
run: |
docker compose -f docker-compose-e2e.yml up -d
docker wait rococo-e2e
exit_code=$(docker inspect -f '{{.State.ExitCode}}' rococo-e2e)
echo "e2e_exit_code=$exit_code" >> $GITHUB_OUTPUT
docker logs rococo-e2e
docker compose -f docker-compose-e2e.yml down
if ["$exit_code" -eq "0"]; then
echo "Tests passed!"
exit 0
else
echo "Tests failed!"
exit 1
fi
86 changes: 86 additions & 0 deletions docker-compose-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
services:
rococo-db:
container_name: rococo-db
image: mysql:8.3.0
environment:
- MYSQL_ROOT_PASSWORD=secret
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 5s
timeout: 5s
retries: 5
ports:
- 3306:3306
networks:
- rococo-network
dns_search: .

auth.rococo.dc:
container_name: auth.rococo.dc
image: dtuchs/rococo-auth:latest
ports:
- 9000:9000
restart: always
depends_on:
rococo-db:
condition: service_started
networks:
- rococo-network
dns_search: .

api.rococo.dc:
container_name: api.rococo.dc
image: dtuchs/rococo-api:latest
ports:
- 8080:8080
restart: always
depends_on:
auth.rococo.dc:
condition: service_started
networks:
- rococo-network
dns_search: .

client.rococo.dc:
container_name: client.rococo.dc
image: dtuchs/rococo-client:latest
build:
context: ./rococo-client
dockerfile: ./Dockerfile
ports:
- 80:80
depends_on:
api.rococo.dc:
condition: service_started
networks:
- rococo-network

rococo-e2e:
container_name: rococo-e2e
image: dtuchs/rococo-e2e:latest
build:
context: ./
dockerfile: ./rococo-e2e/Dockerfile
depends_on:
client.rococo.dc:
condition: service_started
networks:
- rococo-network

selenoid:
container_name: selenoid
image: aerokube/selenoid:1.11.2
platform: linux/${ARCH}
volumes:
- ./selenoid:/etc/selenoid
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
command: [ "-conf", "/etc/selenoid/browsers.json", "-limit", "2", "-video-output-dir", "/opt/selenoid/video", "-log-output-dir", "/opt/selenoid/logs", "-container-network", "heisenbug-2023-autumn_rococo-network" ]
ports:
- 4444:4444
networks:
- rococo-network

networks:
rococo-network:
driver: bridge
11 changes: 11 additions & 0 deletions rococo-e2e/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM eclipse-temurin:21-jdk

WORKDIR /heisenbug-2023-autumn
COPY ./gradle ./gradle
COPY ./rococo-e2e ./rococo-e2e
COPY ./gradlew ./
COPY ./build.gradle ./
COPY ./settings.gradle ./
COPY ./gradle.properties ./

CMD ./gradlew clean test -Dtest.env=docker

0 comments on commit 6f65c71

Please sign in to comment.