mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-08 12:57:46 +00:00
[tests] Use AL2 build container for relevant e2e tests (#11329)
* Forces the AL2 build container image for fixtures that depend on it, via `engines.node` in package.json for most cases. * The `testDeployment()` function was updated to send `projectSettings.nodeVersion` in the POST body, to mimic the behavior in CLI. * For Go, Ruby, and Python tests, the `projectSettings.nodeVersion` property is set "globally" in the Jest setup file, so that individual fixtures didn't need to be adjusted.
This commit is contained in:
13
packages/python/test/integration-setup.js
vendored
13
packages/python/test/integration-setup.js
vendored
@@ -28,12 +28,19 @@ module.exports = function setupTests(groupIndex) {
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const fixture of chunkedFixtures) {
|
||||
// Python endpoints currently require the AL2 build image
|
||||
const projectSettings = {
|
||||
nodeVersion: '18.x',
|
||||
};
|
||||
|
||||
const errMsg = testsThatFailToBuild.get(fixture);
|
||||
if (errMsg) {
|
||||
// eslint-disable-next-line no-loop-func
|
||||
it(`should fail to build ${fixture}`, async () => {
|
||||
try {
|
||||
await testDeployment(path.join(fixturesPath, fixture));
|
||||
await testDeployment(path.join(fixturesPath, fixture), {
|
||||
projectSettings,
|
||||
});
|
||||
} catch (err) {
|
||||
expect(err).toBeTruthy();
|
||||
expect(err.deployment).toBeTruthy();
|
||||
@@ -45,7 +52,9 @@ module.exports = function setupTests(groupIndex) {
|
||||
// eslint-disable-next-line no-loop-func
|
||||
it(`should build ${fixture}`, async () => {
|
||||
await expect(
|
||||
testDeployment(path.join(fixturesPath, fixture))
|
||||
testDeployment(path.join(fixturesPath, fixture), {
|
||||
projectSettings,
|
||||
})
|
||||
).resolves.toBeDefined();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user