Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
11 changes: 7 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ jobs:
junit-paths: junit.xml,smoke-tests/quarantine-failure.xml
org-slug: trunk
token: ${{ secrets.TRUNK_PROD_ORG_API_TOKEN }}
allow-missing-junit-files: "false"
allow-missing-junit-files: false
use-cache: true

- name: Trunk Analytics Uploader (Staging)
uses: ./
Expand All @@ -78,7 +79,8 @@ jobs:
junit-paths: junit.xml,smoke-tests/quarantine-failure.xml
org-slug: trunk-staging-org
token: ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }}
allow-missing-junit-files: "false"
allow-missing-junit-files: false
use-cache: true
env:
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io

Expand All @@ -97,8 +99,9 @@ jobs:
junit-paths: smoke-tests/quarantine-failure.xml
org-slug: trunk
token: ${{ secrets.TRUNK_PROD_ORG_API_TOKEN }}
allow-missing-junit-files: "false"
dry-run: "true"
allow-missing-junit-files: false
dry-run: true
use-cache: true

- name: Verify bundle_upload directory was cleaned up
run: |
Expand Down
8 changes: 8 additions & 0 deletions __fixtures__/cache.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { jest } from "@jest/globals";

export const restoreCache = jest.fn() as jest.MockedFunction<
(paths: string[], key: string) => Promise<string | undefined>
>;
export const saveCache = jest.fn() as jest.MockedFunction<
(paths: string[], key: string) => Promise<void>
>;
12 changes: 6 additions & 6 deletions __tests__/arguments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jest.unstable_mockModule("@actions/github", () => github);
jest.unstable_mockModule("node-fetch", () => nodeFetch);

const {
parseBool,
parseBoolIntoFlag,
main,
parsePreviousStepOutcome,
fetchApiAddress,
Expand Down Expand Up @@ -75,21 +75,21 @@ describe("convertToTelemetry", () => {
});
});

describe("parseBool", () => {
describe("parseBoolIntoFlag", () => {
it("returns empty string for undefined input", () => {
expect(parseBool(undefined, "--flag")).toBe("");
expect(parseBoolIntoFlag(undefined, "--flag")).toBe("");
});

it("returns flag with true for 'true'", () => {
expect(parseBool("true", "--flag")).toBe("--flag=true");
expect(parseBoolIntoFlag("true", "--flag")).toBe("--flag=true");
});

it("returns flag with false for 'false'", () => {
expect(parseBool("false", "--flag")).toBe("--flag=false");
expect(parseBoolIntoFlag("false", "--flag")).toBe("--flag=false");
});

it("returns empty string for non-boolean input", () => {
expect(parseBool("not-a-boolean", "--flag")).toBe("");
expect(parseBoolIntoFlag("not-a-boolean", "--flag")).toBe("");
});
});

Expand Down
Loading
Loading