You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 58c5b8a
Browse filesBrowse the repository at this point in the historyBrowse files
test(cli): global-local's heaviest tests are split by case (#9746)
test(cli): global-local's heaviest tests are split by case
Two tests in global-local.test.mjs started the CLI 9 and 13 times each:
the skill test looped over three install layouts, and the tool folder
test checked four cases in a row. Each CLI start costs about 0.6 s of
CPU, so on a busy machine those tests ran past the 30 s limit.
The skill test is now one test for each layout, with 3 starts each. The
tool folder test is now four tests, one for each case, with at most 4
starts each. Every assertion is kept, and the file starts the CLI as
many times as before.
Copy file name to clipboardExpand all lines: packages/cli/test/global-local.test.mjs
+46-18Lines changed: 46 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -877,13 +877,14 @@ describe.skipIf(!POSIX)(
877
877
).toBe('warn');
878
878
});
879
879
880
-
it('the skill outlives the CLI installed for the computer: it repeats the step that installed it, and doctor names it too',()=>{
881
-
for(const[layout,step]of/** @type {const} */([
882
-
// The npm layout is a prefix in the home folder, so the step names it.
883
-
['npm','npm i -g --prefix ~/.npm-global @astryxdesign/cli'],
884
-
['pnpm','pnpm add -g @astryxdesign/cli'],
885
-
['bun','bun add -g @astryxdesign/cli'],
886
-
])){
880
+
// One test for each layout: each starts the CLI three times.
881
+
for(const[layout,step]of/** @type {const} */([
882
+
// The npm layout is a prefix in the home folder, so the step names it.
883
+
['npm','npm i -g --prefix ~/.npm-global @astryxdesign/cli'],
884
+
['pnpm','pnpm add -g @astryxdesign/cli'],
885
+
['bun','bun add -g @astryxdesign/cli'],
886
+
])){
887
+
it(`the skill outlives the CLI installed for the computer (${layout}): it repeats the step that installed it, and doctor names it too`,()=>{
887
888
constpc=computer();
888
889
letg;
889
890
if(layout==='bun'){
@@ -959,8 +960,8 @@ describe.skipIf(!POSIX)(
959
960
);
960
961
}
961
962
pc.path.shift();
962
-
}
963
-
});
963
+
});
964
+
}
964
965
965
966
// Volta's command is a shim of its own, not a link into the package, so
966
967
// the search-path scan cannot trace it; an astryx on the search path that
@@ -1753,15 +1754,38 @@ describe.skipIf(!POSIX)(
1753
1754
});
1754
1755
});
1755
1756
1756
-
it("from a tool folder inside a project (as G36), discover and doctor point an integration installed for the computer at the project's folder, where its command adds it for good; with no project, discover names no command",()=>{
1757
+
/**
1758
+
* The global npm copy on the search path, with `@acme/widgets` installed
0 commit comments