diff --git a/.travis.yml b/.travis.yml index 63a869ed0..f865c47b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,12 @@ cache: - $HOME/.pip-cache/ - $HOME/.selenium/ +# limit the depth of the commits we clone +git: + depth: 5 + addons: - firefox: "42.0" + firefox: "44.0" env: global: @@ -25,8 +29,8 @@ env: before_install: - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" - - "mkdir -p $HOME/.selenium && cd $HOME/.selenium && wget -nc http://selenium-release.storage.googleapis.com/2.48/selenium-server-standalone-2.48.0.jar" - - java -jar selenium-server-standalone-2.48.0.jar &> /dev/null & + - "mkdir -p $HOME/.selenium && cd $HOME/.selenium && wget -nc http://selenium-release.storage.googleapis.com/2.52/selenium-server-standalone-2.52.0.jar" + - java -jar selenium-server-standalone-2.52.0.jar &> /dev/null & - cd - install: @@ -45,6 +49,9 @@ before_script: - grunt # now run the tests! +# if this is a pull request from a fork, TRAVIS_SECURE_ENV_VARS will be false, so +# just run the non-auth tests. otherwise, run everything. script: - nosetests - - node_modules/.bin/intern-runner reporters=console config=tests/intern user="$USER" pw="$PW" + - [ "${TRAVIS_SECURE_ENV_VARS}" = "false" ] && node_modules/.bin/intern-runner reporters=console config=tests/intern functionalSuites=tests/functional-nonauth + - [ "${TRAVIS_SECURE_ENV_VARS}" = "true" ] && node_modules/.bin/intern-runner reporters=console config=tests/intern user="$USER" pw="$PW" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ba7a5b0b5..ea5d77cf8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -196,7 +196,7 @@ Note: If you install Python on Windows using the MSI installer, it is highly rec Windows typically doesn't have the *make* tool installed. Windows users without *make* should look at the "detailed setup" section below. -As an alternative to Windows, a cloud IDE such as [Cloud 9](https://c9.io) can be used for a relatively easier setup. If you take this route, please update to the latest Python version with the following. (This is to avoid `InsecurePlatformWarning` errors that arise when the default Python 2.7.6 is used). +As an alternative to Windows, a cloud IDE such as [Cloud 9](https://c9.io) can be used for a relatively easier setup. If you take this route, please update to the latest Python version with the following. (This is to avoid `InsecurePlatformWarning` errors that arise when the default Python 2.7.6 is used). ``` sudo apt-add-repository ppa:fkrull/deadsnakes-python2.7 @@ -385,9 +385,12 @@ We use [Intern](http://theintern.io/) to run functional tests. To run them, make sure you download the Selenium standalone server from the repo root: ``` bash -wget http://selenium-release.storage.googleapis.com/2.46/selenium-server-standalone-2.46.0.jar +wget http://selenium-release.storage.googleapis.com/2.52/selenium-server-standalone-2.52.0.jar ``` +**Note: This version is known to work with Firefox 44. If things aren't working with the current stable version of Firefox, check to see +if there isn't a newer version of the Selenium standalone server and file a bug on these docs!** + The `firefox` binary will also need to be in your `PATH`. Here's how this can be done on OS X: ``` bash @@ -397,7 +400,7 @@ export PATH="/Applications/Firefox.app/Contents/MacOS/:$PATH" Now start Selenium: ``` bash -java -jar selenium-server-standalone-2.46.0.jar +java -jar selenium-server-standalone-2.52.0.jar ``` In a separate terminal window or tab, start the application servers: diff --git a/tests/functional.js b/tests/functional-all.js similarity index 79% rename from tests/functional.js rename to tests/functional-all.js index 981ebaa00..788b46c2c 100644 --- a/tests/functional.js +++ b/tests/functional-all.js @@ -3,10 +3,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* - To run a single test suite, use the following from the project root. -node_modules/.bin/intern-runner config=tests/intern functionalSuites=tests/functional/foo.js user="username" pw="secret_lies" +node_modules/.bin/intern-runner config=tests/intern \ + functionalSuites=tests/functional/foo.js \ + user="github_username" \ + pw="github_password" */ define([ diff --git a/tests/functional-nonauth.js b/tests/functional-nonauth.js new file mode 100644 index 000000000..f7d72a5bb --- /dev/null +++ b/tests/functional-nonauth.js @@ -0,0 +1,24 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* +This file is provided so we can run tests on Travis for pull requests +from forks that don't have access to encrypted environment variables. + +node_modules/.bin/intern-runner config=tests/intern \ + functionalSuites=tests/functional-nonauth +*/ + +define([ + './functional/reporting-non-auth.js', + './functional/comments-non-auth.js', + './functional/contributors-non-auth.js', + './functional/index-non-auth.js', + './functional/issue-list-non-auth.js', + './functional/issues-non-auth.js', + './functional/history-navigation-non-auth.js', + './functional/search-non-auth.js' +], function() { + 'use strict'; +}); diff --git a/tests/intern.js b/tests/intern.js index 32f3b5443..71c87daac 100644 --- a/tests/intern.js +++ b/tests/intern.js @@ -5,7 +5,7 @@ // Learn more about configuring this file at . // These default settings work OK for most people. The options that *must* be changed below are the // packages, suites, excludeInstrumentation, and (if you want functional tests) functionalSuites. -define(['intern/lib/args'], function (args) { +define(['intern/lib/args'], function(args) { 'use strict'; var siteRoot = args.siteRoot ? args.siteRoot : 'http://localhost:5000'; @@ -15,8 +15,8 @@ define(['intern/lib/args'], function (args) { wc: { pageLoadTimeout: args.wcPageLoadTimeout ? parseInt(args.wcPageLoadTimeout, 10) : 10000, // user and pw need to be passed in as command-line arguments. See CONTRIBUTING.md - user: args.user || "some username", - pw: args.pw || "some password" + user: args.user || 'some username', + pw: args.pw || 'some password' }, // The port on which the instrumenting proxy will listen @@ -33,8 +33,8 @@ define(['intern/lib/args'], function (args) { // Beauty, Bob. reporters: 'pretty', - // Functional test suite(s) to run in each browser once non-functional tests are completed - functionalSuites: [ 'tests/functional' ], + // Unless you pass in a command-line arg saying otherwise, we run all tests by default. + functionalSuites: [ 'tests/functional-all' ], // A regular expression matching URLs to files that should not be included in code coverage analysis excludeInstrumentation: /./