Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
End 2 end tests #134
End 2 end tests #134
Conversation
| @@ -3,11 +3,10 @@ node_modules | |||
| .dockerignore | |||
| .editorconfig | |||
| .env | |||
| .eslintignore | |||
| .eslintrc | |||
maxbeatty
Jul 12, 2016
Author
Member
want these to be included in the e2e_runner container so lab can lint e2e test files
want these to be included in the e2e_runner container so lab can lint e2e test files
| @@ -1,2 +1,3 @@ | |||
| node_modules | |||
| public/_js | |||
| tmp* | |||
maxbeatty
Jul 12, 2016
Author
Member
the custom firefox profile creates a temporary directory with JS that lab tries to lint so ignoring that
the custom firefox profile creates a temporary directory with JS that lab tries to lint so ignoring that
| WORKDIR /code | ||
|
|
||
| COPY ./package.json /code/package.json |
maxbeatty
Jul 12, 2016
Author
Member
npm install wasn't being cached for me when using ADD. Docker now encourages COPY instead of ADD
npm install wasn't being cached for me when using ADD. Docker now encourages COPY instead of ADD
| @@ -0,0 +1,13 @@ | |||
| FROM mhart/alpine-node:5.11.1 | |||
maxbeatty
Jul 12, 2016
Author
Member
this alpine image is 95 MB compared to the main node image which is 749 MB. should consider using in another branch where change is more isolated
this alpine image is 95 MB compared to the main node image which is 749 MB. should consider using in another branch where change is more isolated
| @@ -12,12 +12,12 @@ web: | |||
| SERVICE_3000_CHECK_HTTP: '/health' | |||
| SERVICE_3000_CHECK_INTERVAL: '1s' | |||
| db: | |||
| image: mysql | |||
| image: mysql:5.7 | |||
maxbeatty
Jul 12, 2016
Author
Member
locking down version
locking down version
| volumes_from: | ||
| - data-jsperf-mysql | ||
| env_file: .env | ||
| environment: | ||
| MYSQL_RANDOM_ROOT_PASSWORD: 'True' | ||
| MYSQL_RANDOM_ROOT_PASSWORD: 'yes' |
| @@ -6,10 +6,9 @@ | |||
| "scripts": { | |||
| "clean": "rm npm-debug.log lcov.info coverage.html", | |||
| "lint": "lab -d -L", | |||
| "setup": "node setup", | |||
| "shrinkwrap": "npm-shrinkwrap", | |||
maxbeatty
Jul 12, 2016
Author
Member
npm@3 solved a lot of the problems npm-shrinkwrap was solving
npm@3 solved a lot of the problems npm-shrinkwrap was solving
| @@ -38,7 +37,7 @@ | |||
| "good": "^5.1.2", | |||
| "good-console": "^4.1.0", | |||
| "handlebars": "^3.0.0", | |||
| "hapi": "^8.2.0", | |||
| "hapi": "8.6.1", | |||
maxbeatty
Jul 12, 2016
Author
Member
at one point, hapi@8.8.x was installed and shot (used for request injection during testing) broke. locking this down to prevent bad installs
at one point, hapi@8.8.x was installed and shot (used for request injection during testing) broke. locking this down to prevent bad installs
| "eslint-config-standard": "5.3.5", | ||
| "eslint-plugin-promise": "1.3.2", | ||
| "eslint-plugin-standard": "1.3.3", | ||
| "lab": "10.9.0", |
maxbeatty
Jul 12, 2016
Author
Member
originally upgraded this to see if my problem with building a web driver in beforeEach would be fixed (it wasn't) but when other lab changes weren't needed, I kept it. upgrades eslint configs should give us more ES2015 goodness
originally upgraded this to see if my problem with building a web driver in beforeEach would be fixed (it wasn't) but when other lab changes weren't needed, I kept it. upgrades eslint configs should give us more ES2015 goodness
| "prompt": "^0.2.14", | ||
| "proxyquire": "^1.4.0", | ||
| "selenium-webdriver": "2.47.0", |
| @@ -85,5 +85,5 @@ module.exports = { | |||
| // resource path | |||
| '(?:/\\S*)?' + '$', | |||
| slug: '[A-Za-z0-9](?:-?[A-Za-z0-9])*', | |||
| script: '(<script[^>]*?>)([\\s\\S]*?)(<\/script>)' | |||
| script: '(<script[^>]*?>)([\\s\\S]*?)(</script>)' | |||
maxbeatty
Jul 12, 2016
Author
Member
updated eslint config caught unneeded escape
updated eslint config caught unneeded escape
| @@ -15,7 +15,7 @@ exports.register = function (server, options, next) { | |||
| return reply.view('errors/' + statusCode).code(statusCode); | |||
| } else { | |||
| debug(request.response); | |||
| return reply.view('errors/general'); | |||
| return reply.view('errors/general').code(500); | |||
maxbeatty
Jul 12, 2016
Author
Member
our general error wasn't actually reporting as being unhealthy so even if mysql wasn't reachable we were reporting to consul that it was still healthy causing the node to stay in nginx's rotation. now, it'll report a 500 so consul will take it out of rotation and nginx will send 502 if none available.
our general error wasn't actually reporting as being unhealthy so even if mysql wasn't reachable we were reporting to consul that it was still healthy causing the node to stay in nginx's rotation. now, it'll report a 500 so consul will take it out of rotation and nginx will send 502 if none available.
| const lab = exports.lab = Lab.script(); | ||
|
|
||
| lab.experiment('FAQ page', () => { | ||
| // FIXME: cannot figure out why this doesn't work |
maxbeatty
Jul 12, 2016
Author
Member
would love to know why this doesn't work. always times out for me
would love to know why this doesn't work. always times out for me
| @@ -1,7 +1,7 @@ | |||
| var Lab = require('lab'); | |||
| var Code = require('code'); | |||
| var Proxyquire = require('proxyquire'); | |||
| var Config = Proxyquire('../config', { | |||
| var Config = Proxyquire('../../config', { | |||
maxbeatty
Jul 12, 2016
Author
Member
here begins all of the path changes caused by restructuring the tests to be under test/unit. this allows lab to not grep e2e tests when only caring about unit tests
here begins all of the path changes caused by restructuring the tests to be under test/unit. this allows lab to not grep e2e tests when only caring about unit tests
| @@ -228,7 +228,7 @@ lab.experiment('GET', function () { | |||
| }); | |||
| server.inject('/setsession', function (res) { | |||
| var header = res.headers['set-cookie']; | |||
| var cookie = header[0].match(/(?:[^\x00-\x20\(\)<>@\,;\:\\'\/\[\]\?\=\{\}\x7F]+)\s*=\s*(?:([^\x00-\x20\'\,\;\\\x7F]*))/); | |||
| var cookie = header[0].match(/(?:[^\x00-\x20\(\)<>@\,;\:\\'\/\[\]\?\=\{\}\x7F]+)\s*=\s*(?:([^\x00-\x20\'\,\;\\\x7F]*))/); // eslint-disable-line no-control-regex, no-useless-escape | |||
maxbeatty
Jul 12, 2016
Author
Member
didn't have enough regex foo to make eslint happy so ignored individual lines. might be nice to move this in a more managable branch to a reusable module so it's not repeated so often
didn't have enough regex foo to make eslint happy so ignored individual lines. might be nice to move this in a more managable branch to a reusable module so it's not repeated so often

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Now that the app is getting more use and bugs are popping up outside of what unit tests will easily catch, it's time to add some end to end tests (full browser automation).
This uses a new Docker Compose configuration of a Selenium Grid Hub and Selenium Grid Nodes (Firefox because that's built-in) along with the existing Docker Compose containers and lab test framework to run tests locally.
I also updated some of the documentation and steps to get up and running. In order for these to run on Travis, we'll need to modify the setup so it's automated. This PR is already big enough and is going to create merge conflicts for others so may save that for another more manageable branch.