You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Removing spaces from test suite names
Having spaces in test suite names makes it difficult to call phpunit
from wrapper scripts, which are needed for the docker-based test suite.
* Skipping broken tests
* Replacing .click with .submit
.click was not executing form submit and was causing the test to fail
* Add missing xsi:nil property to fixture
* Allow a selenium host/port to be specified via config file
* Add docker-based test suite and required scripts
* Add note about creating Docker group
* Rename Dockerfiles
* Use linting scripts in .travis.yml
RUN echo "Use LorisTest;" >> /docker-entrypoint-initdb.d/0001-paths.sql
26
+
RUN echo "UPDATE Config SET Value='${BASE_DIR}/' WHERE ConfigID=(SELECT ID FROM ConfigSettings WHERE Name='base');" >> /docker-entrypoint-initdb.d/0001-paths.sql
27
+
RUN echo "UPDATE Config SET Value='http://web:8000' WHERE ConfigID=(SELECT ID FROM ConfigSettings WHERE Name='url');" >> /docker-entrypoint-initdb.d/0001-paths.sql
You will need Docker Engine, Docker Compose, and NodeJS.
5
+
6
+
Please follow the directions [here](https://docs.docker.com/engine/installation/) to install Docker Engine. Be sure to also [create a Docker group](https://docs.docker.com/engine/installation/linux/ubuntulinux/#/create-a-docker-group) so Docker can be run without using `sudo`.
Make sure you have NodeJS installed. If not, follow the instructions [here](https://nodejs.org/en/download/package-manager/).
17
+
18
+
Finally, run `npm install` in the root folder (this is only required for Javascript linting).
19
+
20
+
## Basic Workflow
21
+
22
+
**To run all the unit tests:**
23
+
24
+
```
25
+
npm run tests:unit
26
+
```
27
+
28
+
**To run all of the integration tests:**
29
+
30
+
```
31
+
npm run tests:integration
32
+
```
33
+
34
+
You can see the integration tests in action by connecting your VNC viewer to `<host>:5900` and supplying the password `secret`.
35
+
36
+
37
+
**To run PHP linting:**
38
+
39
+
```
40
+
npm run lint:php
41
+
```
42
+
43
+
**To run Javascript linting:**
44
+
45
+
```
46
+
npm run lint:javascript
47
+
```
48
+
49
+
## Advanced Workflow
50
+
51
+
#### Command-Line Options
52
+
You can pass any [PHPUnit command-line options](https://phpunit.de/manual/current/en/textui.html) by appending `--` followed by the options. For example, say you only wanted to run the unit tests contained in the `CandidateTest` class. To achieve this you could run the following command:
53
+
54
+
```
55
+
npm run tests:unit -- --filter CandidateTest
56
+
```
57
+
58
+
Or, to run a specific test within `CandidateTest`:
59
+
60
+
```
61
+
npm run tests:unit -- --filter CandidateTest::testValidatePSCID
62
+
```
63
+
64
+
#### Debugging
65
+
66
+
Both the unit and integration tests can be run with XDebug enabled.
67
+
68
+
```
69
+
npm run tests:unit:debug
70
+
```
71
+
Or
72
+
```
73
+
npm run tests:integration:debug
74
+
```
75
+
76
+
You must specify a remote host for XDebug to connect to via the `XDEBUG_REMOTE_HOST` environment variable when using either of these commands.
77
+
78
+
79
+
## Todo
80
+
81
+
- Run integration tests in parallel
82
+
83
+
## Issues
84
+
85
+
- By default npm will output some irrelevant info when a script returns a non-zero error code, as described [here](https://github.com/npm/npm/issues/8821). To prevent this pass `-s` or `--silent` to `npm run`, e.g. `npm run -s tests:unit`.
86
+
87
+
- Running the entire integration test suite with XDebug enabled sometimes results in a segmentation fault. This appears to be an issue with XDebug itself.
0 commit comments