♻️ refactor build-test-apps script with CLI arg support#4359
♻️ refactor build-test-apps script with CLI arg support#4359thomas-lebeau merged 3 commits intomainfrom
Conversation
- Add --app / -a flag to build specific apps instead of all - Add --help flag listing available apps - Unify app list into a single APPS config array (data-driven) - Flatten buildExtensions() loop into per-app buildExtension() function - buildApp() now accepts an app name and derives the path internally
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08c4ba66a9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const targetDir = `test/apps/${appName}` | ||
| printLog(`Building app at ${targetDir}...`) | ||
|
|
||
| buildApp(baseExtDir) | ||
|
|
||
| for (const { name, options } of OTHER_EXTENSIONS) { | ||
| const targetDir = path.join('test/apps', `${name}-extension`) | ||
| fs.rmSync(targetDir, { recursive: true, force: true }) | ||
| fs.cpSync(baseExtDir, targetDir, { recursive: true }) |
There was a problem hiding this comment.
Build base extension before generating derived extensions
When --app is used to build only cdn-extension or appendChild-extension, this function now just copies test/apps/base-extension without ensuring that base-extension was built in the same run. Because generated extension apps are not checked in and the dist/*.js artifacts come from the base build, targeted runs can produce extensions with missing or stale bundles, breaking browser-extension E2E scenarios. Add an explicit dependency build (or enforce selecting base-extension together) before the copy step.
Useful? React with 👍 / 👎.
- Add `deps` field to AppConfig to declare build-time dependencies - Build dependencies before the app that requires them, skipping already-built ones - Move CLI argument parsing inside runMain to avoid top-level side effects - Extract showHelpAndExit helper function - Add validation error when no valid --app name is specified
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 068c614 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
Motivation
The
build-test-appsscript was building all test apps unconditionally, making it slow when only a subset is needed (e.g., during development or targeted E2E testing). This refactor adds CLI argument support so specific apps can be built on demand.Changes
--app/-aCLI flag (repeatable) to select which apps to build; defaults to all apps if omitted--help/-hflag listing all available app namesAPPSarray, replacing separate hardcoded build callsbuildExtensions()into a per-extensionbuildExtension()builder function aligned with the new config-driven approachbuildApp()now derives the path from the app name internallyTest instructions
Checklist