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
We use [Travis CI](https://travis-ci.com) for Continuous Integration (CI) testing. Integration and unit tests are run against every commit and pull request to help catch regressions before they are released.
7
+
We use [GitHub Actions](https://github.com/features/actions) for Continuous Integration (CI) testing. Integration and unit tests are run against every pull request to help catch regressions before they are released.
8
8
9
-
CI tests are configured to run the tests against multiple PHP versions and databases. The configuration details are stored in the `.travis.yml`file in the application's root directory.
9
+
CI tests are configured to run the tests against multiple PHP versions and databases. The configuration details are stored in `.github/workflows/main.yml`for each application.
10
10
11
-

11
+

12
12
13
-
View the tests for [OJS](https://travis-ci.com/pkp/ojs/), [OMP](https://travis-ci.com/pkp/omp/) and [OPS](https://travis-ci.com/pkp/ops/).
13
+
View the tests for [OJS](https://github.com/pkp/ojs/actions), [OMP](https://github.com/pkp/omp/actions) and [OPS](https://github.com/pkp/ops/actions).
14
14
15
15
## Tests for pull requests
16
16
17
-
Travis will run tests against every pull request to OJSor OMP. The tests are listed in the checks at the bottom of the pull request.
17
+
GitHub Actions will run tests against every pull request to OJS, OMP, or OPS. The tests are listed in the checks at the bottom of the pull request.
18
18
19
-

19
+

20
20
21
-
Click the **Details** link beside the Travis tests to watch the tests as they run and see which tests have passed or failed. All tests must pass before a pull request will be merged.
21
+
Click the **Details** link beside a test to watch the test as it runs and see which tests have passed or failed. All tests must pass before a pull request will be merged.
22
22
23
23
### Prepare pull requests for testing
24
24
25
-
A single change to an application may involve pull requests to more than one repository. For example, a change that impacts `pkp-lib` and `ojs` will require two pull requests.
25
+
A change to an application may involve pull requests to more than one repository. For example, a change that impacts `pkp-lib` and `ojs` will require two pull requests.
26
26
27
-
Travis must be able to locate the correct repository and branch for the `pkp-lib` submodule in order to run the tests against the correct code. To do this, an extra commit with a special commit message, `Submodule update ##<username>/<branch>##`, is added to the application repository.
27
+
GitHub Actions must be able to locate the correct repository and branch for the `pkp-lib` submodule in order to run the tests against the correct code. To do this, an extra commit with a special commit message, `Submodule update ##<username>/<branch>##`, is added to the application repository.
28
28
29
-
The example below will instruct Travis to clone the `ojs` and `pkp-lib` repositories owned by `NateWr` and check out the `i123_example` branch.
29
+
The example below will instruct GitHub Actions to clone the `ojs` and `pkp-lib` repositories owned by `NateWr` and check out the `i123_example` branch.
When a test fails it means that a recent change has broken the application. The log files for the tests will will indicate which tests failed and will list all of the commands that were run before the failure occurred.
7
+
When a test fails it means that a recent change has broken the application. The log files for the tests will indicate which tests failed and will list all of the commands that were run before the failure occurred.
8
8
9
9
In most cases, the server's error log will contain important clues about what went wrong.
10
10
@@ -16,40 +16,36 @@ When the tests are run from the terminal you will find a screenshot of the brows
16
16
17
17
## Debug CI
18
18
19
-
The [CI tests](./continuous-integration) can be difficult to debug. Travis provides access to its build logs and screenshots of test failures to help.
19
+
The [CI tests](./continuous-integration) can be difficult to debug. GitHub provides access to its build logs and artifacts produced by tests to help. Click **Checks** on a pull request to see the logs from the tests.
20
20
21
21
<figureclass="video_container">
22
22
<videocontrols="true"allowfullscreen="true">
23
-
<source src="./travis-log.mp4" type="video/mp4">
23
+
<source src="./github-log.mp4" type="video/mp4">
24
24
</video>
25
-
<figcaption>Short video showing how to access log of build results.</figcaption>
25
+
<figcaption>Short video showing how to access the log of build results.</figcaption>
26
26
</figure>
27
27
28
28
This provides a log of the entire build process including the logs from the Cypress and PHP Unit tests. Parts of the log, such as the server's error log, are truncated and can only be reached by accessing the raw log.
<figcaption>Short video showing how to access the raw log of build results.</figcaption>
35
35
</figure>
36
36
37
37
> When viewing the raw log, run a search in your browser for "fatal". This is a quick way to find the source of many -- _but not all_ -- test failures.
38
38
{:.tip}
39
39
40
-
### Travis debug mode
40
+
### Artifacts
41
41
42
-
Travis provides a [debug mode](https://docs.travis-ci.com/user/running-build-in-debug-mode/). When enabled it is possible to log into the Travis environment via SSH and explore the tests manually.
42
+
When a test fails, GitHub Actions will create individual artifact downloads that contain screenshots generated by Cypress for each failing test, as well as server logs.
43
43
44
-
### Screenshots
44
+

45
45
46
-
Screenshots can be accessed by using the uuencode tool on the Travis VM. To extract the screenshots related to a test failure, follow these steps.
46
+
Download URLs will also be output in the logs for each failing test near the end of a test run.
47
47
48
-
- When viewing the test output on Travis, click the "Raw Log" button.
49
-
- Save the log to your computer, for example `/tmp/log.txt`.
50
-
- Run `cat /tmp/log.txt | uudecode | tar xvz` to extract the screenshots locally.
51
-
52
-
> If you are struggling to understand a test failure in Travis, it may be best to run the tests locally where you have more insight into the state of the application.
48
+
> If you are struggling to understand a test failure, it may be best to run the tests locally where you have more insight into the state of the application.
Copy file name to clipboardExpand all lines: dev/testing/en/getting-started.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ We use [Cypress](https://www.cypress.io/) and [PHPUnit](https://phpunit.de/) to
8
8
9
9
## Configure your environment
10
10
11
-
There are many ways to [configure your environment](https://docs.cypress.io/guides/guides/environment-variables.html#Setting) to run the Cypress tests. We recommend creating a `cypress.env.json` file.
11
+
There are many ways to [configure your environment](https://docs.cypress.io/guides/guides/environment-variables#Setting) to run the Cypress tests. We recommend creating a `cypress.env.json` file.
12
12
13
13
```json
14
14
{
@@ -31,7 +31,7 @@ The integration tests will install the software and create test data.
31
31
32
32
## Run integration tests
33
33
34
-
The integration tests will install the software and run a number of tests to add users, make submissions, record editorial decisions and publish articles.
34
+
The integration tests will install the software and run tests to add users, make submissions, record editorial decisions and publish articles.
35
35
36
36
Before the integration tests are run, update your `config.inc.php` file and set the `installed` flag to `Off`.
37
37
@@ -41,7 +41,7 @@ Before the integration tests are run, update your `config.inc.php` file and set
41
41
installed = Off
42
42
```
43
43
44
-
Run the following comand in the root directory of the application to start a server. The URL should match the `baseUrl` in `cypress.env.json`.
44
+
Run the following command in the root directory of the application to start a server. The URL should match the `baseUrl` in `cypress.env.json`.
Plugins and themes can make use of parts of the application tests to prepare a test environment and run tests. This allows each plugin to implement [continuous integration](./continuous-integration) testing in its own repository.
8
8
9
-
The [Static Pages](https://github.com/pkp/staticPages/) and [Quick Submit](https://github.com/pkp/quickSubmit) plugins and the [Manuscript](https://github.com/pkp/defaultManuscript) theme are configured for testing. The `.travis.yml` file in each repository configures the integration tests. The tests that are run can be found in each repository's `cypress/tests` directory.
9
+
The `.github/workflows/main.yml` file in each repository configures the integration tests. Additional plugin-dependent commands that are run during tests may be found in `.github/actions/tests.sh`. The tests that are run can be found in each repository's `cypress/tests` directory.
10
10
11
11
Plugin and theme tests can be run locally by running the following command in the application's root directory.
12
12
13
13
```
14
14
cd path/to/ojs
15
15
npx cypress run --config integrationFolder=plugins/generic/staticPages/cypress/tests
16
16
```
17
+
18
+
## Examples
19
+
20
+
Examples of plugins that have been configured with tests include:
Copy file name to clipboardExpand all lines: dev/testing/en/writing-tests.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ It is often appropriate to add to one of the existing tests rather than create a
11
11
> If you are writing a test which checks a particular part of the editorial workflow, it should be put in `cypress/tests/data`. If you are writing a test for something else, such as statistics or journal settings, it should be put in `cypress/tests/integration`.
12
12
{:.notice}
13
13
14
-
Read the Cypress documentation to learn how to write your [first test](https://docs.cypress.io/guides/getting-started/writing-your-first-test.html), [organize tests](https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests.html#Test-Structure), and [interact with buttons and fields](https://docs.cypress.io/guides/core-concepts/interacting-with-elements.html#Actionability).
14
+
Read the Cypress documentation to learn how to write your [first test](https://docs.cypress.io/guides/end-to-end-testing/writing-your-first-end-to-end-test), [organize tests](https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests#Test-Structure), and [interact with buttons and fields](https://docs.cypress.io/guides/core-concepts/interacting-with-elements#Actionability).
0 commit comments