Skip to content

Commit 3d2c333

Browse files
committed
fix tests and formatting
1 parent aa4d28c commit 3d2c333

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/action.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as core from "@actions/core";
22
import { v4 as uuid } from "uuid";
33

44
const WORKFLOW_TIMEOUT_SECONDS = 5 * 60;
5-
const WORKFLOW_JOB_STEPS_RETRY_SECONDS = 5
5+
const WORKFLOW_JOB_STEPS_RETRY_SECONDS = 5;
66

77
/**
88
* action.yaml definition.

src/main.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ describe("main", () => {
174174
distinctIdRegex: distinctIdRegex,
175175
workflowId: 0,
176176
workflowTimeoutMs: testCfg.workflowTimeoutSeconds * 1000,
177-
workflowJobStepsRetryMs :testCfg.workflowJobStepsRetrySeconds * 1000,
177+
workflowJobStepsRetryMs: testCfg.workflowJobStepsRetrySeconds * 1000,
178178
});
179179

180180
// Result

src/return-dispatch.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ describe("return-dispatch", () => {
665665

666666
const retryMs = 5000;
667667
const timeoutMs = 60 * 60 * 100;
668-
668+
669669
const getRunIdAndUrlPromise = getRunIdAndUrl({
670670
...defaultOpts,
671671
workflowTimeoutMs: timeoutMs,
@@ -678,8 +678,9 @@ describe("return-dispatch", () => {
678678

679679
assertOnlyCalled(coreInfoLogMock);
680680

681-
expect(coreInfoLogMock).toHaveBeenCalledOnce();
681+
expect(coreInfoLogMock).toHaveBeenCalledTimes(2);
682682
expect(coreInfoLogMock.mock.calls[0]?.[0]).toMatchSnapshot();
683+
expect(coreInfoLogMock.mock.calls[1]?.[0]).toMatchSnapshot();
683684

684685
expect(utilSleepMock).toHaveBeenCalledOnce();
685686
expect(utilSleepMock).toHaveBeenCalledWith(retryMs);
@@ -788,8 +789,9 @@ describe("return-dispatch", () => {
788789
expect(apiFetchWorkflowRunJobStepsMock).toHaveBeenCalledOnce();
789790
assertOnlyCalled(coreDebugLogMock, coreInfoLogMock);
790791

791-
expect(coreInfoLogMock).toHaveBeenCalledOnce();
792+
expect(coreInfoLogMock).toHaveBeenCalledTimes(2);
792793
expect(coreInfoLogMock.mock.calls[0]?.[0]).toMatchSnapshot();
794+
expect(coreInfoLogMock.mock.calls[1]?.[0]).toMatchSnapshot();
793795

794796
expect(coreDebugLogMock).toHaveBeenCalledOnce();
795797
expect(coreDebugLogMock.mock.calls[0]?.[0]).toMatchSnapshot();

src/return-dispatch.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export async function getRunIdAndUrl({
140140
workflowJobStepsRetryMs,
141141
}: GetRunIdAndUrlOpts): Promise<Result<{ id: number; url: string }>> {
142142
const retryTimeout = Math.max(
143-
workflowJobStepsRetryMs,
143+
constants.WORKFLOW_FETCH_TIMEOUT_MS,
144144
workflowTimeoutMs,
145145
);
146146

@@ -194,4 +194,3 @@ export async function getRunIdAndUrl({
194194

195195
return { success: false, reason: "timeout" };
196196
}
197-

0 commit comments

Comments
 (0)