You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-5
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@
13
13
2. Install dependencies: `npm install`
14
14
3. Get a [Browserscope.org](http://www.browserscope.org/) API key by signing in and going to [the settings page](http://www.browserscope.org/user/settings). (You'll need this in the last step)
15
15
4. Register a new OAuth GitHub development application by going to [your settings page in github](https://github.com/settings/applications/new). Take note to copy the "Client ID" and "Client Secret". The callback URL is simply the root url of the application, e.g., `http://localhost:3000`
16
-
5. Setup environment configuration: `npm run setup`
16
+
5. Setup environment configuration: `node setup`
17
17
18
18
### Running the server
19
19
@@ -23,9 +23,13 @@ jsPerf is available at `localhost` and changes to the codebase can be applied by
23
23
24
24
##### One-time Setup
25
25
26
+
_`$MYSQL_PASSWORD` is whatever you chose or generated during `node setup`_
27
+
26
28
1. Install [Docker Toolbox](https://docs.docker.com/engine/installation/) so you have `docker` and `docker-compose`
27
29
2. Create a Data Volume Container to persist data: `docker create -v /var/lib/mysql --name data-jsperf-mysql mysql /bin/true`
28
-
3. After completing the "Compose" steps below, setup database tables with: `docker-compose run web node /code/setup/tables`
30
+
3. Start Docker Compose in detached mode: `MYSQL_PASSWORD=$MYSQL_PASSWORD docker-compose up`
31
+
4. Setup database tables with: `MYSQL_PASSWORD=$MYSQL_PASSWORD docker-compose run web node /code/setup/tables`
32
+
5. Verify everything is working: `open http://$(docker-machine ip)`
29
33
30
34
##### Compose
31
35
@@ -89,19 +93,34 @@ _If you'd just like to lint and save a little time, you can run `npm run lint` w
89
93
90
94
_If you're missing code coverage, open `coverage.html` in the root of the project for a detailed visual report._
91
95
96
+
### End to End
97
+
98
+
End to end (e2e) testing is done with Selenium. There is a separate Docker Compose file to define the Selenium Grid Hub, Selenium Nodes, and the test runner. Running the e2e test suite is a three step process:
2. Start the app along with Selenium: `MYSQL_PASSWORD=$MYSQL_PASSWORD docker-compose -f docker-compose.yml -f docker-compose.e2e.yml up -d`
102
+
- To scale up available Selenium Nodes to make testing faster, run: `docker-compose -f docker-compose.yml -f docker-compose.e2e.yml scale firefox=5` (_5 is the number of VMs Sauce Labs gives open source projects_)
103
+
3. Run the test suite: `docker-compose -f docker-compose.yml -f docker-compose.e2e.yml run --rm runner npm run test-e2e`
104
+
105
+
When you're done, you can safely stop and remove all of the containers by running:
106
+
107
+
```
108
+
docker-compose -f docker-compose.yml -f docker-compose.e2e.yml down
109
+
```
110
+
92
111
## Gotchas
93
112
94
113
- ES6 Template Strings are not supported by esprima which means you can't generate coverage reports which means `npm test` won't pass.
95
114
96
115
### Adding new dependencies
97
116
98
117
1. Install using `npm` and either `--save` or `--save-dev`. Do not edit `package.json` manually.
99
-
2. Run `npm run shrinkwrap` to update `npm-shrinkwrap.json`
118
+
2. Run `npm shrinkwrap --dev` to update `npm-shrinkwrap.json`
100
119
101
-
If you get an error while shrinkwrapping, try removing what you have installed currently, reinstalling based on `package.json` instead of `npm-shrinkwrap.json`, and then shrinkwrap again.
120
+
If you get an error while shrinkwrapping, try pruning your `node_modules` directory by running `npm prune`. If that doesn't work, try removing what you have installed currently, reinstalling based on `package.json` instead of `npm-shrinkwrap.json`, and then shrinkwrap again.
0 commit comments