Skip to content
Snippets Groups Projects
Commit 5f9977db authored by Seamus Lee's avatar Seamus Lee Committed by GitHub
Browse files

Merge pull request #367 from seanmadsen/civi-test-run

Document civi-test-run script (take 2)
parents 8d446943 9b50f32d
Branches
No related tags found
No related merge requests found
......@@ -35,5 +35,9 @@ codebase.
Code-style is not checked on this build, but all upgrade and web tests are run.
## Running the test suite locally
You can use [civi-test-run](/tools/civi-test-run.md) locally to run a full standard CiviCRM Test suite.
[jenkins-test-results]: https://test.civicrm.org/
[testing-readme]: https://github.com/civicrm/civicrm-core/blob/master/tests/README.md
......@@ -10,9 +10,11 @@ conventions using [karma] and [jasmine].
## Running Javascript Tests
```bash
cd /path/to/civicrm
npm test
$ cd /path/to/civicrm
$ npm test
```
You can also run the karama tests as they would be run by [Jenkins](/testing/continuous-integration.md) using [civi-test-run](/tools/civi-test-run.md).
[karma]: https://karma-runner.github.io/1.0/index.html
[jasmine]: https://jasmine.github.io/2.1/introduction.html
......@@ -52,6 +52,8 @@ $ env CIVICRM_UF=UnitTests phpunit4 ./tests/phpunit/api/v3/CaseTest.php --filter
You can also specify tests in an environment variable `PHPUNIT_TESTS` (eg. `env PHPUNIT_TESTS="MyFirstTest::testFoo MySecondTest" phpunit EnvTests`
Then run `phpunit4 ./tests/phpunit/EnvTests.php`.
You can also optionally use [civi-test-run](/tools/civi-test-run.md) to run a full standard CiviCRM Test suite.
## Writing Tests
When writing Core tests you should extend from `\CiviUnitTestCase`.
......
......@@ -8,3 +8,4 @@ CMS-integration.
Upgrade tests are run daily on the Jenkins [continuous integration](/testing/continuous-integration.md) server.
Locally you can use [civi-test-run](/tools/civi-test-run.md) to run the same upgrade tests as Jenkins would.
# civi-test-run
`civi-test-run` is a script which runs one or more test suites locally. It is compatible with `civibuild`-based deployments.
## Installation
`civi-test-run` is included within [buildkit](/tools/buildkit.md).
## Usage
Run without arguments to see the exact usage:
```bash
$ civi-test-run
```
## Test types
The test type is one of:
- `all` - Run all standard CiviCRM Test Suites
- `karma` - Run the KarmaJS test suite
- `phpunit-api` - Run the `api_v3` Test Suite
- `phpunit-civi` - Run the `Civi/` Test Suite
- `phpunit-crm` - Run the `CRM` Test Suite
- `phpunit-e2e` - Run the E2E test suite
- `upgrade` - Run the upgrade test suite
......@@ -34,6 +34,9 @@ When you install [buildkit](/tools/buildkit.md) you'll get all these tools.
* *repository: [within civicrm-buildkit](https://github.com/civicrm/civicrm-buildkit/blob/master/bin/civihydra)*
* `civicrm-upgrade-test` - Scripts and data files for testing upgrades
* *[documentation& repository](https://github.com/civicrm/civicrm-upgrade-test)*
* `civi-test-run` - Run one or more test suites
* *[documentation](/tools/civi-test-run.md)*
* *repository: [within civicrm-buildkit](https://github.com/civicrm/civicrm-buildkit/blob/master/bin/civi-test-run)*
* Coder - Configure phpcs for CiviCRM's [coding standards](/standards/php.md)
* *[documentation & repository](https://github.com/civicrm/coder)*
* *(Derived from [Drupal's coder project](https://www.drupal.org/project/coder))*
......
......@@ -17,6 +17,7 @@ pages:
- civibuild: tools/civibuild.md
- cividist: tools/cividist.md
- civilint: tools/civilint.md
- civi-test-run: tools/civi-test-run.md
- Issue Tracking: tools/issue-tracking.md
- Git, GitHub, & GitLab: tools/git.md
- Jenkins: tools/jenkins.md
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment