From 7ef97d905716780a43f7f5755360f237eec7cb6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Sun, 6 Jul 2014 13:30:27 -0700 Subject: [PATCH] No need to start the dev server for running tests --- Developer-Guide.md | 43 +++++++++++-------------------------------- 1 file changed, 11 insertions(+), 32 deletions(-) diff --git a/Developer-Guide.md b/Developer-Guide.md index 6aefcf5..f54d143 100644 --- a/Developer-Guide.md +++ b/Developer-Guide.md @@ -83,7 +83,7 @@ example: The main build targets are `serve`, `lint`, `build`, `test`, and `check`. The latter is a meta-target that basically runs `lint`, `build`, and `test`. -The `serve` target starts a node-based web server, which we will refer to as the *dev server*. You'll need to start that server for running the examples and the tests. More information on that further down. +The `serve` target starts a node-based web server, which we will refer to as the *dev server*. You'll need to start that server for running the examples and the tests in a browser. More information on that further down. Other targets include `apidoc` and `ci`. The latter is the target used on Travis CI. See ol3's [Travis configuration file](https://github.com/openlayers/ol3/blob/master/.travis.yml). @@ -91,27 +91,12 @@ Other targets include `apidoc` and `ci`. The latter is the target used on Travis The `check` target is to be run before pushing code to GitHub and opening pull requests. Branches that don't pass `check` won't pass the integration tests, -and have therefore no chance of being merged into `master`. The `check` target -runs the tests, so it requires that the dev server run. +and have therefore no chance of being merged into `master`. -To start the dev server use: - - $ ./build.py serve - -To run the `check` target use: +To run the `check` target: $ ./build.py check -If you get this kind of error: - - $ ./build.py check - 2014-07-05 22:39:16,310 test: ./node_modules/.bin/phantomjs test/mocha-phantomjs.js http://localhost:3000/test/index.html - Failed to load the page. Check the url: http://localhost:3000/test/index.html - 2014-07-05 22:39:16,495 test: clean - 2014-07-05 22:39:16,495 pake: test: Command '['./node_modules/.bin/phantomjs', 'test/mocha-phantomjs.js', 'http://localhost:3000/test/index.html']' returned non-zero exit status 1 - -it means that you don't have the dev server running. - If you want to run the full suite of integration tests, see "Running the integration tests" below. @@ -143,29 +128,23 @@ executes before any other script). ## Running tests -Run the dev server (see above), and either open the in the browser, or run `./build.py test` on the console (headless testing with PhantomJS). +To run the tests in a browser start the dev server (`./build.py serve`) and open in the browser. + +To run the tests on the console (headless testing with PhantomJS) use the `test` target: + + $ ./build.py test See also the test-specific [README](../blob/master/test/README.md). -If you get this error - - $ ./build.py check - 2014-07-05 22:39:16,310 test: ./node_modules/.bin/phantomjs test/mocha-phantomjs.js http://localhost:3000/test/index.html - Failed to load the page. Check the url: http://localhost:3000/test/index.html - 2014-07-05 22:39:16,495 test: clean - 2014-07-05 22:39:16,495 pake: test: Command '['./node_modules/.bin/phantomjs', 'test/mocha-phantomjs.js', 'http://localhost:3000/test/index.html']' returned non-zero exit status 1 - -it means that you don't have the dev server running. - ## Running the integration tests When you submit a pull request the [Travis continuous integration server](https://travis-ci.org/) will run a full suite of tests, including building all versions of the library and checking that all of the examples work. You will receive an email with the results, and the status will be -displayed in the pull request. If you want to run the integration tests -locally, then you'll need to make sure that the dev server is running (`build.py serve`) if it isn't -already, and then start the tests: +displayed in the pull request. + +To run the full suite of integration tests use the `ci` target: $ ./build.py ci