You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2013/12/06 02:13:23 UTC

[07/32] git commit: Fix e2e tests on Windows

Fix e2e tests on Windows

There were two problems.
 1. Couldn't delete the tmp project dir on Windows because it was the CWD
    dir of the node process and Windows can't delete "busy" dirs.
 2. There was an interaction between tests in spec and those in e2e.
    Jasmine ran the e2e tests first, the CWD stayed in temp dir, but some
    tests in spec assume that CWD is the cordova source root dir.

Both problems solved by process.chdir(<source root>) after each e2e test.


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/186baba0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/186baba0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/186baba0

Branch: refs/heads/fireos
Commit: 186baba03ad3cca368290113d5f7ccb9e28050ba
Parents: ad01299
Author: Mark Koudritsky <ka...@chromium.org>
Authored: Thu Nov 28 11:48:14 2013 -0500
Committer: Michal Mocny <mm...@gmail.com>
Committed: Fri Nov 29 09:53:50 2013 -0500

----------------------------------------------------------------------
 e2e/create.spec.js   | 1 +
 e2e/platform.spec.js | 1 +
 e2e/plugin.spec.js   | 1 +
 3 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/186baba0/e2e/create.spec.js
----------------------------------------------------------------------
diff --git a/e2e/create.spec.js b/e2e/create.spec.js
index 5900d7a..3f1304c 100644
--- a/e2e/create.spec.js
+++ b/e2e/create.spec.js
@@ -62,6 +62,7 @@ describe('create end-to-end', function() {
         shell.rm('-rf', project);
     });
     afterEach(function() {
+        process.chdir(path.join(__dirname, '..'));  // Needed to rm the dir on Windows.
         shell.rm('-rf', project);
     });
 

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/186baba0/e2e/platform.spec.js
----------------------------------------------------------------------
diff --git a/e2e/platform.spec.js b/e2e/platform.spec.js
index 879a909..be5761e 100644
--- a/e2e/platform.spec.js
+++ b/e2e/platform.spec.js
@@ -22,6 +22,7 @@ describe('platform end-to-end', function() {
         shell.rm('-rf', project);
     });
     afterEach(function() {
+        process.chdir(path.join(__dirname, '..'));  // Needed to rm the dir on Windows.
         shell.rm('-rf', project);
     });
 

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/186baba0/e2e/plugin.spec.js
----------------------------------------------------------------------
diff --git a/e2e/plugin.spec.js b/e2e/plugin.spec.js
index 0425f90..dd493bb 100644
--- a/e2e/plugin.spec.js
+++ b/e2e/plugin.spec.js
@@ -19,6 +19,7 @@ describe('plugin end-to-end', function() {
         shell.rm('-rf', project);
     });
     afterEach(function() {
+        process.chdir(path.join(__dirname, '..'));  // Needed to rm the dir on Windows.
         shell.rm('-rf', project);
     });