Repository: codecov/uploader
Pull request #999 (2023-03-28 22:55:13)

fix: refactor spawnsize
fixes https://github.com/codecov/uploader/issues/787

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/codecov/uploader/compare/999?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) Report
> Merging [#999](https://app.codecov.io/gh/codecov/uploader/compare/999?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) (79f6ffd) into [main](https://codecov.io/gh/codecov/uploader/commit/3eaeabfc6b747350c0b6f1c65437dd291f1e0cb2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) (3eaeabf) will **decrease** coverage by `0.01%`.
> The diff coverage is `100.00%`.

```diff
@@            Coverage Diff             @@
##             main     #999      +/-   ##
==========================================
- Coverage   92.33%   92.32%   -0.01%     
==========================================
  Files          35       35              
  Lines        1317     1316       -1     
  Branches      270      270              
==========================================
- Hits         1216     1215       -1     
  Misses         69       69              
  Partials       32       32              
```

| Flag | Coverage Δ | |
|---|---|---|
| alpine | `92.24% <100.00%> (-0.01%)` | :arrow_down: |
| alpine-proxy | `92.24% <100.00%> (-0.01%)` | :arrow_down: |
| alpine-without-git | `92.24% <100.00%> (-0.01%)` | :arrow_down: |
| linux | `92.24% <100.00%> (-0.01%)` | :arrow_down: |
| linux-without-git | `92.24% <100.00%> (-0.01%)` | :arrow_down: |
| macos | `92.24% <100.00%> (-0.01%)` | :arrow_down: |
| macos-without-git | `92.24% <100.00%> (-0.01%)` | :arrow_down: |
| windows | `91.64% <100.00%> (-0.01%)` | :arrow_down: |
| windows-without-git | `91.64% <100.00%> (-0.01%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://app.codecov.io/gh/codecov/uploader/compare/999?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | Coverage Δ | |
|---|---|---|
| [src/helpers/constants.ts](https://app.codecov.io/gh/codecov/uploader/compare/999?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-c3JjL2hlbHBlcnMvY29uc3RhbnRzLnRz) | `100.00% <ø> (ø)` | |
| [src/helpers/files.ts](https://app.codecov.io/gh/codecov/uploader/compare/999?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-c3JjL2hlbHBlcnMvZmlsZXMudHM=) | `92.30% <100.00%> (ø)` | |
| [src/helpers/token.ts](https://app.codecov.io/gh/codecov/uploader/compare/999?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-c3JjL2hlbHBlcnMvdG9rZW4udHM=) | `88.37% <100.00%> (ø)` | |
| [src/helpers/util.ts](https://app.codecov.io/gh/codecov/uploader/compare/999?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-c3JjL2hlbHBlcnMvdXRpbC50cw==) | `75.00% <100.00%> (-1.48%)` | :arrow_down: |


Patch:
diff --git a/src/helpers/constansts.ts b/src/helpers/constants.ts
similarity index 100%
rename from src/helpers/constansts.ts
rename to src/helpers/constants.ts
diff --git a/src/helpers/files.ts b/src/helpers/files.ts
index 74d03ea..bbb9f28 100644
--- a/src/helpers/files.ts
+++ b/src/helpers/files.ts
@@ -7,7 +7,7 @@ import { UploaderArgs } from '../types'
 import { logError, UploadLogger } from './logger'
 import { runExternalProgram } from './util'
 import micromatch from "../vendor/micromatch/index.js";
-import { SPAWNPROCESSBUFFERSIZE } from './constansts'
+import { SPAWNPROCESSBUFFERSIZE } from './constants'
 
 export const MARKER_NETWORK_END = '\n<<<<<< network\n'
 export const MARKER_FILE_END = '<<<<<< EOF\n'
diff --git a/src/helpers/token.ts b/src/helpers/token.ts
index f20f508..238c681 100644
--- a/src/helpers/token.ts
+++ b/src/helpers/token.ts
@@ -2,7 +2,7 @@ import fs from 'fs'
 import yaml from 'js-yaml'
 import path from 'path'
 import { UploaderInputs } from '../types'
-import { DEFAULT_UPLOAD_HOST } from './constansts'
+import { DEFAULT_UPLOAD_HOST } from './constants'
 import { info, logError, UploadLogger } from './logger'
 import { validateToken } from './validate'
 
diff --git a/src/helpers/util.ts b/src/helpers/util.ts
index 3d861a2..81f17b1 100644
--- a/src/helpers/util.ts
+++ b/src/helpers/util.ts
@@ -1,7 +1,5 @@
 import childprocess from 'child_process'
-import { SPAWNPROCESSBUFFERSIZE } from './constansts'
-export { SPAWNPROCESSBUFFERSIZE } from './constansts'
-
+import { SPAWNPROCESSBUFFERSIZE } from './constants'
 
 
 export function isProgramInstalled(programName: string): boolean {


Test patch:
diff --git a/test/helpers/coveragepy.test.ts b/test/helpers/coveragepy.test.ts
index 050549b..a1f5f83 100644
--- a/test/helpers/coveragepy.test.ts
+++ b/test/helpers/coveragepy.test.ts
@@ -1,9 +1,9 @@
 import path from 'path'
 import childProcess from 'child_process'
 import td from 'testdouble'
+import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/constants'
 import { generateCoveragePyFile } from '../../src/helpers/coveragepy'
 import * as fileHelpers from '../../src/helpers/files'
-import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/util'
 
 describe('generateCoveragePyFile()', () => {
     afterEach(() => {
diff --git a/test/helpers/files.test.ts b/test/helpers/files.test.ts
index b789c75..c925701 100644
--- a/test/helpers/files.test.ts
+++ b/test/helpers/files.test.ts
@@ -3,7 +3,7 @@ import fs from 'fs'
 import childProcess from 'child_process'
 import * as fileHelpers from '../../src/helpers/files'
 import { getBlocklist } from '../../src/helpers/files'
-import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/util'
+import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/constants'
 import mock from 'mock-fs'
 
 describe('File Helpers', () => {
diff --git a/test/helpers/gcov.test.ts b/test/helpers/gcov.test.ts
index 35cd3c3..818915f 100644
--- a/test/helpers/gcov.test.ts
+++ b/test/helpers/gcov.test.ts
@@ -2,7 +2,7 @@
 import td from 'testdouble'
 import childProcess from 'child_process'
 import { generateGcovCoverageFiles } from '../../src/helpers/gcov'
-import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/util'
+import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/constants'
 
 describe('generateGcovCoverageFiles()', () => {
     afterEach(() => {
diff --git a/test/helpers/swift.test.ts b/test/helpers/swift.test.ts
index e4212c8..450aa86 100644
--- a/test/helpers/swift.test.ts
+++ b/test/helpers/swift.test.ts
@@ -3,7 +3,7 @@ import childProcess from 'child_process'
 
 import * as fsPromise from 'fs/promises'
 import os from 'os'
-import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/util'
+import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/constants'
 import { generateSwiftCoverageFiles } from '../../src/helpers/swift'
 
 describe('generateSwiftCoverageFiles()', () => {
diff --git a/test/helpers/token.test.ts b/test/helpers/token.test.ts
index 086d1dd..2451d24 100644
--- a/test/helpers/token.test.ts
+++ b/test/helpers/token.test.ts
@@ -2,8 +2,8 @@ import path from 'path'
 
 import * as fileHelpers from '../../src/helpers/files'
 import * as tokenHelpers from '../../src/helpers/token'
-import { UploaderArgs, UploaderInputs } from '../../src/types'
-import { DEFAULT_UPLOAD_HOST } from '../../src/helpers/constansts'
+import { UploaderInputs } from '../../src/types'
+import { DEFAULT_UPLOAD_HOST } from '../../src/helpers/constants'
 import { createEmptyArgs } from '../test_helpers'
 
 describe('Get tokens', () => {
diff --git a/test/helpers/util.test.ts b/test/helpers/util.test.ts
index c4c407a..e3a7561 100644
--- a/test/helpers/util.test.ts
+++ b/test/helpers/util.test.ts
@@ -1,7 +1,7 @@
 import childProcess from 'child_process'
 import td from 'testdouble'
 import { isProgramInstalled, runExternalProgram } from '../../src/helpers/util'
-import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/constansts'
+import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/constants'
 
 describe('isProgramInstalled()', () => {
   afterEach(() => {
diff --git a/test/helpers/xcode.test.ts b/test/helpers/xcode.test.ts
index 9c6b2ef..b2e31a0 100644
--- a/test/helpers/xcode.test.ts
+++ b/test/helpers/xcode.test.ts
@@ -1,6 +1,6 @@
 import td from 'testdouble'
 import childProcess from 'child_process'
-import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/util'
+import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/constants'
 import { generateXcodeCoverageFiles } from '../../src/helpers/xcode'
 
 describe('generateXcodeCoverageFiles()', () => {
diff --git a/test/providers/provider_azurepipelines.test.ts b/test/providers/provider_azurepipelines.test.ts
index c8fe48e..8d57a6d 100644
--- a/test/providers/provider_azurepipelines.test.ts
+++ b/test/providers/provider_azurepipelines.test.ts
@@ -2,7 +2,7 @@ import td from 'testdouble'
 import childProcess from 'child_process'
 
 import * as providerAzurepipelines from '../../src/ci_providers//provider_azurepipelines'
-import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/util'
+import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/constants'
 import { IServiceParams, UploaderInputs } from '../../src/types'
 import { createEmptyArgs } from '../test_helpers'
 
diff --git a/test/providers/provider_bitbucket.test.ts b/test/providers/provider_bitbucket.test.ts
index 9f631eb..8e19d7a 100644
--- a/test/providers/provider_bitbucket.test.ts
+++ b/test/providers/provider_bitbucket.test.ts
@@ -1,7 +1,7 @@
 import childProcess from 'child_process'
 import td from 'testdouble'
-import * as providerBitbucket from '../../src/ci_providers//provider_bitbucket'
-import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/util'
+import * as providerBitbucket from '../../src/ci_providers/provider_bitbucket'
+import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/constants'
 import { IServiceParams, UploaderInputs } from '../../src/types'
 import { createEmptyArgs } from '../test_helpers'
 
diff --git a/test/providers/provider_bitrise.test.ts b/test/providers/provider_bitrise.test.ts
index fe6626d..b94448f 100644
--- a/test/providers/provider_bitrise.test.ts
+++ b/test/providers/provider_bitrise.test.ts
@@ -1,10 +1,10 @@
 import td from 'testdouble'
 import childProcess from 'child_process'
-import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/util'
+import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/constants'
 import { IServiceParams, UploaderInputs } from '../../src/types'
 import { createEmptyArgs } from '../test_helpers'
 
-import * as providerBitrise from '../../src/ci_providers//provider_bitrise'
+import * as providerBitrise from '../../src/ci_providers/provider_bitrise'
 
 describe('Bitrise Params', () => {
   afterEach(() => {
diff --git a/test/providers/provider_githubactions.test.ts b/test/providers/provider_githubactions.test.ts
index 4d42a9d..114afe1 100644
--- a/test/providers/provider_githubactions.test.ts
+++ b/test/providers/provider_githubactions.test.ts
@@ -2,8 +2,8 @@ import td from 'testdouble'
 import Undici from 'undici'
 import childProcess from 'child_process'
 
-import * as providerGitHubactions from '../../src/ci_providers//provider_githubactions'
-import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/util'
+import * as providerGitHubactions from '../../src/ci_providers/provider_githubactions'
+import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/constants'
 import { IServiceParams, UploaderInputs } from '../../src/types'
 import { createEmptyArgs } from '../test_helpers'
 
diff --git a/test/providers/provider_gitlabci.test.ts b/test/providers/provider_gitlabci.test.ts
index 0bcffee..c189996 100644
--- a/test/providers/provider_gitlabci.test.ts
+++ b/test/providers/provider_gitlabci.test.ts
@@ -2,7 +2,7 @@ import td from 'testdouble'
 import childProcess from 'child_process'
 
 import * as providerGitLabci from '../../src/ci_providers/provider_gitlabci'
-import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/util'
+import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/constants'
 import { IServiceParams, UploaderInputs } from '../../src/types'
 import { createEmptyArgs } from '../test_helpers'
 
diff --git a/test/providers/provider_herokuci.test.ts b/test/providers/provider_herokuci.test.ts
index 32cdf5a..2269906 100644
--- a/test/providers/provider_herokuci.test.ts
+++ b/test/providers/provider_herokuci.test.ts
@@ -1,6 +1,6 @@
 import td from 'testdouble'
 import childProcess from 'child_process'
-import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/util'
+import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/constants'
 import { IServiceParams, UploaderInputs } from '../../src/types'
 import { createEmptyArgs } from '../test_helpers'
 
diff --git a/test/providers/provider_jenkinsci.test.ts b/test/providers/provider_jenkinsci.test.ts
index 1f8a8c9..f3cf870 100644
--- a/test/providers/provider_jenkinsci.test.ts
+++ b/test/providers/provider_jenkinsci.test.ts
@@ -1,8 +1,8 @@
 import td from 'testdouble'
 import childProcess from 'child_process'
 
-import * as providerJenkinsci from '../../src/ci_providers//provider_jenkinsci'
-import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/util'
+import * as providerJenkinsci from '../../src/ci_providers/provider_jenkinsci'
+import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/constants'
 import { IServiceParams, UploaderInputs } from '../../src/types'
 import { createEmptyArgs } from '../test_helpers'
 
diff --git a/test/providers/provider_local.test.ts b/test/providers/provider_local.test.ts
index 8e41815..7b8e096 100644
--- a/test/providers/provider_local.test.ts
+++ b/test/providers/provider_local.test.ts
@@ -1,8 +1,8 @@
 import td from 'testdouble'
 import childProcess from 'child_process'
 
-import * as providerLocal from '../../src/ci_providers//provider_local'
-import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/util'
+import * as providerLocal from '../../src/ci_providers/provider_local'
+import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/constants'
 import { IServiceParams, UploaderInputs } from '../../src/types'
 import { createEmptyArgs } from '../test_helpers'
 
diff --git a/test/providers/provider_teamcity.test.ts b/test/providers/provider_teamcity.test.ts
index 44c1e49..932ba11 100644
--- a/test/providers/provider_teamcity.test.ts
+++ b/test/providers/provider_teamcity.test.ts
@@ -2,7 +2,7 @@ import td from 'testdouble'
 import childProcess from 'child_process'
 
 import * as providerTeamCity from '../../src/ci_providers/provider_teamcity'
-import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/util'
+import { SPAWNPROCESSBUFFERSIZE } from '../../src/helpers/constants'
 import { IServiceParams, UploaderInputs } from '../../src/types'
 import { createEmptyArgs } from '../test_helpers'