Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
megahirt committed Dec 6, 2022
2 parents b943cca + d87f8f3 commit 1042d8d
Show file tree
Hide file tree
Showing 199 changed files with 2,079 additions and 168,990 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integrate-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
run: make unit-tests-ci
-
name: Playwright E2E Tests
run: make playwright-tests-ci
run: make e2e-tests-ci
-
name: Upload Playwright test results
if: always()
Expand Down
28 changes: 6 additions & 22 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
env:
DOCKER_BUILDKIT: 1

# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
unit-tests:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -59,7 +64,7 @@ jobs:
-
name: Playwright E2E Tests
# see https://playwright.dev/docs/ci#github-actions
run: make playwright-tests-ci
run: make e2e-tests-ci

-
name: Upload Playwright test results
Expand All @@ -82,24 +87,3 @@ jobs:
-
name: Run prettier check
run: npx prettier --check .

# protractor-tests:
# runs-on: ubuntu-latest

# steps:
# -
# uses: actions/checkout@v3
# -
# name: Build app
# run: make build
# -
# name: Run E2E Tests
# run: make e2e-tests-ci
# -
# name: Publish Test Results
# uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1
# if: always()
# with:
# check_name: E2E Test Results
# github_token: ${{ github.token }}
# files: docker/e2e-results.xml
2 changes: 0 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"amodio.tsl-problem-matcher",
"msjsdiag.debugger-for-chrome",
"ms-vscode-remote.remote-containers",
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
Expand Down
44 changes: 1 addition & 43 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,17 @@
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "webpack",
"type": "shell",
"windows": {
"command": "bash -c 'npm run webpack'"
},
"linux": {
"command": "npm run webpack"
},
"problemMatcher": "$awesometsc",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "silent"
}
},
{
"label": "webpack-watch",
"type": "shell",
"isBackground": true,
"windows": {
"command": "bash -c 'npm run webpack:watch'"
},
"linux": {
"command": "npm run webpack:watch"
},
"presentation": {
"reveal": "silent"
},
"problemMatcher": []
},
{
"label": "npm install",
"type": "shell",
"windows": {
"command": "bash -c 'npm install'"
},
"linux": {
"command": "npm install"
},
"command": "npm install",
"presentation": {
"reveal": "silent"
},
"problemMatcher": []
},
{
"label": "Reset E2E tests",
"type": "process",
"command": "docker",
"args": ["compose", "restart", "app-for-e2e"],
"problemMatcher": []
}
]
}
23 changes: 5 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ start: build
dev: start
docker compose up -d ui-builder

.PHONY: playwright-tests-ci
playwright-tests-ci:
.PHONY: e2e-tests-ci
e2e-tests-ci:
npm ci
$(MAKE) playwright-app
npx playwright install chromium && npx playwright test -c ./test/e2e/playwright.config.ts

.PHONY: playwright-tests
playwright-tests:
.PHONY: e2e-tests
e2e-tests:
npm install
$(MAKE) playwright-app
docker compose up -d ui-builder
Expand All @@ -26,23 +26,10 @@ playwright-tests:
playwright-app:
# delete any cached session storage state files if the service isn't running
docker compose ps app-for-playwright > /dev/null 2>&1 || $(MAKE) clean-test
docker compose up -d app-for-playwright
docker compose up -d app-for-playwright --build
# wait until the app-for-playwright service is serving up HTTP before continuing
until curl localhost:3238 > /dev/null 2>&1; do sleep 1; done

.PHONY: e2e-tests
e2e-tests:
docker compose build app-for-e2e test-e2e
docker compose restart app-for-e2e || docker compose up -d app-for-e2e
docker compose run -e TEST_SPECS=$(TEST_SPECS) test-e2e

.PHONY: e2e-tests-ci
e2e-tests-ci:
docker compose build app-for-e2e test-e2e
docker compose run -e GITHUB_ACTIONS=1 --name e2etests test-e2e
docker cp e2etests:/data/e2e-output/junitresults.xml e2e-results.xml
docker rm e2etests

.PHONY: unit-tests
unit-tests:
docker compose build test-php
Expand Down
58 changes: 0 additions & 58 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,6 @@ services:
environment:
- MONGO_INITDB_DATABASE=scriptureforge

selenium:
image: selenium/standalone-chrome-debug:3.141.59-20210713
volumes:
- /dev/shm:/dev/shm
ports:
- "5900:5900"

ld-db:
image: mysql:5.7
container_name: ld-db
Expand Down Expand Up @@ -243,57 +236,6 @@ services:
- MYSQL_ROOT_PASSWORD=also-not-a-secret
- JWT_SIGNING_KEY=bogus-development-token

test-e2e:
build:
dockerfile: docker/test-e2e/Dockerfile
args:
- ENVIRONMENT=development
image: lf-test-e2e
container_name: lf-test-e2e
depends_on:
- db
- app-for-e2e
- mail
- selenium
environment:
- WAIT_HOSTS=db:27017, mail:25, selenium:4444, app-for-e2e:80
- ENVIRONMENT=development
- LANGUAGE_DEPOT_API_TOKEN=bogus-development-token
command: sh -c "/wait && /run.sh"
volumes:
# for developer convenience
- ./src:/data/src
- ./typings:/data/typings
- ./webpack.config.js:/data/webpack.config.js
- ./webpack-dev.config.js:/data/webpack-dev.config.js
- ./webpack-prd.config.js:/data/webpack-prd.config.js
- ./package.json:/data/package.json
- ./package-lock.json:/data/package-lock.json
# uncomment on dev machine for convenience but don't commit - it messes up the e2e test run by
# clobbering the JS files produced by tsc in the built image.
# - ../test:/data/test

app-for-e2e:
build:
dockerfile: docker/app-for-e2e/Dockerfile
image: lf-app-for-e2e
container_name: lf-app-for-e2e
platform: linux/amd64
depends_on:
- db
- mail
environment:
- WAIT_HOSTS=db:27017, mail:25
- LDAPI_BASE_URL=http://ld-api:3000/api/v2/
- ENVIRONMENT=development
- WEBSITE=localhost
- DATABASE=scriptureforge_test
- MONGODB_CONN=mongodb://db:27017
- MAIL_HOST=mail
- REMEMBER_ME_SECRET=bogus-development-key
- LANGUAGE_DEPOT_API_TOKEN=bogus-development-token
command: sh -c "/wait && /run.sh"

app-for-playwright:
build:
dockerfile: docker/app/Dockerfile
Expand Down
11 changes: 0 additions & 11 deletions docker/app-for-e2e/Dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions docker/app-for-e2e/run.sh

This file was deleted.

6 changes: 6 additions & 0 deletions docker/next-app/Dockerfile.next-app
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ COPY --from=builder /app/package.json /app/

EXPOSE 3000

# container would not receive SIGTERM from docker when shutting down so Docker would force kill
# the container after 10s. This will make shutdown faster because the SIGTERM will be handled appropriately.
# https://maximorlov.com/process-signals-inside-docker-containers/
RUN apk add --no-cache tini
ENTRYPOINT ["/sbin/tini", "--"]

CMD node app/index.js
46 changes: 0 additions & 46 deletions docker/test-e2e/.vscode/launch.json

This file was deleted.

17 changes: 0 additions & 17 deletions docker/test-e2e/.vscode/tasks.json

This file was deleted.

32 changes: 0 additions & 32 deletions docker/test-e2e/Dockerfile

This file was deleted.

28 changes: 0 additions & 28 deletions docker/test-e2e/run.sh

This file was deleted.

Loading

0 comments on commit 1042d8d

Please sign in to comment.