From 8afab95d014a9a8bfe444e7c4e9dc25dd9cc52f1 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sat, 25 Jun 2022 16:19:06 -0700 Subject: [PATCH 1/3] test: enable building the native module test on Windows --- spec/install-spec.js | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/spec/install-spec.js b/spec/install-spec.js index 3a5b3dd..05af05c 100644 --- a/spec/install-spec.js +++ b/spec/install-spec.js @@ -607,7 +607,7 @@ describe("apm install", function () { }) }) - describe("when installing a registred package and --json is specified", function () { + describe("when installing a registered package and --json is specified", function () { beforeEach(function () { const callback = jasmine.createSpy("callback") @@ -629,30 +629,8 @@ describe("apm install", function () { }) }) - describe("with a space in node-gyp's path", function () { - const nodeModules = fs.realpathSync(path.join(__dirname, "..", "node_modules")) - - beforeEach(function () { - // Normally npm_config_node_gyp would be ignored, but it works here because we're calling apm - // directly and not through the scripts in bin/ - const nodeGypPath = path.dirname(path.dirname(resolveSync("node-gyp"))) // find an installed node-gyp - fs.copySync(nodeGypPath, path.join(nodeModules, "with a space")) - process.env.npm_config_node_gyp = path.join(nodeModules, "with a space", "bin", "node-gyp.js") - - // Read + execute permission - return fs.chmodSync(process.env.npm_config_node_gyp, fs.constants.S_IRUSR | fs.constants.S_IXUSR) - }) - - afterEach(function () { - delete process.env.npm_config_node_gyp - return fs.removeSync(path.join(nodeModules, "with a space")) - }) - + describe("with the bundled node-gyp", function () { it("builds native code successfully", function () { - if (process.platform === "win32") { - console.warn("Test skipped on windows") // TODO - return - } const callback = jasmine.createSpy("callback") apm.run(["install", "native-package"], callback) From 53cfd10bf8ff96622ed0d693f9f543ea078fd9cd Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sat, 25 Jun 2022 18:34:51 -0700 Subject: [PATCH 2/3] test: enable all native module tests for windows --- spec/ci-spec.js | 4 ---- spec/install-spec.js | 4 ---- 2 files changed, 8 deletions(-) diff --git a/spec/ci-spec.js b/spec/ci-spec.js index a5c18c9..2321647 100644 --- a/spec/ci-spec.js +++ b/spec/ci-spec.js @@ -105,10 +105,6 @@ describe("apm ci", function () { }) it("builds a native dependency correctly", function () { - if (process.platform === "win32") { - console.warn("Test skipped on windows") // TODO - return - } const moduleDirectory = path.join(temp.mkdirSync("apm-test-"), "test-module-with-native") wrench.copyDirSyncRecursive(path.join(__dirname, "fixtures", "test-module-with-lockfile"), moduleDirectory) process.chdir(moduleDirectory) diff --git a/spec/install-spec.js b/spec/install-spec.js index 05af05c..e09638b 100644 --- a/spec/install-spec.js +++ b/spec/install-spec.js @@ -408,10 +408,6 @@ describe("apm install", function () { describe("when --check is specified", () => it("compiles a sample native module", function () { - if (process.platform === "win32") { - console.warn("Test skipped on windows") // TODO - return - } const callback = jasmine.createSpy("callback") apm.run(["install", "--check"], callback) From 0190e0a37f4d950f3613ca329b391508e7b1c1a2 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sat, 25 Jun 2022 18:52:34 -0700 Subject: [PATCH 3/3] Revert "test: enable all native module tests for windows" This reverts commit 53cfd10bf8ff96622ed0d693f9f543ea078fd9cd. --- spec/ci-spec.js | 4 ++++ spec/install-spec.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/spec/ci-spec.js b/spec/ci-spec.js index 2321647..a5c18c9 100644 --- a/spec/ci-spec.js +++ b/spec/ci-spec.js @@ -105,6 +105,10 @@ describe("apm ci", function () { }) it("builds a native dependency correctly", function () { + if (process.platform === "win32") { + console.warn("Test skipped on windows") // TODO + return + } const moduleDirectory = path.join(temp.mkdirSync("apm-test-"), "test-module-with-native") wrench.copyDirSyncRecursive(path.join(__dirname, "fixtures", "test-module-with-lockfile"), moduleDirectory) process.chdir(moduleDirectory) diff --git a/spec/install-spec.js b/spec/install-spec.js index e09638b..05af05c 100644 --- a/spec/install-spec.js +++ b/spec/install-spec.js @@ -408,6 +408,10 @@ describe("apm install", function () { describe("when --check is specified", () => it("compiles a sample native module", function () { + if (process.platform === "win32") { + console.warn("Test skipped on windows") // TODO + return + } const callback = jasmine.createSpy("callback") apm.run(["install", "--check"], callback)