Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #30376 from gaye/bug-1170120-again
Browse files Browse the repository at this point in the history
Bug 1170120 - Dependencies should be declared by the package that uses them
  • Loading branch information
Gareth Aye committed Jun 3, 2015
2 parents d30ee2f + cfc56f5 commit 641edbb
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 64 deletions.
5 changes: 2 additions & 3 deletions Makefile
Expand Up @@ -737,12 +737,11 @@ git-gaia-node-modules: gaia_node_modules.revision
# we run npm rebuild on marionette-js-runner to ensure that our python bits are
# setup properly (it's a postinstall script that runs only when we rebuild).
#
# calling npm install ensures that local in tree modules get installed. these
# are not part of the pre-built node modules at this time.
# calling npm rebuild ensures that local in tree modules get their dependencies
# installed. These are not part of the pre-built node modules at this time.
#
npm-cache:
@echo "Using pre-deployed cache."
npm rebuild marionette-js-runner
npm install
touch -c node_modules

Expand Down
12 changes: 0 additions & 12 deletions package.json
Expand Up @@ -8,8 +8,6 @@
"engineStrict": "true",

"devDependencies": {
"argparse": "1.0.2",
"array-difference": "0.0.1",
"async": "0.2.9",
"adm-zip": "0.4.3",
"app-root-path": "^1.0.0",
Expand All @@ -23,17 +21,13 @@
"ejs": "0.8.4",
"empty-port": "~0.0.1",
"es6-promise": "2.0.1",
"escape-string-regexp": "1.0.3",
"fe.js": "~0.1.4",
"gulp": "3.8.11",
"gulp-shell": "^0.4.1",
"indent-string": "1.2.1",
"intersect": "1.0.1",
"istanbul": "^0.3.2",
"jsdoc": "^3.3.0",
"jshint": "2.7.0",
"load-grunt-tasks": "0.4.0",
"lodash": "3.6.0",
"mail-fakeservers": "0.0.24",
"marionette-apps": "file:./tests/jsmarionette/plugins/marionette-apps",
"marionette-client": "1.7.5",
Expand All @@ -43,7 +37,6 @@
"marionette-helper": "file:./tests/jsmarionette/plugins/marionette-helper",
"marionette-plugin-forms": "file:./tests/jsmarionette/plugins/marionette-plugin-forms",
"marionette-profile-builder": "file:./tests/jsmarionette/runner/marionette-profile-builder",
"marionette-js-logger": "file:./tests/jsmarionette/plugins/marionette-js-logger",
"marionette-js-runner": "file:./tests/jsmarionette/runner/marionette-js-runner",
"marionette-settings-api": "file:./tests/jsmarionette/plugins/marionette-settings-api",
"mime": "^1.2.11",
Expand All @@ -56,13 +49,10 @@
"mozilla-download": "1.0.4",
"mozilla-profile-builder": "file:./tests/jsmarionette/runner/mozilla-profile-builder",
"mozilla-runner": "file:./tests/jsmarionette/runner/mozilla-runner",
"object-assign": "2.0.0",
"packaged-webapp": "*",
"proxyquire": "~0.4",
"node-static": "0.6.9",
"q": "~0.9.7",
"raptor": "file:./tools/raptor",
"remove": "0.1.5",
"request": "2.33.0",
"restify": "2.8.1",
"rimraf": "2.2.5",
Expand All @@ -72,8 +62,6 @@
"taskcluster-client": "0.21.4",
"taskcluster-npm-cache": "1.1.14",
"test-agent": "0.28.2",
"tmp": "0.0.25",
"traverse-directory": "0.1.0",
"uuid": "2.0.1",
"watch": "~0.9.0"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/jsmarionette/mocha/mocha-json-proxy/package.json
Expand Up @@ -11,6 +11,6 @@
},

"peerDependencies": {
"mocha": ">=1.5"
"mocha": ">=1.0"
}
}
4 changes: 2 additions & 2 deletions tests/jsmarionette/mocha/mocha-json-proxy/test/helper.js
Expand Up @@ -7,7 +7,7 @@ var exec = require('child_process').exec,

function forkFixture(test) {
var reporterPath = __dirname + '/../reporter.js';
var exec = __dirname + '/../../../../../node_modules/.bin/_mocha';
var exec = __dirname + '/../../.bin/_mocha';
var cmd = [
'--reporter', reporterPath,
'--ui', 'tdd',
Expand All @@ -31,7 +31,7 @@ function forkFixture(test) {

function runFixture(test, callback) {
var cmd =
__dirname + '/../../../../../node_modules/.bin/mocha' +
__dirname + '/../../.bin/mocha' +
' --ui tdd --reporter ' + __dirname + '/../reporter ' +
__dirname + '/fixtures/' + test;

Expand Down
6 changes: 5 additions & 1 deletion tests/jsmarionette/mocha/mocha-tbpl-reporter/package.json
Expand Up @@ -5,7 +5,11 @@
"description": "Mocha reporter for TBPL (tinderboxpushlog)",
"license": "MIT",

"devDependencies": {
"mocha": "^1.0.0"
},

"peerDependencies": {
"mocha": "1.x"
"mocha": ">=1.0"
}
}
Expand Up @@ -125,7 +125,7 @@ suite('TBPL', function() {
});
assert.equal(
file,
'tests/jsmarionette/mocha/mocha-tbpl-reporter/test/xfoo'
'node_modules/mocha-tbpl-reporter/test/xfoo'
);
});

Expand Down
4 changes: 0 additions & 4 deletions tests/jsmarionette/plugins/marionette-apps/.npmignore

This file was deleted.

Expand Up @@ -5,6 +5,7 @@
"description": "A plugin for manipulating form fields",
"main": "lib/index.js",
"license": "MIT",

"dependencies": {
"marionette-client": "~1.7.1"
}
Expand Down
43 changes: 25 additions & 18 deletions tests/jsmarionette/run_tests.js
Expand Up @@ -5,9 +5,11 @@
* @fileoverview Runs all jsmarionette unit tests. Does not run ui tests.
*/
var Mocha = require('mocha');
var path = require('path');

var configs = Object.freeze({
'mocha/mocha-json-proxy': {
/* mocha */
'mocha-json-proxy': {
entrypoint: 'test/helper',
tests: [
'test/acceptance/consumer',
Expand All @@ -17,15 +19,16 @@ var configs = Object.freeze({
]
},

'mocha/mocha-tbpl-reporter': {
'mocha-tbpl-reporter': {
tests: ['test/tbpl_test']
},

'plugins/marionette-file-manager': {
/* plugins */
'marionette-file-manager': {
tests: ['test/unit/desktop_client_file_manager_test']
},

'plugins/marionette-plugin-forms': {
'marionette-plugin-forms': {
entrypoint: 'test/test-helper',
tests: [
'test/unit/tests/formatters/date',
Expand All @@ -34,12 +37,13 @@ var configs = Object.freeze({
]
},

'runner/marionette-profile-builder': {
/* runner */
'marionette-profile-builder': {
entrypoint: 'test/helper',
tests: ['test/index']
},

'runner/mozilla-profile-builder': {
'mozilla-profile-builder': {
entrypoint: 'test/helper',
tests: [
'test/createprofile',
Expand All @@ -50,14 +54,7 @@ var configs = Object.freeze({
]
},

'runner/mozilla-runner': {
tests: [
'test/detectbinary',
'test/run'
]
},

'runner/marionette-js-runner': {
'marionette-js-runner': {
entrypoint: 'test/helper',
tests: [
'test/bin/apply-manifest_test',
Expand All @@ -70,18 +67,23 @@ var configs = Object.freeze({
'test/optsfileparser_test',
'test/rpc_test'
]
},

'mozilla-runner': {
'tests': [
'test/detectbinary',
'test/run'
]
}
});

function configureMocha(mocha, key, config) {
if (config.entrypoint) {
var entrypoint = __dirname + '/' + key + '/' + config.entrypoint;
require(entrypoint);
require(norm(__dirname, '../../node_modules', key, config.entrypoint));
}

config.tests.forEach(function(test) {
var file = __dirname + '/' + key + '/' + test;
mocha.addFile(file);
mocha.addFile(norm(__dirname, '../../node_modules', key, test));
});
}

Expand All @@ -102,6 +104,11 @@ function main() {
});
}

function norm() {
var args = Array.prototype.slice.call(arguments);
return path.normalize(path.resolve.apply(path, args));
}

if (require.main === module) {
main();
}
1 change: 0 additions & 1 deletion tests/jsmarionette/runner/marionette-js-runner/.npmignore
@@ -1,4 +1,3 @@
/b2g
/crash
/symbols
/venv
24 changes: 10 additions & 14 deletions tests/jsmarionette/runner/marionette-js-runner/package.json
@@ -1,9 +1,12 @@
{
"name": "marionette-js-runner",
"version": "1.1.2",
"author": "James Lal [:lightsofapollo]",
"version": "1.1.3",
"description": "Javascript ui testing framework built on top of mocha for testing webapps on gecko",
"license": "MIT",

"contributors": [
"James Lal [:lightsofapollo] <jlal@mozilla.com>",
"Gareth Aye [:gaye] <gaye@mozilla.com>"
],

"bin": {
"marionette-mocha": "./bin/marionette-mocha",
Expand All @@ -13,25 +16,18 @@
"dependencies": {
"argparse": "^0.1.15",
"array-difference": "0.0.1",
"commander": "~1.3",
"debug": "*",
"empty-port": "~0.0.1",
"escape-string-regexp": "^1.0.2",
"indent-string": "^1.2.0",
"intersect": "~0.0.3",
"lodash": "3.1.0",
"indent-string": "1.2.1",
"lodash": "3.6.0",
"marionette-js-logger": "0.2.1",
"marionette-profile-builder": "0.0.3",
"mkdirp": "^0.5.0",
"marionette-profile-builder": "0.0.4",
"mocha-json-proxy": "~0.0.2",
"mozilla-runner": "^0.5.0",
"mz": "^1.1.0",
"object-assign": "^1.0.0",
"promise": "^6.0.1",
"superagent": "^0.21.0",
"superagent-promise": "^0.2.0",
"uuid": "^2.0.1",
"yargs": "^1.3.2"
"uuid": "^2.0.1"
},

"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions tests/jsmarionette/runner/marionette-js-runner/test/helper.js
Expand Up @@ -17,14 +17,14 @@ function env() {
}

function spawnMocha(argv) {
var mocha = __dirname + '/../../../../../node_modules/.bin/mocha';
var mocha = __dirname + '/../../.bin/mocha';
return spawn(mocha, argv, { env: env() });
}

function spawnMarionette(argv) {
var bin = __dirname + '/../bin/marionette-mocha';
argv.push('--runtime');
argv.push(__dirname + '/../../../../../b2g/b2g-bin');
argv.push(__dirname + '/../../../b2g/b2g-bin');
return spawn(bin, argv, { env: env() });
}

Expand Down
Expand Up @@ -5,6 +5,7 @@
"license": "MIT",
"description": "Default profile builder for marionette-js-runner",
"main": "index.js",

"dependencies" : {
"debug": "*",
"mozilla-profile-builder": "0.4.0"
Expand Down
4 changes: 0 additions & 4 deletions tests/jsmarionette/runner/mozilla-runner/.npmignore

This file was deleted.

2 changes: 1 addition & 1 deletion tests/jsmarionette/runner/mozilla-runner/test/run.js
@@ -1,7 +1,7 @@
'use strict';
suite('run', function() {
var run = require('../lib/run').run;
var runtime = __dirname + '/../../../../../b2g';
var runtime = __dirname + '/../../../b2g';
var assert = require('assert');
var profile = require('mozilla-profile-builder');
var Static = require('node-static');
Expand Down

0 comments on commit 641edbb

Please sign in to comment.