-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(chore) O3-2516: Add docker setup to run E2E on Bamboo (#67)
Add docker setup to run E2E on Bamboo
- Loading branch information
1 parent
c29793d
commit 37d660d
Showing
7 changed files
with
113 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,7 @@ dist/ | |
|
||
# Intellij integration | ||
*.iml | ||
.idea/* | ||
|
||
# ignores for Yarn v3 w/o PNP | ||
.pnp.* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# This docker compose file is used to create a dockerized environment when running E2E tests on Bamboo. | ||
version: "3.7" | ||
|
||
services: | ||
playwright: | ||
build: | ||
context: . | ||
dockerfile: playwright.Dockerfile | ||
args: | ||
USER_ID: ${USER_ID} | ||
GROUP_ID: ${GROUP_ID} | ||
container_name: cohort-builder-e2e-tests-container | ||
working_dir: /app | ||
command: sh /app/e2e/support/bamboo/e2e-test-runner.sh | ||
volumes: | ||
- ../../../:/app | ||
networks: | ||
- test | ||
|
||
gateway: | ||
image: openmrs/openmrs-reference-application-3-gateway:${TAG:-nightly} | ||
depends_on: | ||
- frontend | ||
- backend | ||
ports: | ||
- "80:80" | ||
networks: | ||
- test | ||
|
||
frontend: | ||
image: openmrs/openmrs-reference-application-3-frontend:${TAG:-nightly} | ||
environment: | ||
SPA_PATH: /openmrs/spa | ||
API_URL: /openmrs | ||
SPA_CONFIG_URLS: | ||
healthcheck: | ||
test: [ "CMD", "curl", "-f", "http://localhost/" ] | ||
timeout: 5s | ||
depends_on: | ||
- backend | ||
networks: | ||
- test | ||
|
||
backend: | ||
image: openmrs/openmrs-reference-application-3-backend:nightly-with-data | ||
depends_on: | ||
- db | ||
networks: | ||
- test | ||
db: | ||
image: openmrs/openmrs-reference-application-3-db:nightly-with-data | ||
networks: | ||
- test | ||
|
||
networks: | ||
test: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
export E2E_BASE_URL=http://gateway/openmrs | ||
export CI=true | ||
|
||
while [ "$(curl -s -o /dev/null -w ''%{http_code}'' http://gateway/openmrs/login.htm)" != "200" ]; do | ||
echo "Waiting for the backend to be up..." | ||
sleep 10 | ||
done | ||
|
||
cp example.env .env | ||
|
||
yarn test-e2e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM mcr.microsoft.com/playwright:v1.39.0-jammy | ||
|
||
ARG USER_ID | ||
ARG GROUP_ID | ||
|
||
RUN if ! getent group $GROUP_ID > /dev/null; then \ | ||
groupadd -g $GROUP_ID myusergroup; \ | ||
fi | ||
|
||
RUN useradd -u $USER_ID -g $GROUP_ID -m playwrightuser | ||
|
||
USER playwrightuser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters