Skip to content

Commit

Permalink
debugging travis
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanpenner committed May 4, 2015
1 parent 94ee570 commit 6f5735b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
4 changes: 3 additions & 1 deletion dev/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ RUN apt-get update && apt-get install -y git

RUN git clone https://github.com/ember-cli/ember-cli.git ~/ember-cli
RUN cd ~/ember-cli && npm i
RUN curl https://raw.githubusercontent.com/isaacs/nave/master/nave.sh > /usr/local/bin/nave
RUN chmod +x /usr/local/bin/nave

ENTRYPOINT ["/bin/bash"]
ENTRYPOINT ["/bin/bash"]
18 changes: 5 additions & 13 deletions tests/acceptance/express-server-restart-slow.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var EOL = require('os').EOL;
var Promise = require('../../lib/ext/promise');
var acceptance = require('../helpers/acceptance');
var runCommand = require('../helpers/run-command');
var remove = Promise.denodeify(fs.remove);
var remove = Promise.denodeify(require('rimraf'));
var createTestTargets = acceptance.createTestTargets;
var teardownTestTargets = acceptance.teardownTestTargets;
var linkDependencies = acceptance.linkDependencies;
Expand All @@ -17,30 +17,26 @@ var cleanupRun = acceptance.cleanupRun;
var copyFixtureFiles = require('../helpers/copy-fixture-files');
var assertDirEmpty = require('../helpers/assert-dir-empty');

describe('Acceptance: express server restart', function () {
describe.only('Acceptance: express server restart', function () {
this.timeout(360000);
var appName = 'express-server-restart-test-app';

before(function() {
this.timeout(360000);

return createTestTargets(appName).then(function() {
process.chdir(appName);
return copyFixtureFiles('restart-express-server/app-root');
});
});

after(function() {
this.timeout(15000);
return teardownTestTargets();
});

beforeEach(function() {
this.timeout(15000);
return linkDependencies(appName);
});

afterEach(function() {
this.timeout(15000);
return cleanupRun().then(function() {
assertDirEmpty('tmp');
});
Expand Down Expand Up @@ -123,23 +119,19 @@ describe('Acceptance: express server restart', function () {
}

it('Server restarts successfully on copy1', function() {
this.timeout(30000);

ensureTestFileContents('Initial Contents' + EOL, 'Test file initialized properly.');
return runServer(getRunCommandOptions(onChildSpawnedSingleCopy('copy1', 'Copy1 contents of A.')));
});

it('Server restarts successfully on copy2', function() {
this.timeout(30000);

ensureTestFileContents('Initial Contents' + EOL, 'Test file initialized properly.');

return runServer(getRunCommandOptions(onChildSpawnedSingleCopy('copy2', 'Copy2 contents of A. Copy2 contents of B.')));
});

it('Server restarts successfully on multiple copies', function() {
this.timeout(90000);

ensureTestFileContents('Initial Contents' + EOL, 'Test file initialized properly.');

return runServer(getRunCommandOptions(onChildSpawnedMultipleCopies()));
});
});
Expand Down
13 changes: 13 additions & 0 deletions tests/helpers/acceptance.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var tmp = require('./tmp');
var conf = require('./conf');
var copy = Promise.denodeify(require('ember-cli-ncp'));
var root = process.cwd();
var glob = require('glob');

var onOutput = {
onOutput: function() {
Expand Down Expand Up @@ -40,6 +41,8 @@ function mvRm(from, to) {
var dir = path.join(root, to);
from = path.resolve(from);

console.log('from', from, 'to', to);

if (!fs.existsSync(dir)) {
fs.mkdirsSync(dir);
fs.copySync(from, to);
Expand All @@ -59,6 +62,7 @@ function applyCommand(command, name /*, ...flags*/) {
args.splice(2, 0, flag);
});

console.log(args);
return runCommand.apply(undefined, args);
}

Expand Down Expand Up @@ -86,20 +90,24 @@ function createTestTargets(projectName, options) {

// Fresh install
if (!downloaded('node_modules') && !downloaded('bower_components')) {
console.log('fresh install');
command = function() {
return applyCommand(options.command, projectName);
};
// bower_components but no node_modules
} else if (!downloaded('node_modules') && downloaded('bower_components')) {
console.log('download node_modules, dont download bower_components');
command = function() {
return applyCommand(options.command, projectName, '--skip-bower');
};
// node_modules but no bower_components
} else if (!downloaded('bower_components') && downloaded('node_modules')) {
console.log('download bower_components , dont download node_modules');
command = function() {
return applyCommand(options.command, projectName, '--skip-npm');
};
} else {
console.log('DONT download bower_components , dont download node_modules');
// Everything is already there
command = function() {
return applyCommand(options.command, projectName, '--skip-npm', '--skip-bower');
Expand Down Expand Up @@ -137,6 +145,11 @@ function linkDependencies(projectName) {
var nodeModulesPath = targetPath + '/node_modules/';
var bowerComponentsPath = targetPath + '/bower_components/';

console.log(process.cwd());
console.log(glob.sync('*'));
console.log(glob.sync('tmp/*'));
console.log(glob.sync('tmp/express-server-restart-test-app/*'));

mvRm(nodeModulesPath, '.node_modules-tmp');
mvRm(bowerComponentsPath, '.bower_components-tmp');

Expand Down

0 comments on commit 6f5735b

Please sign in to comment.