Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove gc and netlify build tests #1075

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
);
});
});
});
Loading