Skip to content

Commit 63fba00

Browse files
authored
e2e test GHA workflow + unit test reporter (#1278)
This PR adds a separate workflow for e2e test runs. The e2e tests could have been included in the existing unit-test workflow, however I chose to split it out into a separate workflow so that it can be reported as a separate line item in the PR checks. This PR also makes the following minor changes: adds a unit test reporter to display test results in a PR comment adds the protractor-fail-fast capability for e2e tests (stop test runner after first failure). This is advantageous for E2E tests since they take a long time to run, and often the first failing test is where the problem lies. This should save time when running flaky E2E tests. We should be able to re-run the e2e tests quicker with fail-fast turned on. Fixes #1276 Fixes #1269
1 parent 7798b18 commit 63fba00

6 files changed

Lines changed: 434 additions & 527 deletions

File tree

.github/workflows/e2e-tests.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Run E2E Tests
2+
3+
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on
4+
on:
5+
pull_request:
6+
7+
defaults:
8+
run:
9+
shell: bash
10+
working-directory: docker
11+
12+
jobs:
13+
e2e-tests:
14+
runs-on: ubuntu-latest
15+
16+
env:
17+
DOCKER_BUILDKIT: 1
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Run E2E Tests
23+
run: make e2e-tests

.github/workflows/unit-tests.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
name: Run unit tests
1+
name: Run Unit Tests
22

33
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on
44
on:
55
pull_request:
66

7-
push:
8-
branches:
9-
- staging
7+
defaults:
8+
run:
9+
shell: bash
10+
working-directory: docker
1011

1112
jobs:
1213
unit-tests:
@@ -16,7 +17,15 @@ jobs:
1617
- uses: actions/checkout@v2
1718
- uses: satackey/action-docker-layer-caching@v0.0.11
1819

19-
- name: Run unit tests
20-
working-directory: ./docker/
21-
run: make unit-tests
20+
- name: Run Unit Tests
21+
run: make unit-tests-ci
2222

23+
- name: echo working directory contents
24+
run: ls -l
25+
26+
- name: Publish Test Results
27+
uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1
28+
if: always()
29+
with:
30+
github_token: ${{ github.token }}
31+
files: docker/PhpUnitTests.xml

docker/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ unit-tests:
2626
docker-compose build test-php
2727
docker-compose run test-php
2828

29+
.PHONY: unit-tests-ci
30+
unit-tests-ci: build
31+
docker-compose build test-php
32+
docker-compose run --name unittests test-php
33+
docker cp unittests:/var/www/PhpUnitTests.xml .
34+
2935
.PHONY: build
3036
build:
3137
docker-compose build mail app ld-api

0 commit comments

Comments
 (0)