[APPS] Add e2e test and frontend/ archive prefix for apps plugin#290
[APPS] Add e2e test and frontend/ archive prefix for apps plugin#290
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
| body: typeof body === 'string' ? body : JSON.stringify(body), | ||
| }; | ||
| // Write to a known location so all workers can read it. | ||
| const outDir = path.resolve(__dirname, '..', '..', '_playwright', 'public', 'appsPlugin'); |
There was a problem hiding this comment.
Does running the test output a file into this folder, and is this file tracked by git? Couldn't we create a temporary folder instead?
About mocking in general, looking at how Playwright mocks requests, seems like we could also handle it via page.route, including a page.waitForResponse to monitor the network call and verify the response. More detailed documentation in their Network page.
There was a problem hiding this comment.
Good call 👍. I can take a look at this.
| DD_ENV: ci | ||
|
|
||
| e2e: | ||
| timeout-minutes: 10 |
There was a problem hiding this comment.
Is there an explanation for this increase?
There was a problem hiding this comment.
The e2e CI/CD job is very flaky. It can take between 5-30 minutes. It seems primarily because it can take a while to install playwright if it isn't cached.
sarenji
left a comment
There was a problem hiding this comment.
LGTM.
If the upload-capture.json file is not tracked by git after running the e2e test locally then this is fine to merge. If not then I'd encourage pursuing one of the solutions I commented about.

Motivation
Prepares the apps plugin archive structure for the upcoming backend functions feature. The downstream branch (
sdkennedy2/apps-backend-functions-upload-v2) expects frontend assets to live under afrontend/subdirectory in the upload archive, alongsidebackend/for backend function outputs. This PR moves that prefixing into the parent branch so the archive structure is consistent regardless of whether backend functions are present.The backend API endpoint has already been updated to accept frontend assets in a subfolder, so this change is safe to land independently.
Changes
frontend/before being added to the upload archive. Previously, assets were placed at the root of the zip.frontend/.createArchiveassertions to expect thefrontend/-prefixed paths.QA Instructions
yarn test:unit packages/plugins/apps— all unit tests should passyarn test:e2e packages/tests/src/e2e/appsPlugin --project "chrome | webpack"— e2e tests should pass, including the new archive structure verificationBlast Radius
apps.enableconfig flag, so no impact to users who don't use the apps plugin.frontend/subfolder structure, so no coordination with backend deploys is needed.Documentation