From 839d030df3c29409c4aa12a5e2d5aee97a76c55a Mon Sep 17 00:00:00 2001 From: Ryan Kelly Date: Fri, 10 Jan 2014 10:53:52 +1100 Subject: [PATCH 1/3] Add Mike Trinkala to authorized_keys on the awsbox. --- scripts/awsbox/post_create.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/awsbox/post_create.sh b/scripts/awsbox/post_create.sh index 527645120..97e609f62 100755 --- a/scripts/awsbox/post_create.sh +++ b/scripts/awsbox/post_create.sh @@ -44,6 +44,10 @@ git checkout 9e009e6f15f28debfb59d3d7787dfc20c50e230f cat *.pub >> /home/ec2-user/.ssh/authorized_keys cd .. rm -rf identity-pubkeys +cat >> /home/ec2-user/.ssh/authorized_keys << EOF +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvyIb/9pablSz0Bf46dpKfWfxyL1Ui5Ypo1LOdmesUYxW4kUE3eQpc7bAPP8wVEFUixQR908p94M1FORICzc8mrOG/0l8Vu+B86kYML+Z0Rjtjn+NDXyY8BUKhGapTLnyZh7BiV5RlUN/JBUYtIYzj1Y5yS58LdbFdhzt7MQmcBklfwkN7fzbpf/E1Fv5CcWnr0TvFsz8wSueoh0vepiHKVYgym3HnUTqnF8opUL3i4mrKftZi0PPg4t6YxIgu8ZKj8yGin0eNtwJhjE3dO9WBXGDYcLv8Ps7Ny9chymeJljRJ/QNtJXt6XxLGZdagehTjj3/uz14WEGr7i5bZJRjjw== trink@mozilla.com +EOF + echo "Cleaning up old logfiles" From 3e18f54a3944b462cd4157529eeadc87ea6da245 Mon Sep 17 00:00:00 2001 From: Zachary Carter Date: Thu, 9 Jan 2014 11:25:16 -0800 Subject: [PATCH 2/3] Move things around to handle awsbox deploy --- Gruntfile.js | 2 +- package.json | 25 +++++++++++++------------ scripts/awsbox/post_deploy.sh | 2 ++ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 2c7c18b44..5106c5951 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -28,7 +28,7 @@ module.exports = function (grunt) { // show elapsed time at the end require('time-grunt')(grunt); // load all grunt tasks - require('load-grunt-tasks')(grunt); + require('load-grunt-tasks')(grunt, {scope: 'dependencies'}); grunt.initConfig({ }); diff --git a/package.json b/package.json index 4f54923ae..316478d6a 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,8 @@ "author": "Mozilla (https://mozilla.org/)", "license": "MPL 2.0", "dependencies": { + "bower": "1.2.8", + "jshint": "0.9.1", "connect-cachify": "0.0.15", "convict": "0.4.0", "express": "3.3.4", @@ -24,14 +26,6 @@ "jwcrypto": "0.4.3", "intel": "0.4.0", "helmet": "0.1.2", - "connect-fonts": "0.0.12", - "connect-fonts-firasans": "0.0.2", - "connect-fonts-clearsans": "0.0.1" - }, - "devDependencies": { - "bower": "1.2.8", - "awsbox": "0.6.2", - "jshint": "0.9.1", "grunt": "~0.4.1", "grunt-contrib-copy": "~0.4.1", "grunt-contrib-concat": "~0.3.0", @@ -53,11 +47,18 @@ "grunt-requirejs": "~0.4.0", "grunt-svgmin": "~0.2.0", "grunt-concurrent": "~0.3.0", - "load-grunt-tasks": "~0.1.0", - "time-grunt": "~0.1.1", - "intern-geezer": "1.3.2", - "jshint-stylish": "~0.1.4", "grunt-preprocess": "~3.0.1", + "load-grunt-tasks": "0.2.1", + "time-grunt": "~0.1.1", + "jshint-stylish": "~0.1.4", + "connect-fonts": "0.0.12", + "connect-fonts-firasans": "0.0.2", + "connect-fonts-clearsans": "0.0.1", + "grunt-cli": "0.1.11" + }, + "devDependencies": { + "awsbox": "0.6.2", + "intern-geezer": "1.3.2", "xmlhttprequest": "git://github.com/zaach/node-XMLHttpRequest.git#onerror" }, "engines": { diff --git a/scripts/awsbox/post_deploy.sh b/scripts/awsbox/post_deploy.sh index 71259c0ee..984f96e45 100755 --- a/scripts/awsbox/post_deploy.sh +++ b/scripts/awsbox/post_deploy.sh @@ -10,4 +10,6 @@ else nohup /usr/bin/circusd --daemon /home/app/circus.ini > /home/app/circusd.log 2>&1 & fi +node_modules/.bin/grunt build + echo "DONE" From 11be9bbe396e975c2aa4303e6652fe104e39684f Mon Sep 17 00:00:00 2001 From: vladikoff Date: Thu, 9 Jan 2014 21:52:33 -0500 Subject: [PATCH 3/3] Removing fxa-js-client build step --- .travis.yml | 4 - app/scripts/main.js | 2 +- bower.json | 2 +- package.json | 5 +- tests/functional/birthday.js | 138 ++++++++++++-------- tests/functional/complete_sign_up.js | 4 +- tests/functional/sign_in.js | 2 +- tests/intern.js | 2 +- tests/intern_browser.js | 15 +++ tests/{intern_remote.js => intern_sauce.js} | 0 10 files changed, 104 insertions(+), 70 deletions(-) create mode 100644 tests/intern_browser.js rename tests/{intern_remote.js => intern_sauce.js} (100%) diff --git a/.travis.yml b/.travis.yml index dd55a2834..d76f4f8b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,10 +20,6 @@ install: # for local developers, grunt-cli is installed globally. # We have to install it for travis. - npm install grunt-cli -# install intern-geezer, which is an intern compatible with old IEs - - cd node_modules/intern-geezer - - npm install --production - - cd ../.. # copy over the configuration that can be used to start the server. - cp server/config/local.json-dist server/config/local.json - npm start & diff --git a/app/scripts/main.js b/app/scripts/main.js index 62b06d099..e99a7c8f0 100644 --- a/app/scripts/main.js +++ b/app/scripts/main.js @@ -9,7 +9,7 @@ require.config({ jquery: '../bower_components/jquery/jquery', backbone: '../bower_components/backbone/backbone', underscore: '../bower_components/underscore/underscore', - fxaClient: '../bower_components/fxa-js-client/build/fxa-client', + fxaClient: '../bower_components/fxa-js-client/fxa-client', text: '../bower_components/requirejs-text/text', mustache: '../bower_components/mustache/mustache', stache: '../bower_components/requirejs-mustache/stache', diff --git a/bower.json b/bower.json index 4d44e42a8..a23e0569b 100644 --- a/bower.json +++ b/bower.json @@ -7,7 +7,7 @@ "underscore": "~1.5.2", "backbone": "~1.1.0", "modernizr": "~2.6.2", - "fxa-js-client": "https://github.com/mozilla/fxa-js-client.git", + "fxa-js-client": "https://github.com/mozilla/fxa-js-client.git#0.1.1", "normalize-css": "~2.1.3", "jquery.transit": "~0.9.9", "requirejs-mustache": "*", diff --git a/package.json b/package.json index 4f54923ae..3e2713292 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,10 @@ "description": "Firefox Accounts Content Server", "scripts": { "start": "grunt server", - "postinstall": "bower install;cd app/bower_components/fxa-js-client;npm install;grunt build", + "postinstall": "bower install", "test": "intern-runner config=tests/intern", - "test-remote": "intern-runner config=tests/intern_remote" + "test-browser": "intern-runner config=tests/intern_browser", + "test-remote": "intern-runner config=tests/intern_sauce" }, "repository": { "type": "git", diff --git a/tests/functional/birthday.js b/tests/functional/birthday.js index b594a486e..e70690905 100644 --- a/tests/functional/birthday.js +++ b/tests/functional/birthday.js @@ -10,96 +10,118 @@ define([ 'use strict'; var url = 'http://localhost:3030/birthday'; - - var ONE_DAY_IN_MS = 1000 * 60 * 60 * 24; - var NOW = new Date(); - var YESTERDAY = new Date(); - YESTERDAY.setTime(NOW.getTime() - ONE_DAY_IN_MS); - - var TOMORROW = new Date(); - TOMORROW.setTime(NOW.getTime() + ONE_DAY_IN_MS); - var MONTHS = [ 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec' ]; registerSuite({ - name: 'sign_up', + name: 'birthday', 'pick a day that is before today - user can register': function () { - var month = MONTHS[YESTERDAY.getMonth()]; - var day = YESTERDAY.getDate(); + var month; + var day; - return this.get('remote') - .get(require.toUrl(url)) - .waitForElementById('fxa-birthday-header') + var remote = this.get('remote') + .eval("{ day: new Date(new Date().getTime() - 1000 * 60 * 60 * 24).getDate(), month: new Date(new Date().getTime() - 1000 * 60 * 60 * 24).getMonth() }") + .then(function (result) { + day = result.day; + month = MONTHS[result.month]; - .elementById('fxa-month-' + month) - .click() - .end() + remote.get(require.toUrl(url + '#yesterday')) + .waitForElementById('fxa-birthday-header') + .elementById('fxa-month-' + month) + .click() + .end() - .elementById('fxa-day-' + day) - .click() - .end() + .elementById('fxa-day-' + day) + .click() + .wait(1000) + .end() - .elementById('fxa-birthday-submit') - .click() - .end() + .elementById('fxa-birthday-submit') + .submit() + .end() - // Success is being redirected to the create account screen. - .waitForElementById('fxa-create-account-header') + // Success is being redirected to the create account screen. + .waitForElementById('fxa-create-account-header') + .end(); + }) .end(); + + return remote; }, 'pick today - user can register': function () { - var month = MONTHS[NOW.getMonth()]; - var day = NOW.getDate(); + var month; + var day; - return this.get('remote') - .get(require.toUrl(url)) - .waitForElementById('fxa-birthday-header') + var remote = this.get('remote') + // Get client current date, we cannot use the date of the test runner. + .eval("{ day: new Date().getDate(), month: new Date().getMonth() }") + .then(function (result) { + day = result.day; + month = MONTHS[result.month]; - .elementById('fxa-month-' + month) - .click() - .end() + remote.get(require.toUrl(url + '#today')) + .waitForElementById('fxa-birthday-header') - .elementById('fxa-day-' + day) - .click() - .end() + .elementById('fxa-month-' + month) + .click() + .end() - .elementById('fxa-birthday-submit') - .click() - .end() + .elementById('fxa-day-' + day) + .click() + .wait(1000) + .end() - // Success is being redirected to the create account screen. - .waitForElementById('fxa-create-account-header') + .elementById('fxa-birthday-submit') + .submit() + .end() + + // Success is being redirected to the create account screen. + .waitForElementById('fxa-create-account-header') + .end(); + }) .end(); + + + return remote; }, 'pick a day that is after today - user is too young': function () { - var month = MONTHS[TOMORROW.getMonth()]; - var day = TOMORROW.getDate(); + var month; + var day; - return this.get('remote') - .get(require.toUrl(url)) - .waitForElementById('fxa-birthday-header') + var remote = this.get('remote') + .eval("{ day: new Date(new Date().getTime() + 1000 * 60 * 60 * 24).getDate(), month: new Date(new Date().getTime() + 1000 * 60 * 60 * 24).getMonth() }") + .then(function (result) { + day = result.day; + month = MONTHS[result.month]; - .elementById('fxa-month-' + month) - .click() - .end() + remote.get(require.toUrl(url + '#tomorrow')) + .waitForElementById('fxa-birthday-header') + .elementById('fxa-month-' + month) + .click() + .end() - .elementById('fxa-day-' + day) - .click() - .end() + .elementById('fxa-day-' + day) + .click() + .wait(1000) + .end() - .elementById('fxa-birthday-submit') - .click() - .end() + .elementById('fxa-birthday-submit') + .submit() + .end() - // Success is being redirected to the cannot create account screen. - .waitForElementById('fxa-cannot-create-account-header') + // Success is being redirected to the cannot create account screen. + .waitForElementById('fxa-cannot-create-account-header') + .end(); + }) .end(); + + + return remote; } }); }); diff --git a/tests/functional/complete_sign_up.js b/tests/functional/complete_sign_up.js index 19fc53c17..b0ed22539 100644 --- a/tests/functional/complete_sign_up.js +++ b/tests/functional/complete_sign_up.js @@ -7,7 +7,7 @@ define([ 'intern/chai!assert', 'require', 'intern/node_modules/dojo/node!xmlhttprequest', - 'app/bower_components/fxa-js-client/client/FxAccountClient' + 'app/bower_components/fxa-js-client/fxa-client' ], function (registerSuite, assert, require, nodeXMLHttpRequest, FxaClient) { 'use strict'; @@ -33,7 +33,7 @@ define([ // the email var token = 'token'; var uid = 'uid'; - var url = PAGE_URL_ROOT + '?uid=' + uid + '&token=' + token; + var url = PAGE_URL_ROOT + '?uid=' + uid + '&code=' + token; return this.get('remote') .get(require.toUrl(url)) diff --git a/tests/functional/sign_in.js b/tests/functional/sign_in.js index 8023dc033..988b3ec25 100644 --- a/tests/functional/sign_in.js +++ b/tests/functional/sign_in.js @@ -7,7 +7,7 @@ define([ 'intern/chai!assert', 'require', 'intern/node_modules/dojo/node!xmlhttprequest', - 'app/bower_components/fxa-js-client/client/FxAccountClient' + 'app/bower_components/fxa-js-client/fxa-client' ], function (registerSuite, assert, require, nodeXMLHttpRequest, FxaClient) { 'use strict'; diff --git a/tests/intern.js b/tests/intern.js index 4b827d873..02032b6f0 100644 --- a/tests/intern.js +++ b/tests/intern.js @@ -19,7 +19,7 @@ define({ // Note that the `build` capability will be filled in with the current commit ID from the Travis CI environment // automatically capabilities: { - 'selenium-version': '2.35.0' + 'selenium-version': '2.38.0' }, // Browsers to run integration testing against. Note that version numbers must be strings if used with Sauce diff --git a/tests/intern_browser.js b/tests/intern_browser.js new file mode 100644 index 000000000..1fd160c6c --- /dev/null +++ b/tests/intern_browser.js @@ -0,0 +1,15 @@ +/* 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/. */ + +define([ + './intern' +], function (intern) { + 'use strict'; + + intern.environments = [ + { browserName: 'firefox', version: '25' } + ]; + + return intern; +}); diff --git a/tests/intern_remote.js b/tests/intern_sauce.js similarity index 100% rename from tests/intern_remote.js rename to tests/intern_sauce.js