43
edits
Darkspirit (talk | contribs) (Replaced ftp and http with https where it didn't make things worse.) |
|||
| (39 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
Back To ==> [[QA/Browser_Technologies/Services | Mozilla BT Services]] | Back To ==> [[QA/Browser_Technologies/Services | Mozilla BT Services]] | ||
== Instructions for doing a basic install of BrowserID on Mac or Linux == | == Instructions for doing a basic install of Persona/BrowserID on Mac or Linux == | ||
Latest information: | Latest information: | ||
* Original installs were done with node v0.4.x | * Original installs were done with node v0.4.x | ||
* New installs are being done with node v0.6.x | * New installs are being done with node v0.6.x | ||
* | * As of March 2013, we are using v0.8.17 | ||
* BrowserID now has a requirement for expat-devel library | * Persona/BrowserID now has a requirement for expat-devel library | ||
** sudo yum -y install expat-devel for CentOS/Fedora/RHEL | ** sudo yum -y install expat-devel for CentOS/Fedora/RHEL | ||
** similar for Ubuntu (apt-get install) | ** similar for Ubuntu (apt-get install) | ||
| Line 20: | Line 20: | ||
* npm | * npm | ||
* git | * git | ||
* gmp-devel | * gmp-devel | ||
* gettext and msgfmt for locale installs and testing | * gettext and msgfmt for locale installs and testing | ||
* svn for locale installs | |||
* phantomjs for testing | |||
* mysql for testing | |||
* Mac Notes: | |||
** Mac OS should already have the first four, so you should only need to install node, npm, git, etc. before installing Persona/BrowserID. | |||
** With the latest versions of Mac OS and XCode, the command line tools are not downloaded/installed by default. You must explicitly download them through Xcode > Preferences > Downloads. | |||
* Linux Notes: | |||
So, if your version/flavor of Linux does not have these installed by default, proceed with installations typical for your Linux | ** With the latest CentOS 6 used for the Linux portion of this document, the following packages were already installed: gcc, g++, make, openssl, git | ||
** So, if your version/flavor of Linux does not have these installed by default, proceed with installations typical for your Linux. | |||
== Installing Node.js and NPM == | == Installing Node.js and NPM == | ||
* Use the very latest node/npm install to maximize compatibility with gmp and BrowserID: | * Use the very latest node/npm install to maximize compatibility with gmp and Persona/BrowserID: | ||
For example: node v0.6.5 with npm 1.1.0-alpha-6 | For example: node v0.6.5 with npm 1.1.0-alpha-6 | ||
* Node can be installed from here: | * Node can be installed from here: | ||
https://nodejs.org/dist/ | |||
Example: | Example: https://nodejs.org/dist/v0.6.5/node-v0.6.5.tar.gz | ||
unzip/untar the files | unzip/untar the files | ||
Follow the README.md file to build/install node v0.6.5 (as root): | Follow the README.md file to build/install node v0.6.5 (as root): | ||
| Line 56: | Line 58: | ||
== Installing Git on Mac == | == Installing Git on Mac == | ||
* The Mac Git application is available here | * The Mac Git application is available here | ||
https://code.google.com/p/git-osx-installer/downloads/list | |||
* Select the latest for your version of Mac OS | * Select the latest for your version of Mac OS | ||
| Line 83: | Line 85: | ||
== Installing gmp on Mac == | == Installing gmp on Mac == | ||
* There | * NOTE: It should be possible to install the latest libgmp package, which can be found here: https://gmplib.org/download/ (Using a node Mac package is NOT recommended.) | ||
* (OLD INFORMATION) There were compatibility issues with using gmp and npm on Mac. The recommendation was to use an older gmp package with the very latest node/npm bundle. | |||
* Go through all four installation steps to ensure a decent gmp install | * Go through all four installation steps to ensure a decent gmp install | ||
| Line 103: | Line 97: | ||
== Installing phantomjs on Mac == | == Installing phantomjs on Mac == | ||
Grab the latest phantomjs package from here: | Grab the latest phantomjs package from here: | ||
https://code.google.com/p/phantomjs/downloads/list | |||
Example: | Example: | ||
https://phantomjs.googlecode.com/files/phantomjs-1.5.0-macosx-static.zip | |||
Unzip the file | Unzip the file | ||
| Line 116: | Line 110: | ||
== Installing gmp/gmp-devel on Linux == | == Installing gmp/gmp-devel on Linux == | ||
* There | * NOTE: It should be possible to install the latest libgmp package, which can be found here: https://gmplib.org/#DOWNLOAD | ||
* (OLD INFORMATION) There were compatibility issues with using gmp and npm on Linux, also. The recommendation was to use an older gmp package with the very latest node/npm bundle. | |||
* Go through all four installation steps to ensure a decent gmp install | * Go through all four installation steps to ensure a decent gmp install | ||
./configure | ./configure | ||
| Line 140: | Line 129: | ||
* There is a binary package now for phantomjs that can be downloaded and used on Linux, including RHEL 6, CentOS 6, and Ubuntu 11 | * There is a binary package now for phantomjs that can be downloaded and used on Linux, including RHEL 6, CentOS 6, and Ubuntu 11 | ||
* See the following sites for more information: | * See the following sites for more information: | ||
** | ** https://code.google.com/p/phantomjs/wiki/Installation | ||
** | ** https://code.google.com/p/phantomjs/downloads/list | ||
Install the latest version of phantomjs | Install the latest version of phantomjs | ||
Example: | Example: | ||
wget | wget https://phantomjs.googlecode.com/files/phantomjs-1.5.0-linux-x86_64-dynamic.tar.gz | ||
gunzip and tar xvf the file | gunzip and tar xvf the file | ||
| Line 153: | Line 142: | ||
Make sure /usr/local/bin is in your path | Make sure /usr/local/bin is in your path | ||
== Installing BrowserID == | == Installing Persona/BrowserID == | ||
* From your home directory, run the following | * From your home directory, run the following | ||
$ git clone git://github.com/mozilla/browserid | $ git clone git://github.com/mozilla/browserid | ||
| Line 177: | Line 166: | ||
$ npm install | $ npm install | ||
== Installing BrowserID from RPMs == | == Installing Persona/BrowserID from RPMs == | ||
* Content to be added soon-ish... | * Content to be added soon-ish... | ||
== Installing BrowserID with support for Locales == | == Installing Persona/BrowserID with support for Locales == | ||
* In order to run localized versions of BrowserID (localized strings), the following apps/libs must first be installed: svn, gettext (which should include xgettext, msgfmt, etc.). | * NOTE: This entire section is out of date. See the following links for more information: | ||
** https://github.com/mozilla/anodejsholidayseason/blob/localization/localization/localization_part_1.md | |||
** https://github.com/mozilla/anodejsholidayseason/blob/localization/localization/localization_part_2.md | |||
** https://github.com/mozilla/anodejsholidayseason/blob/localization/localization/localization_part_3.md | |||
* In order to run localized versions of Persona/BrowserID (localized strings), the following apps/libs must first be installed: svn, gettext (which should include xgettext, msgfmt, etc.). | |||
** Ubuntu: sudo apt-get install svn gettext | ** Ubuntu: sudo apt-get install svn gettext | ||
** RHEL/Fedora/CentOS: sudo yum -y install svn gettext | ** RHEL/Fedora/CentOS: sudo yum -y install svn gettext | ||
** Mac: use Ports, Homebrew, or install from here: | ** Mac: use Ports, Homebrew, or install from here: | ||
https://ftp.gnu.org/pub/gnu/gettext/ | |||
Make sure that the gettext/msgfmt bin directory is added to your path | Make sure that the gettext/msgfmt bin directory is added to your path | ||
* If XCode is installed, svn should already be available | * If XCode is installed, svn should already be available | ||
* Continue with the installation of BrowserID: | * Continue with the installation of Persona/BrowserID: | ||
git clone git://github.com/mozilla/browserid | git clone git://github.com/mozilla/browserid | ||
cd browserid | cd browserid | ||
| Line 203: | Line 196: | ||
* or check the locale listing in the browserid/locale directory | * or check the locale listing in the browserid/locale directory | ||
== Running BrowserID == | == Running Persona/BrowserID == | ||
* Run the following command to start up the BrowserID services | * Run the following command to start up the Persona/BrowserID services | ||
$ npm start | $ npm start | ||
| Line 211: | Line 204: | ||
browserid (2379): error: Cannot read database from /<YOUR INSTALL DIR>/browserid/var/authdb.json | browserid (2379): error: Cannot read database from /<YOUR INSTALL DIR>/browserid/var/authdb.json | ||
* This is OK, since there may be no current DB for BrowserID and one has to be made on first use. | * This is OK, since there may be no current DB for Persona/BrowserID and one has to be made on first use. | ||
* You should also see that the following services have started: | * You should also see that the following services have started: | ||
verifier | verifier running on http://127.0.0.1:10000 | ||
RP | RP/client running on http://127.0.0.1:10001 | ||
browserid server at http://127.0.0.1:10002 (router) | |||
keysigner | keysigner running on http://127.0.0.1:10003 | ||
dbwriter: | dbwriter running on http://127.0.0.1:10004 | ||
primary running on http://127.0.0.1:10005 | |||
proxy running on http://127.0.0.1:10006 | |||
browserid running on http://127.0.0.1:10007 | |||
nothing for 10008, 10009 | |||
static running on http://127.0.0.1:10010 | |||
Delegated Primary running on http://127.0.0.1:10011 | |||
* Finally, you will also notice that your prompt did not come back. While the servers are running, all messages will go to STDOUT/STDERR as well as the following logs | * Finally, you will also notice that your prompt did not come back. While the servers are running, all messages will go to STDOUT/STDERR as well as the following logs | ||
/<YOUR INSTALL DIR>/browserid/var/log/browserid.log | /<YOUR INSTALL DIR>/browserid/var/log/browserid.log | ||
/<YOUR INSTALL DIR>/browserid/var/log/compress.log | |||
/<YOUR INSTALL DIR>/browserid/var/log/compress-worker.log | |||
/<YOUR INSTALL DIR>/browserid/var/log/dbwriter.log | /<YOUR INSTALL DIR>/browserid/var/log/dbwriter.log | ||
/<YOUR INSTALL DIR>/browserid/var/log/keysigner-compute.log | /<YOUR INSTALL DIR>/browserid/var/log/keysigner-compute.log | ||
/<YOUR INSTALL DIR>/browserid/var/log/keysigner.log | /<YOUR INSTALL DIR>/browserid/var/log/keysigner.log | ||
/<YOUR INSTALL DIR>/browserid/var/log/proxy.log | /<YOUR INSTALL DIR>/browserid/var/log/proxy.log | ||
/<YOUR INSTALL DIR>/browserid/var/log/router.log | |||
/<YOUR INSTALL DIR>/browserid/var/log/router-metrics.json | |||
/<YOUR INSTALL DIR>/browserid/var/log/run_locally.log | /<YOUR INSTALL DIR>/browserid/var/log/run_locally.log | ||
/<YOUR INSTALL DIR>/browserid/var/log/static.log | |||
/<YOUR INSTALL DIR>/browserid/var/log/test_db_connectivity.log | /<YOUR INSTALL DIR>/browserid/var/log/test_db_connectivity.log | ||
/<YOUR INSTALL DIR>/browserid/var/log/test_frontend.log | |||
/<YOUR INSTALL DIR>/browserid/var/log/verifier-compute.log | /<YOUR INSTALL DIR>/browserid/var/log/verifier-compute.log | ||
/<YOUR INSTALL DIR>/browserid/var/log/verifier.log | |||
/<YOUR INSTALL DIR>/browserid/var/log/verifier-metrics.json | /<YOUR INSTALL DIR>/browserid/var/log/verifier-metrics.json | ||
/<YOUR INSTALL DIR>/browserid/var/log/vows.log | /<YOUR INSTALL DIR>/browserid/var/log/vows.log | ||
| Line 241: | Line 243: | ||
IP_ADDRESS=<YOUR LOCAL IP> nohup npm start 1>> MYLog.log 2>>MYLog.log & | IP_ADDRESS=<YOUR LOCAL IP> nohup npm start 1>> MYLog.log 2>>MYLog.log & | ||
== Using BrowserID == | == Using Persona/BrowserID == | ||
* To create an account and sign in and out, use the client address and port | * To create an account and sign in and out, use the client address and port | ||
http://127.0.0.1:10001 | http://127.0.0.1:10001 | ||
| Line 250: | Line 252: | ||
* Note: the keysigner, verifier, and dbwriter are active behind the scenes, so no user interaction is needed here. | * Note: the keysigner, verifier, and dbwriter are active behind the scenes, so no user interaction is needed here. | ||
* You can use this "client" and this server as you would the Beta or Production BrowserID environments. The only missing element is the "content" of the client site, which, in this case, is basically limited to creation, signing in, adding emails, signing out, etc. | * You can use this "client" and this server as you would the Beta or Production Persona/BrowserID environments. The only missing element is the "content" of the client site, which, in this case, is basically limited to creation, signing in, adding emails, signing out, etc. | ||
== Creating and Using BrowserID Accounts == | == Creating and Using Persona/BrowserID Accounts == | ||
* You can create an account on the client (http://127.0.0.1:10001/) or onthe server (http://127.0.0.1:10001/). | * You can create an account on the client (http://127.0.0.1:10001/) or onthe server (http://127.0.0.1:10001/). | ||
* The email verification does not actually get sent because there is nothing hooked up to do this. | * The email verification does not actually get sent because there is nothing hooked up to do this. | ||
| Line 271: | Line 273: | ||
== Client Site Information == | == Client Site Information == | ||
* Client site: http://127.0.0.1:10001/ | * Client site: http://127.0.0.1:10001/ | ||
* This site now allows | * This site now allows the following types of RP activity (assertions): | ||
** | ** Supply a privacy policy | ||
** | ** Supply a ToS | ||
** | ** Supply Site Name | ||
** | ** Supply Site Logo | ||
** Supply returnTo | |||
* To see what is actually happening, track the events and messages in the console log (STDOUT/STDERR) | * To see what is actually happening, track the events and messages in the console log (STDOUT/STDERR) | ||
| Line 292: | Line 295: | ||
== Logging == | == Logging == | ||
* The BrowserID logs exist in your browserid/var/log directory | * The Persona/BrowserID logs exist in your browserid/var/log directory | ||
browserid.log | browserid.log | ||
compress.log | |||
compress-worker.log | |||
dbwriter.log | dbwriter.log | ||
keysigner-compute.log | keysigner-compute.log | ||
proxy.log | keysigner.log | ||
proxy.log | |||
router.log | |||
router-metrics.json | |||
run_locally.log | run_locally.log | ||
static.log | |||
test_db_connectivity.log | test_db_connectivity.log | ||
test_frontend.log | |||
verifier-compute.log | verifier-compute.log | ||
verifier.log | |||
verifier-metrics.json | verifier-metrics.json | ||
vows.log | vows.log | ||
databases: n/a | |||
zeus: various logs | |||
* Note: router-metrics.json replaces browserid-metrics.json | |||
* Note: These logs now have time/date stamps. | * Note: These logs now have time/date stamps. | ||
== BrowserID Processes == | == Persona/BrowserID Processes == | ||
* If you search for "node" processes, you will see that seven are actively running: | * If you search for "node" processes, you will see that seven are actively running: | ||
node ./scripts/run_locally.js | node ./scripts/run_locally.js | ||
node / | node /<YOUR INSTALL DIR>/browserid/bin/verifier | ||
node / | node /<YOUR INSTALL DIR>/browserid/bin/keysigner | ||
node /<YOUR INSTALL DIR>/browserid/bin/dbwriter | |||
node /<YOUR INSTALL DIR>/browserid/scripts/serve_example.js | |||
node /<YOUR INSTALL DIR>/browserid/scripts/serve_example_primary.js | |||
node /<YOUR INSTALL DIR>/browserid/bin/proxy | |||
node /<YOUR INSTALL DIR>/browserid/bin/browserid | |||
node /<YOUR INSTALL DIR>/browserid/bin/router | |||
node /<YOUR INSTALL DIR>/browserid/bin/static | |||
== Quitting BrowserID == | == Quitting Persona/BrowserID == | ||
* Hitting CTRL-c from the terminal window where you ran "npm start" should kill all "node" processes. | * Hitting CTRL-c from the terminal window where you ran "npm start" should kill all "node" processes. | ||
* If you are running from the background (for example to trap all STDOUT and STDERR messages), just look for and kill the following process: | * If you are running from the background (for example to trap all STDOUT and STDERR messages), just look for and kill the following process: | ||
| Line 336: | Line 337: | ||
* If either method does not clean up after itself, you may need to manually kill the remaining node processes: | * If either method does not clean up after itself, you may need to manually kill the remaining node processes: | ||
$ ps aux | grep node | $ ps aux | grep node | ||
== Installing MySQL and MySQL Server == | |||
* MySQL is a prerequisite for running the unit tests and load_gen on a local install. | |||
Use any common method for installing mysql and mysql-server packages to the local environment: Mac or Linux | |||
Example: sudo yum install mysql mysql-server | |||
Start up mysql and set to load/restart automatically | |||
Example: sudo /etc/init.d/mysqld start; sudo chkconfig --levels 235 mysqld on | |||
As "root", create a "browserid" user with full privileges and no password | |||
mysql -u root -p | |||
CREATE DATABASE test_mysql; | |||
GRANT ALL PRIVILEGES ON *.* TO 'browserid'@'localhost'; | |||
UPDATE mysql.user SET Password=PASSWORD('browserid') WHERE User = 'browserid'; | |||
FLUSH PRIVILEGES; | |||
\quit | |||
* More details can be found on the following site: | |||
** https://github.com/mozilla/browserid/blob/dev/docs/TESTING.md | |||
* Alternatively, environment variables can be used to run the unit tests with mysql support (assuming mysql is installed and running): | |||
NODE_ENV=test_mysql MYSQL_USER=browserid MYSQL_PASSWORD=browserid npm test | |||
== Running Unit Tests == | == Running Unit Tests == | ||
* The front-end, back-end, and "headless" unit tests can be run from a local install of BrowserID. | * The front-end, back-end, and "headless" unit tests can be run from a local install of Persona/BrowserID. | ||
* The back-end and "headless" unit tests have now been combined and can be run with the single command "npm test" | * The back-end and "headless" unit tests have now been combined and can be run with the single command "npm test" | ||
* Also the updated back-end unit tests now use phantomjs, so following the instructions in the previous sections for installing it and setting the path. | * Also the updated back-end unit tests now use phantomjs, so following the instructions in the previous sections for installing it and setting the path. | ||
| Line 353: | Line 374: | ||
http://<YOUR LOCAL IP>:10002/test/ | http://<YOUR LOCAL IP>:10002/test/ | ||
Example: http://50.50.50.50:10002/test/ | Example: http://50.50.50.50:10002/test/ | ||
(where 10002 is port value for local BrowserID server/PIA/IP) | (where 10002 is port value for local Persona/BrowserID server/PIA/IP) | ||
* You can use this IP and the running BrowserID instance to execute the unit tests in any browser on your desktop, a VM, or other machines that can see the desktop/IP. | * You can use this IP and the running Persona/BrowserID instance to execute the unit tests in any browser on your desktop, a VM, or other machines that can see the desktop/IP. | ||
* Note: you can no longer run the front-end unit tests against Stage or Prod. You can still run them against Dev | * Note: you can no longer run the front-end unit tests against Stage or Prod. You can still run them against Dev | ||
| Line 362: | Line 383: | ||
* Unit test location in code (and GitHub) | * Unit test location in code (and GitHub) | ||
browserid/resources/static/test/qunit | browserid/resources/static/test/qunit | ||
* For more information on filter arguments for the front-end unit tests, see the following site: | |||
** https://github.com/mozilla/browserid/blob/dev/docs/TESTING.md | |||
=== Back-End Unit Tests with PhantomJS and MySQL Support === | === Back-End Unit Tests with PhantomJS and MySQL Support === | ||
| Line 371: | Line 395: | ||
* Make sure that phantomjs is installed and the path has been set before running these (see notes in the previous sections) | * Make sure that phantomjs is installed and the path has been set before running these (see notes in the previous sections) | ||
* Make sure that mysql is installed and running with a test user and test db already created (see the next section) | * Make sure that mysql is installed and running with a test user and test db already created (see the next section) | ||
* Further details on command line options and filters can be found here: | |||
** https://github.com/mozilla/browserid/blob/dev/docs/TESTING.md | |||
* Unit test location in code (and GitHub) | * Unit test location in code (and GitHub) | ||
| Line 377: | Line 404: | ||
* Note: the Back-End Unit Tests can not be run on Stage or Prod due to the focused server-style RPM install and the limited permissions for QA. | * Note: the Back-End Unit Tests can not be run on Stage or Prod due to the focused server-style RPM install and the limited permissions for QA. | ||
== | == Running the Automation Tests == | ||
* | * Selenium-style automation tests can be run from any local install of Persona/BrowserID. The tests use a standalone selenium server (downloaded separately) | ||
* The automation tests can be found in the following directory: | |||
** browserid/automation-tests/scripts | |||
* The main script will start up a local instance of FireFox (or whatever browser is chosen) to run the client-based automated tests. | |||
* Basic instructions | |||
** Download the standalone Selenium server from the following site | |||
https://selenium.googlecode.com | |||
Example: curl -O https://selenium.googlecode.com/files/selenium-server-standalone-2.31.0.jar | |||
** In one terminal, run the server | |||
java -jar selenium-server-standalone-2.31.0.jar | |||
** An example using the chrome driver support | |||
exec java -Dwebdriver.chrome.driver=/<PATH TO DRIVER>/chromedriver | |||
-jar /<PATH TO JAR>/selenium-server-standalone-2.301.0.jar | |||
** Open another terminal to run the automated tests | |||
cd browserid/automation-tests/scripts | |||
./scripts/run-all.js --help | |||
will give you the current list of all automation commands | |||
./scripts/run-all.js --local --list-platforms | |||
will give you the current list of all supported platforms on the local host | |||
(this is a generic list that assumes all/any browser(s) can be run on the local host) | |||
Edit the following file to change/update this list, including adding support for all FireFox channels: | |||
browserid/automation-tests/config/local-platform.js | |||
./scripts/run-all.js --list-platforms | |||
will give you the current list of all supported platforms for running against sauce labs | |||
(this list should not be updated) | |||
By default, the automation tests only run against the FireFox browser (any current version | |||
on any current OS) without the use of a special browser driver. | |||
See the following site for more information on downloading drivers to support other browsers: | |||
https://docs.seleniumhq.org/download/ | |||
NOTE: As of Selenium webdriver 2.31, Safari and Opera should have built-in support. | |||
The webdrivers for IE and Google Chrome are still required. | |||
./scripts/run-all.js --list-tests | |||
will give you the current list of all automated tests than can be run singly or together | |||
./scripts/run-all.js --env <other options here> | |||
will allow you to change which environment you test: dev, stage, prod (the default is dev) | |||
* Examples against local host | |||
One test, one browser, locally: | |||
./scripts/run-all.js --local --platform=firefox --tests change-password-test | |||
./scripts/run-all.js --local --platform=linux --tests change-password-test | |||
All tests, one browser, locally: | |||
./scripts/run-all.js --local --platform=firefox-aurora | |||
All tests, one browser, locally, against stage: | |||
./scripts/run-all.js --local --env stage --platform=firefox-beta | |||
* Examples against sauce labs | |||
One test, one browser: | |||
./scripts/run-all.js --platform=osx_firefox_19 --tests change-password-test | |||
./scripts/run-all.js --platform=linux_opera_12 --tests change-password-test | |||
All tests, one browser: | |||
./scripts/run-all.js --platform=win7_chrome | |||
All tests, all browsers: | |||
./scripts/run-all.js --platform=all | |||
* Notes: | |||
** If you have multiple versions of Firefox installed on your system, you can tweak the local-platform.js file and add each version as an entry (see the comment in the file for an example) | |||
** The current list of supported platforms for Sauce labs can always be found here: browserid/automation-tests/config/sauce-platforms.js file | |||
** The local host tests will create a significant amount of information that can be seen in the STDOUT/STDERR of the stand-alone server. Therefore, it might be helpful to redirect both to a log file. | |||
** Sauce Labs failures will generate an error link similar to the following: https://saucelabs.com/jobs/<Some Test ID>. Clicking on the link will give some detail to the failure(s) generated from the preceding automation test run. | |||
** The --output xunit flag can also be used to generate a live link for the sauce labs run | |||
* | * For more information, see the following links: | ||
** Automation test information: https://github.com/mozilla/browserid/tree/dev/automation-tests | |||
** Automation tests: https://github.com/mozilla/browserid/tree/dev/automation-tests/tests | |||
** Selenium components and information on browser drivers: https://docs.seleniumhq.org/download/ | |||
** Documentation: https://github.com/mozilla/browserid/wiki/Automated-Browser-Testing | |||
** Persona Test Plan: https://wiki.mozilla.org/QA/BrowserID/TestPlan | |||
== The load_gen Application == | == The load_gen Application == | ||
* load_gen flags/parameters | * load_gen flags/parameters | ||
-a, --activities only run a subset of activities, specified as a CSV list | |||
-h, --help display this usage message | |||
-l, --list list available activities and exit | |||
-m, --max maximum active users to simulate (0 == infinite) [default: 10000] | |||
-o, --omit-static when enabled, only dynamic WSAPI calls will be simulated, not | |||
static resource requests [default: false] | |||
-i, --interaction-data sort of like `data_sample_rate` (set to 0 to send nothing) [default: 0.1] | |||
-s, --server base URL to browserid server [string] | |||
-v, --verifier base URL to verifier service (default is browserid server + '/verify') | |||
-u, --user-range rather than creating users, assume a range of users exist #@loadtest.domain | |||
(with password "THE PASSWORD") | |||
* Standard Usage | * Standard Usage | ||
| Line 412: | Line 500: | ||
== Running a Load Test on the localhost == | == Running a Load Test on the localhost == | ||
* Start up BrowserID with some required environment variables | * Start up Persona/BrowserID with some required environment variables | ||
CREATE_TEST_USERS=2000 BROWSERID_FAKE_VERIFICATION=1 NODE_ENV=test_mysql npm start | CREATE_TEST_USERS=2000 BROWSERID_FAKE_VERIFICATION=1 NODE_ENV=test_mysql npm start | ||
* This will start BrowserID and create a test set of 2000 users and make use of a test mysql database. | * This will start Persona/BrowserID and create a test set of 2000 users and make use of a test mysql database. | ||
* In another terminal start up the load_gen application | * In another terminal start up the load_gen application | ||
| Line 420: | Line 508: | ||
* Redirecting STDOUT and STDERR | * Redirecting STDOUT and STDERR | ||
Example for BrowserID: | Example for Persona/BrowserID: | ||
CREATE_TEST_USERS=2000 BROWSERID_FAKE_VERIFICATION=1 NODE_ENV=test_mysql nohup npm start 1>> NPM1.log 2>>NPM1.log & | CREATE_TEST_USERS=2000 BROWSERID_FAKE_VERIFICATION=1 NODE_ENV=test_mysql nohup npm start 1>> NPM1.log 2>>NPM1.log & | ||
Example for load_gen: | Example for load_gen: | ||
| Line 446: | Line 534: | ||
* Error tracking | * Error tracking | ||
** Standard HTTP messages and BrowserID messages (info, debug, warn, error) can be tracked from the STDOUT of "npm start" | ** Standard HTTP messages and Persona/BrowserID messages (info, debug, warn, error) can be tracked from the STDOUT of "npm start" | ||
** Specific types of BrowserID activity and errors can be tracked from the STDOUT of "load_gen" | ** Specific types of Persona/BrowserID activity and errors can be tracked from the STDOUT of "load_gen" | ||
*** Examples: | *** Examples: | ||
*** error: can't certify key: non-200 status: 400NaNBad Request: that email does not belong to you | *** error: can't certify key: non-200 status: 400NaNBad Request: that email does not belong to you | ||
edits