Skip to content

Commit 87b877d

Browse files
YermanacoCodex-
authored andcommitted
fix tests and formatting
1 parent 9c8b77c commit 87b877d

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
@@ -3,7 +3,7 @@ import { randomUUID } from "node:crypto";
33
import * as core from "@actions/core";
44

55
const WORKFLOW_TIMEOUT_SECONDS = 5 * 60;
6-
const WORKFLOW_JOB_STEPS_RETRY_SECONDS = 5
6+
const WORKFLOW_JOB_STEPS_RETRY_SECONDS = 5;
77

88
/**
99
* 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
@@ -666,7 +666,7 @@ describe("return-dispatch", () => {
666666

667667
const retryMs = 5000;
668668
const timeoutMs = 60 * 60 * 100;
669-
669+
670670
const getRunIdAndUrlPromise = getRunIdAndUrl({
671671
...defaultOpts,
672672
workflowTimeoutMs: timeoutMs,
@@ -679,8 +679,9 @@ describe("return-dispatch", () => {
679679

680680
assertOnlyCalled(coreInfoLogMock);
681681

682-
expect(coreInfoLogMock).toHaveBeenCalledOnce();
682+
expect(coreInfoLogMock).toHaveBeenCalledTimes(2);
683683
expect(coreInfoLogMock.mock.calls[0]?.[0]).toMatchSnapshot();
684+
expect(coreInfoLogMock.mock.calls[1]?.[0]).toMatchSnapshot();
684685

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

792-
expect(coreInfoLogMock).toHaveBeenCalledOnce();
793+
expect(coreInfoLogMock).toHaveBeenCalledTimes(2);
793794
expect(coreInfoLogMock.mock.calls[0]?.[0]).toMatchSnapshot();
795+
expect(coreInfoLogMock.mock.calls[1]?.[0]).toMatchSnapshot();
794796

795797
expect(coreDebugLogMock).toHaveBeenCalledOnce();
796798
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)