-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure integration tests to reduce concurrency interference
AVA concurrency determines how many *test files* are run at once. With the pre-existing integration test files, this still resulted in huge numbers of tests within one file, thus resulting in slow tests (especially in CI). This restructuring aims to reduce this and improve integration test performance.
- Loading branch information
1 parent
21e93a8
commit e6cd5fb
Showing
36 changed files
with
662 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @overview Contains integration tests for `shescape.escapeAll` specifically | ||
* for use with the Bourne-again shell (Bash). | ||
* @license MIT | ||
*/ | ||
|
||
import test from "ava"; | ||
|
||
import { constants, generate } from "../_.js"; | ||
|
||
import { escapeAll } from "shescape"; | ||
|
||
let runTest = constants.isWindows ? test.skip : test; | ||
|
||
runTest("inputs are escaped for bash", (t) => { | ||
const shell = "bash"; | ||
for (const { expected, input, options } of generate.escapeExamples(shell)) { | ||
const result = escapeAll([input], options); | ||
t.deepEqual(result, [expected]); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @overview Contains integration tests for `shescape.escapeAll` specifically | ||
* for use with the Windows Command Prompt. | ||
* @license MIT | ||
*/ | ||
|
||
import test from "ava"; | ||
|
||
import { constants, generate } from "../_.js"; | ||
|
||
import { escapeAll } from "shescape"; | ||
|
||
let runTest = constants.isWindows ? test : test.skip; | ||
|
||
runTest("inputs are escaped for cmd.exe", (t) => { | ||
const shell = "cmd.exe"; | ||
for (const { expected, input, options } of generate.escapeExamples(shell)) { | ||
const result = escapeAll([input], options); | ||
t.deepEqual(result, [expected]); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* @overview Contains integration tests for the transpiled version of | ||
* `shescape.escapeAll`. | ||
* @license MIT | ||
*/ | ||
|
||
import { testProp } from "@fast-check/ava"; | ||
import * as fc from "fast-check"; | ||
|
||
import { arbitrary } from "../_.js"; | ||
|
||
import { escapeAll } from "shescape"; | ||
import { escapeAll as escapeAllCjs } from "../../../index.cjs"; | ||
|
||
testProp( | ||
"esm === cjs", | ||
[fc.array(arbitrary.shescapeArg()), arbitrary.shescapeOptions()], | ||
(t, args, options) => { | ||
const resultEsm = escapeAll(args, options); | ||
const resultCjs = escapeAllCjs(args, options); | ||
t.deepEqual(resultEsm, resultCjs); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @overview Contains integration tests for `shescape.escapeAll` specifically | ||
* for use with the C shell (csh). | ||
* @license MIT | ||
*/ | ||
|
||
import test from "ava"; | ||
|
||
import { constants, generate } from "../_.js"; | ||
|
||
import { escapeAll } from "shescape"; | ||
|
||
let runTest = constants.isWindows ? test.skip : test; | ||
|
||
runTest("inputs are escaped for csh", (t) => { | ||
const shell = "csh"; | ||
for (const { expected, input, options } of generate.escapeExamples(shell)) { | ||
const result = escapeAll([input], options); | ||
t.deepEqual(result, [expected]); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @overview Contains integration tests for `shescape.escapeAll` specifically | ||
* for use with the Debian Almquist shell (Dash). | ||
* @license MIT | ||
*/ | ||
|
||
import test from "ava"; | ||
|
||
import { constants, generate } from "../_.js"; | ||
|
||
import { escapeAll } from "shescape"; | ||
|
||
let runTest = constants.isWindows ? test.skip : test; | ||
|
||
runTest("inputs are escaped for dash", (t) => { | ||
const shell = "dash"; | ||
for (const { expected, input, options } of generate.escapeExamples(shell)) { | ||
const result = escapeAll([input], options); | ||
t.deepEqual(result, [expected]); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @overview Contains integration tests for `shescape.escapeAll` specifically | ||
* for use with Windows PowerShell. | ||
* @license MIT | ||
*/ | ||
|
||
import test from "ava"; | ||
|
||
import { constants, generate } from "../_.js"; | ||
|
||
import { escapeAll } from "shescape"; | ||
|
||
let runTest = constants.isWindows ? test : test.skip; | ||
|
||
runTest("inputs are escaped for powershell.exe", (t) => { | ||
const shell = "powershell.exe"; | ||
for (const { expected, input, options } of generate.escapeExamples(shell)) { | ||
const result = escapeAll([input], options); | ||
t.deepEqual(result, [expected]); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @overview Contains integration tests for `shescape.escapeAll` specifically | ||
* for use with the Z shell (Zsh). | ||
* @license MIT | ||
*/ | ||
|
||
import test from "ava"; | ||
|
||
import { constants, generate } from "../_.js"; | ||
|
||
import { escapeAll } from "shescape"; | ||
|
||
let runTest = constants.isWindows ? test.skip : test; | ||
|
||
runTest("inputs are escaped for zsh", (t) => { | ||
const shell = "zsh"; | ||
for (const { expected, input, options } of generate.escapeExamples(shell)) { | ||
const result = escapeAll([input], options); | ||
t.deepEqual(result, [expected]); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @overview Contains integration tests for `shescape.escape` specifically for | ||
* use with the Bourne-again shell (Bash). | ||
* @license MIT | ||
*/ | ||
|
||
import test from "ava"; | ||
|
||
import { constants, generate } from "../_.js"; | ||
|
||
import { escape } from "shescape"; | ||
|
||
let runTest = constants.isWindows ? test.skip : test; | ||
|
||
runTest("inputs are escaped for bash", (t) => { | ||
const shell = "bash"; | ||
for (const { expected, input, options } of generate.escapeExamples(shell)) { | ||
const result = escape(input, options); | ||
t.deepEqual(result, expected); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @overview Contains integration tests for `shescape.escape` specifically for | ||
* use with the Windows Command Prompt. | ||
* @license MIT | ||
*/ | ||
|
||
import test from "ava"; | ||
|
||
import { constants, generate } from "../_.js"; | ||
|
||
import { escape } from "shescape"; | ||
|
||
let runTest = constants.isWindows ? test : test.skip; | ||
|
||
runTest("inputs are escaped for cmd.exe", (t) => { | ||
const shell = "cmd.exe"; | ||
for (const { expected, input, options } of generate.escapeExamples(shell)) { | ||
const result = escape(input, options); | ||
t.deepEqual(result, expected); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* @overview Contains integration tests for the transpiled version of | ||
* `shescape.escape`. | ||
* @license MIT | ||
*/ | ||
|
||
import { testProp } from "@fast-check/ava"; | ||
|
||
import { arbitrary } from "../_.js"; | ||
|
||
import { escape as escape } from "shescape"; | ||
import { escape as escapeCjs } from "../../../index.cjs"; | ||
|
||
testProp( | ||
"esm === cjs", | ||
[arbitrary.shescapeArg(), arbitrary.shescapeOptions()], | ||
(t, arg, options) => { | ||
const resultEsm = escape(arg, options); | ||
const resultCjs = escapeCjs(arg, options); | ||
t.is(resultEsm, resultCjs); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @overview Contains integration tests for `shescape.escape` specifically for | ||
* use with the C shell (csh). | ||
* @license MIT | ||
*/ | ||
|
||
import test from "ava"; | ||
|
||
import { constants, generate } from "../_.js"; | ||
|
||
import { escape } from "shescape"; | ||
|
||
let runTest = constants.isWindows ? test.skip : test; | ||
|
||
runTest("inputs are escaped for csh", (t) => { | ||
const shell = "csh"; | ||
for (const { expected, input, options } of generate.escapeExamples(shell)) { | ||
const result = escape(input, options); | ||
t.deepEqual(result, expected); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @overview Contains integration tests for `shescape.escape` specifically for | ||
* use with the Debian Almquist shell (Dash). | ||
* @license MIT | ||
*/ | ||
|
||
import test from "ava"; | ||
|
||
import { constants, generate } from "../_.js"; | ||
|
||
import { escape } from "shescape"; | ||
|
||
let runTest = constants.isWindows ? test.skip : test; | ||
|
||
runTest("inputs are escaped for dash", (t) => { | ||
const shell = "dash"; | ||
for (const { expected, input, options } of generate.escapeExamples(shell)) { | ||
const result = escape(input, options); | ||
t.deepEqual(result, expected); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @overview Contains integration tests for `shescape.escape` specifically for | ||
* use with Windows PowerShell. | ||
* @license MIT | ||
*/ | ||
|
||
import test from "ava"; | ||
|
||
import { constants, generate } from "../_.js"; | ||
|
||
import { escape } from "shescape"; | ||
|
||
let runTest = constants.isWindows ? test : test.skip; | ||
|
||
runTest("inputs are escaped for powershell.exe", (t) => { | ||
const shell = "powershell.exe"; | ||
for (const { expected, input, options } of generate.escapeExamples(shell)) { | ||
const result = escape(input, options); | ||
t.deepEqual(result, expected); | ||
} | ||
}); |
Oops, something went wrong.