Reworked site regression test suite to serverless boot

refs https://github.com/TryGhost/Toolbox/issues/152

- Being able to set up test suites without blocking a port opens a door to new ways to run tests - for example this has been one of the blockers for running mocha tests in parallel
- Additional benefit is lighter statrup, which reducec the test execution time slightly. Doesn't seem like much but these things stack up!
This commit is contained in:
Naz 2021-12-06 15:35:42 +04:00 committed by naz
parent fc8ecc352f
commit 4a1bee0a01
2 changed files with 7 additions and 7 deletions

View File

@ -8,8 +8,8 @@ describe('Config API', function () {
let request;
before(async function () {
await localUtils.startGhost();
request = supertest.agent(config.get('url'));
const app = await localUtils.startGhost();
request = supertest.agent(app);
await localUtils.doAuth(request);
});

View File

@ -137,10 +137,6 @@ const restartModeGhostStart = async ({frontend}) => {
limits.init();
};
const bootGhost = async ({backend, frontend}) => {
ghostServer = await boot({backend, frontend});
};
// CASE: Ghost Server needs Starting
// In this case we need to ensure that Ghost is started cleanly:
// - ensure the DB is reset
@ -166,7 +162,11 @@ const freshModeGhostStart = async (options) => {
await settingsService.init();
// Actually boot Ghost
await bootGhost(options);
ghostServer = await boot({
backend: options.backend,
frontend: options.frontend,
server: options.server
});
// Wait for the URL service to be ready, which happens after boot
if (options.frontend) {