-
Notifications
You must be signed in to change notification settings - Fork 642
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
48 additions
and
4 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,32 @@ | ||
/** | ||
* Turbo only supports caching on the individual task level, but for Wrangler's | ||
* e2e tests we want to support caching on a more granular basis—at the file level. | ||
* | ||
* As such, we run the `test:e2e` turbo task multiple times—once per e2e test file | ||
* with different arguments, ensuring that each file's tests can be cached individually. | ||
* | ||
* The intended flow here is that CI will run this file, which will trigger turbo to run | ||
* an individual task for each Wrangler e2e test file, using `execSync`. | ||
*/ | ||
import { execSync } from "child_process"; | ||
import { readdirSync } from "fs"; | ||
|
||
// Get a list of e2e test files, each of which should have an associated script | ||
const e2eTests = readdirSync("packages/wrangler/e2e"); | ||
|
||
const tasks = new Set<string>(); | ||
|
||
for (const file of e2eTests) { | ||
// Ignore other files in the e2e directory (the README, for instance) | ||
if (file.endsWith(".test.ts")) { | ||
tasks.add( | ||
`pnpm test:e2e --log-order=stream --summarize --filter wrangler --concurrency 1 -- run ./e2e/${file}` | ||
); | ||
} | ||
} | ||
|
||
for (const task of tasks.values()) { | ||
execSync(task, { | ||
stdio: "inherit", | ||
}); | ||
} |
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