Skip to content

Commit

Permalink
test: increase timeout
Browse files Browse the repository at this point in the history
I've not tracked down yet. Based on timestamps in logs I don't think
there's a performance regression in the Eik service itself. Time
from "server startup" logs to test complete is in the ballpark of
two seconds. The largest test suite has seven tests (~14 seconds).
  • Loading branch information
wkillerud committed Nov 18, 2024
1 parent 5a88bae commit 185fba5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 23 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
],
"scripts": {
"clean": "rimraf .tap node_modules types",
"test": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 60 --jobs 1 --disable-coverage",
"test:integration": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 60 --jobs 1 --disable-coverage test/integration/**/*.test.mjs",
"test:unit": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 60 --jobs 1 --disable-coverage test/*.test.mjs",
"test:tasks": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 60 --jobs 1 --disable-coverage test/tasks/*.test.mjs",
"test": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 240 --disable-coverage",
"test:integration": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 240 --disable-coverage test/integration/**/*.test.mjs",
"test:unit": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 240 --disable-coverage test/*.test.mjs",
"test:tasks": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 240 --disable-coverage test/tasks/*.test.mjs",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"format:check": "prettier -c .",
Expand Down
14 changes: 6 additions & 8 deletions test/integration/alias-legacy.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,9 @@ beforeEach(async (t) => {
t.context.token = token;
});

afterEach(async (t) => {
await t.context.server.close();
});
afterEach((t) => t.context.server.close());

await test("eik package-alias <name> <version> <alias>", async (t) => {
test("eik package-alias <name> <version> <alias>", async (t) => {
const { address, token, folder: cwd } = t.context;
const eik = join(__dirname, "..", "..", "index.js");

Expand Down Expand Up @@ -121,7 +119,7 @@ await test("eik package-alias <name> <version> <alias>", async (t) => {
t.equal(res.ok, true);
});

await test("eik npm-alias <name> <version> <alias> --token --server : no eik.json or .eikrc", async (t) => {
test("eik npm-alias <name> <version> <alias> --token --server : no eik.json or .eikrc", async (t) => {
const eik = join(__dirname, "..", "..", "index.js");
const cmd = `node ${eik} npm-alias scroll-into-view-if-needed 2.2.24 2
--token ${t.context.token}
Expand All @@ -144,7 +142,7 @@ await test("eik npm-alias <name> <version> <alias> --token --server : no eik.jso
t.end();
});

await test("eik npm-alias <name> <version> <alias> : publish details provided by eik.json file", async (t) => {
test("eik npm-alias <name> <version> <alias> : publish details provided by eik.json file", async (t) => {
const assets = {
name: "test-app",
version: "1.0.0",
Expand Down Expand Up @@ -177,7 +175,7 @@ await test("eik npm-alias <name> <version> <alias> : publish details provided by
t.end();
});

await test("eik map-alias <name> <version> <alias> --token --server : no eik.json or .eikrc", async (t) => {
test("eik map-alias <name> <version> <alias> --token --server : no eik.json or .eikrc", async (t) => {
const eik = join(__dirname, "..", "..", "index.js");
const cmd = `node ${eik} map-alias test-map 1.0.0 1
--token ${t.context.token}
Expand All @@ -198,7 +196,7 @@ await test("eik map-alias <name> <version> <alias> --token --server : no eik.jso
t.end();
});

await test("eik map-alias <name> <version> <alias> : publish details provided by eik.json file", async (t) => {
test("eik map-alias <name> <version> <alias> : publish details provided by eik.json file", async (t) => {
const assets = {
name: "test-app",
version: "1.0.0",
Expand Down
14 changes: 6 additions & 8 deletions test/integration/alias.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,9 @@ beforeEach(async (t) => {
t.context.token = token;
});

afterEach(async (t) => {
await t.context.server.close();
});
afterEach((t) => t.context.server.close());

await test("packages: eik alias <name> <version> <alias>", async (t) => {
test("packages: eik alias <name> <version> <alias>", async (t) => {
const { address, token, folder: cwd } = t.context;
const eik = join(__dirname, "..", "..", "index.js");

Expand Down Expand Up @@ -118,7 +116,7 @@ await test("packages: eik alias <name> <version> <alias>", async (t) => {
t.match(out.stdout, "NEW");
});

await test("npm: eik alias <name> <version> <alias> --token --server : no eik.json or .eikrc", async (t) => {
test("npm: eik alias <name> <version> <alias> --token --server : no eik.json or .eikrc", async (t) => {
const eik = join(__dirname, "..", "..", "index.js");
const cmd = `node ${eik} npm-alias scroll-into-view-if-needed 2.2.24 2
--token ${t.context.token}
Expand All @@ -142,7 +140,7 @@ await test("npm: eik alias <name> <version> <alias> --token --server : no eik.js
t.end();
});

await test("npm: eik alias <name> <version> <alias> : publish details provided by eik.json file", async (t) => {
test("npm: eik alias <name> <version> <alias> : publish details provided by eik.json file", async (t) => {
const assets = {
name: "test-app",
type: "npm",
Expand Down Expand Up @@ -176,7 +174,7 @@ await test("npm: eik alias <name> <version> <alias> : publish details provided b
t.end();
});

await test("map: eik alias <name> <version> <alias> --token --server : no eik.json or .eikrc", async (t) => {
test("map: eik alias <name> <version> <alias> --token --server : no eik.json or .eikrc", async (t) => {
const eik = join(__dirname, "..", "..", "index.js");
const cmd = `node ${eik} map-alias test-map 1.0.0 1
--token ${t.context.token}
Expand All @@ -199,7 +197,7 @@ await test("map: eik alias <name> <version> <alias> --token --server : no eik.js
t.end();
});

await test("map: eik alias <name> <version> <alias> : publish details provided by eik.json file", async (t) => {
test("map: eik alias <name> <version> <alias> : publish details provided by eik.json file", async (t) => {
const assets = {
name: "test-app",
type: "map",
Expand Down
4 changes: 1 addition & 3 deletions test/integration/package.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ beforeEach(async (t) => {
t.context.token = token;
});

afterEach(async (t) => {
await t.context.server.close();
});
afterEach((t) => t.context.server.close());

test("eik package : package, details provided by eik.json file", async (t) => {
const assets = {
Expand Down

0 comments on commit 185fba5

Please sign in to comment.