diff --git a/docs/testing/continuous-integration.md b/docs/testing/continuous-integration.md index b9a48a0e8893d6af18e526042bacdc71b82c05b2..b066382c04be68fec1eb5a0c8bd89f7bab22df1e 100644 --- a/docs/testing/continuous-integration.md +++ b/docs/testing/continuous-integration.md @@ -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 diff --git a/docs/testing/javascript.md b/docs/testing/javascript.md index 8138c2d8d10a95894707aea47e8aeb050c61c154..52ff965b4453d8ae4ebdad5f91d145d4072c0011 100644 --- a/docs/testing/javascript.md +++ b/docs/testing/javascript.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 diff --git a/docs/testing/phpunit.md b/docs/testing/phpunit.md index 6f92b52e4aa4e1d6150cfe8bc8cd4cd5f3e52321..6c4355849a739d25a6be9f68ab2f063d3b1fb662 100644 --- a/docs/testing/phpunit.md +++ b/docs/testing/phpunit.md @@ -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`. diff --git a/docs/testing/upgrades.md b/docs/testing/upgrades.md index 9df2df745ac8bde07631d88e9fe191a2ed08cd52..95420007e447a84935884108b3d6b24afe934e11 100644 --- a/docs/testing/upgrades.md +++ b/docs/testing/upgrades.md @@ -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. diff --git a/docs/tools/civi-test-run.md b/docs/tools/civi-test-run.md new file mode 100644 index 0000000000000000000000000000000000000000..1ae3bd66243cb5aa8bf44923987a71f0376c50ed --- /dev/null +++ b/docs/tools/civi-test-run.md @@ -0,0 +1,27 @@ +# 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 diff --git a/docs/tools/index.md b/docs/tools/index.md index 7d9f4cd19d6e5b6b40672da9980d2e4cc73d0b47..e516bd77cd064f177ca2debda5e8890a98ed492b 100644 --- a/docs/tools/index.md +++ b/docs/tools/index.md @@ -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))* diff --git a/mkdocs.yml b/mkdocs.yml index 401678d66fb6130dba024f1943e2cb0c32bb3aa4..9cd2ba2df84624be1bfe8acaceb46f31e874c7f0 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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