Testing perf improvements for e2e tests (#4354)

* WIP: testing fixes to share the dev server in e2e test suites

* temp: testing multiple workers

* Revert "temp: testing multiple workers"

This reverts commit 9c7bc9d93c9c3f6dd62e3732f878f2d86016b213.
This commit is contained in:
Tony Sullivan 2022-08-17 19:37:10 +00:00 committed by GitHub
parent beed20be4a
commit 1c6895884c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 47 additions and 51 deletions

View file

@ -6,11 +6,11 @@ const test = testFactory({ root: './fixtures/astro-component/' });
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async () => {
test.afterAll(async () => {
await devServer.stop();
});

View file

@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/client-only/' });
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async () => {
test.afterAll(async () => {
await devServer.stop();
});

View file

@ -5,13 +5,12 @@ const test = testFactory({ root: './fixtures/error-react-spectrum/' });
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async ({ astro }) => {
test.afterAll(async ({ astro }) => {
await devServer.stop();
astro.resetAllFiles();
});
test.describe('Error: React Spectrum', () => {

View file

@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/error-sass/' });
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async ({ astro }) => {
test.afterAll(async ({ astro }) => {
await devServer.stop();
astro.resetAllFiles();
});

View file

@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/errors/' });
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async ({ astro }) => {
test.afterAll(async ({ astro }) => {
await devServer.stop();
astro.resetAllFiles();
});

View file

@ -7,11 +7,11 @@ const test = testFactory({
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async () => {
test.afterAll(async () => {
await devServer.stop();
});

View file

@ -8,7 +8,7 @@ const test = testFactory({
// TODO: configure playwright to handle web component APIs
// https://github.com/microsoft/playwright/issues/14241
test.describe('Lit components', () => {
test.beforeEach(() => {
test.beforeAll(() => {
delete globalThis.window;
});
@ -16,11 +16,11 @@ test.describe('Lit components', () => {
let devServer;
const t = test.extend({});
t.beforeEach(async ({ astro }) => {
t.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
t.afterEach(async () => {
t.afterAll(async () => {
await devServer.stop();
});
@ -120,11 +120,11 @@ test.describe('Lit components', () => {
await astro.build();
});
t.beforeEach(async ({ astro }) => {
t.beforeAll(async ({ astro }) => {
previewServer = await astro.preview();
});
t.afterEach(async () => {
t.afterAll(async () => {
await previewServer.stop();
});

View file

@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/multiple-frameworks/' });
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async () => {
test.afterAll(async () => {
await devServer.stop();
});

View file

@ -7,11 +7,11 @@ const test = testFactory({
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async () => {
test.afterAll(async () => {
await devServer.stop();
});

View file

@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/nested-in-preact/' });
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async () => {
test.afterAll(async () => {
await devServer.stop();
});

View file

@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/nested-in-react/' });
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async () => {
test.afterAll(async () => {
await devServer.stop();
});

View file

@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/nested-in-solid/' });
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async () => {
test.afterAll(async () => {
await devServer.stop();
});

View file

@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/nested-in-svelte/' });
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async () => {
test.afterAll(async () => {
await devServer.stop();
});

View file

@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/nested-in-vue/' });
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async () => {
test.afterAll(async () => {
await devServer.stop();
});

View file

@ -10,11 +10,11 @@ const test = base.extend({
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async () => {
test.afterAll(async () => {
await devServer.stop();
});

View file

@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/nested-styles/' });
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async () => {
test.afterAll(async () => {
await devServer.stop();
});

View file

@ -7,11 +7,11 @@ const test = testFactory({
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async () => {
test.afterAll(async () => {
await devServer.stop();
});

View file

@ -6,11 +6,11 @@ export function prepareTestFactory(opts) {
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async () => {
test.afterAll(async () => {
await devServer.stop();
});

View file

@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/solid-recurse/' });
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async () => {
test.afterAll(async () => {
await devServer.stop();
});

View file

@ -5,11 +5,11 @@ const test = testFactory({ root: './fixtures/tailwindcss/' });
let devServer;
test.beforeEach(async ({ astro }) => {
test.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
test.afterEach(async ({ astro }) => {
test.afterAll(async ({ astro }) => {
await devServer.stop();
astro.resetAllFiles();
});

View file

@ -18,7 +18,7 @@ export function testFactory(inlineConfig) {
const test = testBase.extend({
astro: async ({}, use) => {
fixture = await loadFixture(inlineConfig);
fixture = fixture || await loadFixture(inlineConfig);
await use(fixture);
},
});

View file

@ -26,11 +26,11 @@ test.describe('TypeScript resolution -', () => {
let devServer;
t.beforeEach(async ({ astro }) => {
t.beforeAll(async ({ astro }) => {
devServer = await astro.startDevServer();
});
t.afterEach(async () => {
t.afterAll(async () => {
await devServer.stop();
});
@ -44,13 +44,10 @@ test.describe('TypeScript resolution -', () => {
t.beforeAll(async ({ astro }) => {
await astro.build();
});
t.beforeEach(async ({ astro }) => {
previewServer = await astro.preview();
});
t.afterEach(async () => {
t.afterAll(async () => {
await previewServer.stop();
});