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
Copy file name to clipboardExpand all lines: tests/README.md
+18-19
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,20 @@
1
-
Piwik comes with unit tests, integration tests, system tests, Javascript tests and UI tests.
2
-
This document briefly describes how to use and modify Piwik tests.
1
+
Matomo comes with unit tests, integration tests, system tests, Javascript tests and UI tests.
2
+
This document briefly describes how to use and modify Matomo tests.
3
3
4
4
## Continuous Integration
5
5
6
6
We use Travis CI for our continuous integration server. It automatically runs our battery of thousands of unit/integration/screenshot tests
7
7
after each commit to our GIT repo. More information at the links:
8
8
9
-
* Piwik on Travis CI: https://travis-ci.org/piwik/piwik
10
-
* QA in Piwik: https://matomo.org/qa/
9
+
* Matomo on Travis CI: https://travis-ci.com/matomo-org/matomo
11
10
12
-
Each core Piwik developer is responsible to keep the build green. If a developer breaks the build, he will receive an email from Travis CI.
11
+
Each core Matomo developer is responsible to keep the build green. If a developer breaks the build, they will receive an E-Mail from Travis CI.
13
12
14
13
The next section explains how you can run the test suite on your own dev machine.
15
14
16
-
## How To Run Piwik Tests
15
+
## How To Run Matomo Tests
17
16
18
-
To run tests, you must install Piwik via Git and set it up for development. A guide for this is available in our [Developer Zone](http://developer.piwik.org/guides/getting-started-part-1). The part about "Creating a plugin" can be skipped.
17
+
To run tests, you must install Matomo via Git and set it up for development. A guide for this is available in our [Developer Zone](https://developer.matomo.org/guides/getting-started-part-1). The part about "Creating a plugin" can be skipped.
19
18
20
19
To execute the tests:
21
20
@@ -29,21 +28,21 @@ To execute the tests:
29
28
30
29
## PHPUnit Tests
31
30
32
-
1.To install PHPUnit, run `php composer.phar install --dev` in the Piwik root directory.
31
+
1.To install PHPUnit, run `php composer.phar install --dev` in the Matomo root directory.
33
32
34
-
2. Ensure the `[database_tests]` section in `piwik/config/config.ini.php` is set up correctly,
33
+
2. Ensure the `[database_tests]` section in `matomo/config/config.ini.php` is set up correctly,
35
34
i.e. with the correct password to prevent the following error:
36
35
`SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)`
37
36
38
37
3.Run the tests
39
38
40
-
$ cd /path/to/piwik
39
+
$ cd /path/to/matomo
41
40
$ ./console tests:run --testsuite unit
42
41
$ ./console tests:run --testsuite integration
43
42
$ ./console tests:run --testsuite system
44
43
45
44
There are also two main groups of tests: core and plugins
46
-
For example run `./console tests:run core` to run all Core Piwik tests.
45
+
For example run `./console tests:run core` to run all Core Matomo tests.
47
46
48
47
You can combine testsuite and groups like this:
49
48
`./console tests:run --testsuite unit core`. This would run all unit tests in core.
@@ -69,7 +68,7 @@ your test will be really fast.
69
68
It is an integration test if you have any dependency to a loaded plugin, to the filesystem, web, config, database or something
70
69
similar. It is an integration test if you test multiple classes in one test.
71
70
72
-
It is a system test if you - for instance - make a call to Piwik itself via HTTP or CLI and the whole system is being tested.
71
+
It is a system test if you - for instance - make a call to Matomo itself via HTTP or CLI and the whole system is being tested.
73
72
74
73
### Why do we split tests in unit, integration, system and ui folders?
75
74
@@ -88,14 +87,14 @@ not tested they would be still marked as tested when running integration tests.
88
87
89
88
System tests files are in `tests/PHPUnit/System/*Test.php`
90
89
91
-
System tests allow to test how major Piwik components interact together.
90
+
System tests allow to test how major Matomo components interact together.
92
91
A test will typically generate hits to the Tracker (record visits and page views)
93
92
and then test all API responses and for each API output. It then checks that they match expected XML (or CSV, json, etc.).
94
93
If a test fails, you can compare the processed/ and expected/ directories in a graphical text compare tool, such as WinMerge on Win, or MELD on Linux, or even with PhpStorm, to easily view changes between files.
95
94
96
95
For example using Meld, click on "Start new comparison", "Directory comparison",
97
-
in "Original" select "path/to/piwik/tests/PHPUnit/System/expected"
98
-
in "Mine" select "path/to/piwik/tests/PHPUnit/System/processed"
96
+
in "Original" select "path/to/matomo/tests/PHPUnit/System/expected"
97
+
in "Mine" select "path/to/matomo/tests/PHPUnit/System/processed"
99
98
100
99
If changes are expected due to the code changes you make, simply copy the file from processed/ to expected/, and test will then pass. Copying files is done easily using Meld (ALT+LEFT).
101
100
Otherwise, if you didn't expect to modify the API outputs, it might be that your changes are breaking some features unexpectedly.
@@ -133,11 +132,11 @@ If you use Ubuntu or another Linux distribution, you must make one change to the
133
132
134
133
## JavaScript Tests
135
134
136
-
piwik.js is unit tested and you can run the Javascript tests at: /piwik/tests/javascript/
135
+
piwik.js is unit tested and you can run the Javascript tests at: /matomo/tests/javascript/
137
136
138
137
## Testing Data
139
138
140
-
See [tests/README.testing-data.md](https://github.com/matomo-org/matomo/blob/master/tests/README.testing-data.md) to import testing data in Piwik.
139
+
See [tests/README.testing-data.md](https://github.com/matomo-org/matomo/blob/master/tests/README.testing-data.md) to import testing data in Matomo.
141
140
142
141
## UI Screenshots Tests
143
142
@@ -151,7 +150,7 @@ You can retrieve the files generated during the build (the build artifacts) at [
151
150
152
151
### Test logs on CI
153
152
154
-
By default tests running on Travis CI will log all messages of at least `INFO` level in `$PIWIK_ROOT_DIR/tmp/logs/piwik.log`. In a given travis build output, you can view the logs by clicking on the line `$ cat $PIWIK_ROOT_DIR/tmp/logs/matomo.log` at the end of the build output text.
153
+
By default tests running on Travis CI will log all messages of at least `INFO` level in `$PIWIK_ROOT_DIR/tmp/logs/matomo.log`. In a given travis build output, you can view the logs by clicking on the line `$ cat $PIWIK_ROOT_DIR/tmp/logs/matomo.log` at the end of the build output text.
155
154
156
155
Note: `DEBUG` and `VERBOSE` messages are not logged by default (to keep Travis page loading fast). At any time you can temporarily enable logging by [modifying this file](https://github.com/matomo-org/matomo/blob/master/tests/PHPUnit/config.ini.travis.php#L23-27) and changing `log_level = info` to `log_level = debug` or `log_level = verbose`.
157
156
@@ -176,7 +175,7 @@ See [tests/PHPUnit/Benchmarks/README.md](https://github.com/matomo-org/matomo/bl
176
175
177
176
### Profiling
178
177
179
-
See [tests/README.xhprof.md](https://github.com/matomo-org/matomo/blob/master/tests/README.xhprof.md) for help on how to profile Piwik with XHProf.
178
+
See [tests/README.xhprof.md](https://github.com/matomo-org/matomo/blob/master/tests/README.xhprof.md) for help on how to profile Matomo with XHProf.
0 commit comments