matomo-org / matomo-org/developer-documentation
Steps to set up automated tests are incomplete
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 58
- Forks
- 88
- Avg merge
- 6d 3h
- Merged PRs (30d)
- 13
Description
It's not currently possible to set up the following the instructions provided either here: https://developer.matomo.org/guides/getting-started-part-1 or here: https://developer.matomo.org/guides/tests-php
The steps/assumptions that are missing or incorrect are as follows:
1. In the config, under [tests], `request_uri` must be set up correctly or the tests won't run.
2. The default database name is `matomo_tests`, not `piwik_tests` as mentioned on the "Getting Started" page.
3. The docs should mention that the database user specified under [database_tests] should have CREATE/DROP DATABASE privileges - I think the underlying assumption is that everyone uses the root user.
4. Just creating the tests database is not enough, it must be populated for the tests to run successfully - this can be achieved by running `./console tests:setup-fixture OmniFixture`.
And once *all* of the above is done, it's time to run `./console tests:run unit`, etc. I'd be very happy to create a pull request with the edited docs.
Additionally, there is code in https://github.com/matomo-org/matomo/blob/4.x-dev/tests/PHPUnit/bootstrap.php that should set up at least the config variables for the developer on the first run, however it doesn't actually work as it attempts to connect to the test database which is not yet set up - is it worth opening an issue for that or is it outdated code that should be scrapped rather than fixed?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Getting Started Part 1 and Tests PHP documentation pages linked in the issue, then inspect tests/PHPUnit/bootstrap.php and the listed console commands. Verify the test configuration, database name and privileges, fixture setup, and test-running instructions against the repository. Done means a developer can follow the documented steps to prepare and run the tests successfully, with the bootstrap question resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- documentation, testing
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100