Run all tests on jenkins
We used to specify specific rake test tasks so that we could run all of them even if early ones failed. However, that meant that as new tasks were added, they weren't being run on jenkins. Now, there is a facility in the rake scripts so that tests can run using the test_sh function, which will delay failure until the end of the rake run, unless the TESTS_FAIL_FAST environment variable is set. Furthermore, this reorganizes the jasmine test tasks so that we can run those as part of `rake test` as well.
This commit is contained in:
@@ -141,21 +141,36 @@ Very handy: if you uncomment the `pdb=1` line in `setup.cfg`, it will drop you i
|
||||
|
||||
### Running Javascript Unit Tests
|
||||
|
||||
These commands start a development server with jasmine testing enabled, and launch your default browser
|
||||
pointing to those tests
|
||||
To run all of the javascript unit tests, use
|
||||
|
||||
rake browse_jasmine_{lms,cms}
|
||||
rake jasmine
|
||||
|
||||
To run the tests headless, you must install [phantomjs](http://phantomjs.org/download.html), then run:
|
||||
If the `phantomjs` binary is on the path, or the `PHANTOMJS_PATH` environment variable is
|
||||
set to point to it, then the tests will be run headless. Otherwise, they will be run in
|
||||
your default browser
|
||||
|
||||
rake phantomjs_jasmine_{lms,cms}
|
||||
export PATH=/path/to/phantomjs:$PATH
|
||||
rake jasmine # Runs headless
|
||||
|
||||
If the `phantomjs` binary is not on the path, set the `PHANTOMJS_PATH` environment variable to point to it
|
||||
or
|
||||
|
||||
PHANTOMJS_PATH=/path/to/phantomjs rake phantomjs_jasmine_{lms,cms}
|
||||
PHANTOMJS_PATH=/path/to/phantomjs rake jasmine # Runs headless
|
||||
|
||||
Once you have run the `rake` command, your browser should open to
|
||||
to `http://localhost/_jasmine/`, which displays the test results.
|
||||
or
|
||||
|
||||
rake jasmine # Runs in browser
|
||||
|
||||
You can also force a run using phantomjs or the browser using the commands
|
||||
|
||||
rake jasmine:browser # Runs in browser
|
||||
rake jasmine:phantomjs # Runs headless
|
||||
|
||||
You can run tests for a specific subsystems as well
|
||||
|
||||
rake jasmine:lms # Runs all lms javascript unit tests using the default method
|
||||
rake jasmine:cms:browser # Runs all cms javascript unit tests in the browser
|
||||
|
||||
Use `rake -T` to get a list of all available subsystems
|
||||
|
||||
**Troubleshooting**: If you get an error message while running the `rake` task,
|
||||
try running `bundle install` to install the required ruby gems.
|
||||
|
||||
Reference in New Issue
Block a user