Skip to content

Commit

Permalink
remove gc and netlify build tests
Browse files Browse the repository at this point in the history
  • Loading branch information
seungpark committed Oct 16, 2024
1 parent dec90af commit 3946c14
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions tests/unit/job/stagingJobHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,51 +90,4 @@ describe('StagingJobHandler Tests', () => {
expect(queueManifestJobSpy).toBeCalledTimes(0);
expect(jobHandlerTestHelper.jobRepo.insertJob).toBeCalledTimes(0);
});

describe('Gatsby Cloud build hooks', () => {
beforeEach(() => {
process.env.GATSBY_CLOUD_PREVIEW_WEBHOOK_ENABLED = 'true';
});

test('Staging with Gatsby Cloud site does not result in immediate job completion', async () => {
jobHandlerTestHelper.setStageForDeploySuccess(false, undefined, { hasGatsbySiteId: true });
await jobHandlerTestHelper.jobHandler.execute();
// Post-build webhook is expected to update the status
expect(jobHandlerTestHelper.jobRepo.updateWithStatus).toBeCalledTimes(0);
});

test('Gatsby Cloud build hook fail results in job failure', async () => {
jobHandlerTestHelper.setStageForDeploySuccess(false, undefined, { hasGatsbySiteId: true });
spyPost.mockImplementationOnce(() => Promise.reject({}));
await jobHandlerTestHelper.jobHandler.execute();
expect(jobHandlerTestHelper.jobRepo.updateWithErrorStatus).toBeCalledTimes(1);
});
});

describe('Netlify build hooks', () => {
beforeEach(() => {
process.env.GATSBY_CLOUD_PREVIEW_WEBHOOK_ENABLED = 'true';
});

test('Staging with Netlify does not result in immediate job completion with Gatsby Cloud', async () => {
jobHandlerTestHelper.setStageForDeploySuccess(false, undefined, {
hasGatsbySiteId: true,
hasNetlifyBuildHook: true,
});
await jobHandlerTestHelper.jobHandler.execute();
// Post-build webhook is expected to update the status
expect(jobHandlerTestHelper.jobRepo.updateWithStatus).toBeCalledTimes(0);
});

test('Netlify build hook error does not interfere with job execution', async () => {
jobHandlerTestHelper.setStageForDeploySuccess(false, undefined, { hasNetlifyBuildHook: true });
spyPost.mockImplementationOnce(() => Promise.reject({}));
await jobHandlerTestHelper.jobHandler.execute();
expect(jobHandlerTestHelper.jobRepo.updateWithStatus).toBeCalledWith(
expect.anything(),
undefined,
JobStatus.completed
);
});
});
});

0 comments on commit 3946c14

Please sign in to comment.