Skip to content

Fix CI Errors in windows - #418

Merged
superkhau merged 1 commit into
masterfrom
fixCIWinErrs
Feb 23, 2017
Merged

superkhau merged 1 commit into
masterfrom
fixCIWinErrs

Conversation

@deepakrkris

@deepakrkris deepakrkris commented Jan 25, 2017 •

Copy link
Copy Markdown
Contributor

Fix Windows CI Errors:

  • - remove cached install
  • - add 'npm install' in sandbox
  • - initialize sandbox with 'node_modules' folder
  • - loopback-workspace should use latest loopback-boot

@deepakrkris
deepakrkris force-pushed the fixCIWinErrs branch 5 times, most recently from e7b01b6 to 132f682 Compare January 25, 2017 08:48
@bajtos

bajtos commented Jan 25, 2017

Copy link
Copy Markdown
Member

We may need to increase the timeout in end-to-end tests even more.

See http://ci.strongloop.com/job/loopback-workspace/node=4.x,os=windows/6113/console

 end-to-end empty-server template
      1) "before all" hook: loadApp

  Suite duration: 110.692 s, Tests: 0

  end-to-end empty-server template without explorer
      1) "before all" hook: loadApp

  Suite duration: 35.175 s, Tests: 0

  end-to-end api-server template
      1) "before all" hook: loadApp

  Suite duration: 45.529 s, Tests: 0

@deepakrkris
deepakrkris force-pushed the fixCIWinErrs branch 18 times, most recently from e55aa09 to f7523de Compare January 25, 2017 23:48
@deepakrkris

deepakrkris commented Jan 26, 2017 •

Copy link
Copy Markdown
Contributor Author

@bajtos , booting of the app in windows works fine. it is the route configuration in middleware.json (placed in templates folder) that didnt get configured. When I added a boot script to the templates, the issue was resolved. I will be removing the file later.
@bajtos @superkhau I am debugging loopback-boot for the issue in windows now.

@bajtos

bajtos commented Jan 26, 2017

Copy link
Copy Markdown
Member

booting of the app in windows works fine. it is the route configuration in middleware.json (placed in templates folder) that didnt get configured. When I added a boot script to the templates, the issue was resolved. I will be removing the file later. I am debugging loopback-boot for the issue in windows now.

Thank you for the update. The two tests you are disabling in this patch were passing for me on my local Windows machine. I think you need to delete test/.pkgcache after you installed the latest version of strong-cached-install to force strong-cached-install to download newer (the latest version) of all dependencies. Without that step, you will keep using the cached files fetched via npm install loopback-boot@2.6.5 (a command with missing ^ in the version specifier).

Let me know if you need any more help. I can debug this myself to prevent too much waste of your time, if you like.

@deepakrkris

deepakrkris commented Jan 26, 2017 •

Copy link
Copy Markdown
Contributor Author

@bajtos @superkhau I have made some more progress on the workspace CI issues in windows. I removed the additional boot script and changed the “routes” middleware configuration from ${restApiRoot} to /api and all tests are clear (except for the 8 I have skipped).
So the issue is only in loopback-boot or the version of loopback-boot that gets installed in the sandbox. Interestingly the ${restApiRoot} configuration works in my windows local laptop (node version 0.12)

@deepakrkris
deepakrkris force-pushed the fixCIWinErrs branch 2 times, most recently from f00441b to c70158a Compare January 27, 2017 08:41
@deepakrkris

deepakrkris commented Jan 27, 2017 •

Copy link
Copy Markdown
Contributor Author

@bajtos @superkhau I removed cached install and just did a plain 'npm install' and all tests are passing now (except for the skipped 1)

@deepakrkris
deepakrkris force-pushed the fixCIWinErrs branch 3 times, most recently from 4f75c00 to 783bf4c Compare January 27, 2017 18:20
@bajtos

bajtos commented Jan 30, 2017

Copy link
Copy Markdown
Member

I introduced strong-cached-install in order to reduce the time needed to run end-to-end, so that we can get fast feedback when developing in TDD red-green-refactor style. Strangely enough, on Node v6.x using npm@3 which produces flat layout in node_modules, strong-cached-install is slower than npm install. (mocha test/end-to-end.js takes 5 minutes on master, 4 minutes on this branch). In that light, I am fine with removing strong-cached-install.

@bajtos bajtos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good, PTAL at my comments below.

Comment thread test/end-to-end.js Outdated
});

it('updates all models in the database', function(done) {
it.skip('updates all models in the database', function(done) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed? Where is the follow-up issue to fix the tests on Windows properly? Please add a comment to the test file.

Comment thread test/end-to-end.js
cwd: cwd,
};
var script = 'npm install';
return exec(script, options, function(err, stdout, stderr) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please debug log the script and the options or at cwd before calling exec, e.g.

debug('Running `%s` in %s', script, cwd);
exec(...);

Comment thread test/helpers/platform.js

'use strict';

exports.isWindows = /^win/.test(process.platform);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this helper is no longer used, please remove.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used to skip one test

Comment thread test/support.js Outdated
};
};

initializePackage = function() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this helper is used only by installSandboxPackages, please move its definition the test/end-to-end.js.

Comment thread test/support.js Outdated
};

initializePackage = function() {
fs.mkdirSync(path.join(SANDBOX, 'node_modules'));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment explaining why is this needed.

Comment thread test/end-to-end.js
var TestDataBuilder = require('./helpers/test-data-builder');
var ref = TestDataBuilder.ref;
var given = require('./helpers/given');
var platform = require('./helpers/platform');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT, this is not used, please remove.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deepakrkris Remove

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, i see the comment below where you need it to skip a test

@deepakrkris
deepakrkris force-pushed the fixCIWinErrs branch 13 times, most recently from 18b6c2d to 2a4ae7d Compare February 2, 2017 05:37
@deepakrkris
deepakrkris force-pushed the fixCIWinErrs branch 3 times, most recently from b1f5639 to 31350c1 Compare February 23, 2017 23:06
install latest strong cached install
Comment thread test/end-to-end.js
var TestDataBuilder = require('./helpers/test-data-builder');
var ref = TestDataBuilder.ref;
var given = require('./helpers/given');
var platform = require('./helpers/platform');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deepakrkris Remove

Comment thread test/end-to-end.js
var TestDataBuilder = require('./helpers/test-data-builder');
var ref = TestDataBuilder.ref;
var given = require('./helpers/given');
var platform = require('./helpers/platform');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, i see the comment below where you need it to skip a test

@superkhau
superkhau merged commit 2f8dde8 into master Feb 23, 2017
@superkhau superkhau removed the review label Feb 23, 2017
@superkhau
superkhau deleted the fixCIWinErrs branch February 23, 2017 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants