From d6d36e24c5b050b82f041bb8cdac4ec69f6d13b7 Mon Sep 17 00:00:00 2001 From: BrandonLWhite Date: Fri, 6 Feb 2026 16:04:09 -0600 Subject: [PATCH 1/2] refactor: remove dry-run input and related logic from action --- README.md | 1 - action.yml | 4 ---- src/__tests__/index.test.ts | 19 ------------------- src/index.ts | 28 ++++++++++------------------ 4 files changed, 10 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 48693a0..4fed0a1 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,6 @@ jobs: | `service` | Service name for the coverage report | No | - | | `env` | Environment name (e.g., `ci`, `staging`) | No | - | | `flags` | Comma-separated flags for grouping (max 32) | No | - | -| `dry-run` | Run without uploading (for testing) | No | `false` | *Required via input or `DD_API_KEY` / `DATADOG_API_KEY` environment variable diff --git a/action.yml b/action.yml index 06bb971..095fed4 100644 --- a/action.yml +++ b/action.yml @@ -26,10 +26,6 @@ inputs: flags: description: 'Comma-separated list of flags for grouping and filtering (e.g., type:unit-tests,jvm-21)' required: false - dry-run: - description: 'Run without uploading (for testing)' - required: false - default: 'false' outputs: uploaded-files: diff --git a/src/__tests__/index.test.ts b/src/__tests__/index.test.ts index b3dcc5d..ff6a3ef 100644 --- a/src/__tests__/index.test.ts +++ b/src/__tests__/index.test.ts @@ -37,7 +37,6 @@ describe("index (run)", () => { service: "", env: "", flags: "", - "dry-run": "false", }; return inputs[name] || ""; }); @@ -224,24 +223,6 @@ describe("index (run)", () => { ); }); - it("should run in dry-run mode without uploading", async () => { - mockCore.getInput.mockImplementation((name: string) => { - const inputs: Record = { - "api-key": "test-api-key", - files: "**/coverage.xml", - "dry-run": "true", - }; - return inputs[name] || ""; - }); - - await runAction(); - - expect(mockUploadCoverageFiles).not.toHaveBeenCalled(); - expect(mockCore.info).toHaveBeenCalledWith( - expect.stringContaining("[DRY-RUN]"), - ); - }); - it("should parse flags correctly", async () => { mockCore.getInput.mockImplementation((name: string) => { const inputs: Record = { diff --git a/src/index.ts b/src/index.ts index bdc0389..8125b39 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,7 +16,6 @@ async function run(): Promise { const service = core.getInput('service') || process.env.DD_SERVICE; const env = core.getInput('env') || process.env.DD_ENV; const flagsInput = core.getInput('flags'); - const dryRun = core.getInput('dry-run') === 'true'; if (!apiKey) { throw new Error( @@ -63,25 +62,18 @@ async function run(): Promise { } // Upload files - if (dryRun) { - core.info('[DRY-RUN] Would upload the following files:'); - files.forEach((f) => core.info(` - ${f.path}`)); - } else { - await uploadCoverageFiles({ - apiKey, - site, - files, - context, - service, - env, - flags, - }); - } + await uploadCoverageFiles({ + apiKey, + site, + files, + context, + service, + env, + flags, + }); const elapsed = (Date.now() - startTime) / 1000; - core.info( - `✅ ${dryRun ? '[DRY-RUN] ' : ''}Uploaded ${files.length} file(s) in ${elapsed.toFixed(2)} seconds` - ); + core.info(`✅ Uploaded ${files.length} file(s) in ${elapsed.toFixed(2)} seconds`); core.setOutput('uploaded-files', files.length); core.setOutput('upload-time', elapsed.toFixed(2)); From 744e3c12836ab1e98f327ea859c14856c9091153 Mon Sep 17 00:00:00 2001 From: BrandonLWhite Date: Fri, 6 Feb 2026 16:10:35 -0600 Subject: [PATCH 2/2] Max out code coverage thresholds. Build. --- dist/index.js | 27 ++++++++++----------------- jest.config.mjs | 8 ++++---- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/dist/index.js b/dist/index.js index fed2db9..92dd4cd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -48616,7 +48616,6 @@ async function run() { const service = getInput('service') || process.env.DD_SERVICE; const env = getInput('env') || process.env.DD_ENV; const flagsInput = getInput('flags'); - const dryRun = getInput('dry-run') === 'true'; if (!apiKey) { throw new Error('Datadog API key is required. Set it via api-key input, DD_API_KEY, or DATADOG_API_KEY environment variable.'); } @@ -48650,23 +48649,17 @@ async function run() { throw new Error('Could not determine git commit SHA'); } // Upload files - if (dryRun) { - info('[DRY-RUN] Would upload the following files:'); - files.forEach((f) => info(` - ${f.path}`)); - } - else { - await uploadCoverageFiles({ - apiKey, - site, - files, - context, - service, - env, - flags, - }); - } + await uploadCoverageFiles({ + apiKey, + site, + files, + context, + service, + env, + flags, + }); const elapsed = (Date.now() - startTime) / 1000; - info(`✅ ${dryRun ? '[DRY-RUN] ' : ''}Uploaded ${files.length} file(s) in ${elapsed.toFixed(2)} seconds`); + info(`✅ Uploaded ${files.length} file(s) in ${elapsed.toFixed(2)} seconds`); setOutput('uploaded-files', files.length); setOutput('upload-time', elapsed.toFixed(2)); } diff --git a/jest.config.mjs b/jest.config.mjs index 5685b5d..c5ffbdb 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -13,10 +13,10 @@ export default { coverageReporters: ['text', 'lcov', 'html'], coverageThreshold: { global: { - branches: 80, - functions: 80, - lines: 80, - statements: 80, + branches: 100, + functions: 100, + lines: 100, + statements: 100, }, }, clearMocks: true,