-
Notifications
You must be signed in to change notification settings - Fork 710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Granular c3 e2e caching #6729
Closed
Closed
Granular c3 e2e caching #6729
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,20 @@ | ||
export const frameworks = [ | ||
"astro", | ||
"docusaurus", | ||
"analog", | ||
"angular", | ||
"gatsby", | ||
"hono", | ||
"qwik", | ||
"remix", | ||
"next", | ||
"nuxt", | ||
"react", | ||
"solid", | ||
"svelte", | ||
"vue", | ||
] as const; | ||
type Framework = (typeof frameworks)[number]; | ||
export const frameworkMap = Object.fromEntries( | ||
frameworks.map((f) => [f, f]), | ||
) as Record<Framework, string>; |
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,38 @@ | ||
/** | ||
* Turbo only supports caching on the individual task level, but for C3's | ||
* e2e tests we want to support caching on a more granular basis—at the file level & test level. | ||
* | ||
* As such, we run the `test:e2e` turbo task multiple times—once per e2e test file, and once per framework test | ||
* 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 C3 e2e test file & test, using `execSync`. | ||
*/ | ||
import { execSync } from "child_process"; | ||
import { readdirSync } from "fs"; | ||
import { frameworks } from "../../packages/create-cloudflare/e2e-tests/definitions"; | ||
|
||
// Get a list of e2e test files, each of which should have an associated script | ||
const e2eTests = readdirSync("packages/create-cloudflare/e2e-tests"); | ||
|
||
const tasks = new Set<string>(); | ||
|
||
for (const file of e2eTests) { | ||
if (file === "frameworks.test.ts") { | ||
for (const framework of frameworks) { | ||
tasks.add( | ||
`pnpm test:e2e --log-order=stream --summarize --filter create-cloudflare --concurrency 1 -- run ./e2e-tests/${file} -t ${framework}` | ||
); | ||
} | ||
} else if (file.endsWith(".test.ts")) { | ||
tasks.add( | ||
`pnpm test:e2e --log-order=stream --summarize --filter create-cloudflare --concurrency 1 -- run ./e2e-tests/${file}` | ||
); | ||
} | ||
} | ||
|
||
for (const task of tasks.values()) { | ||
execSync(task, { | ||
stdio: "inherit", | ||
}); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Shell command built from environment values Medium