Repository: codecov/uploader (ts)

Issue:
Upload from travis-ci.com fails to detect service
**Describe the bug**
Following the instructions [here](https://docs.codecov.com/docs/codecov-uploader) in my travis-ci.com build, uploading the coverage report fails with an error about "Unable to detect service".

**To Reproduce**
Steps to reproduce the behavior:
1. Visit https://travis-ci.com/github/tagatac/bagoup/builds/234787055
2. Click on the arrow next to line 296.
3. Scroll down to line 337
4. See error "Unable to detect service, please specify manually."

**Expected behavior**
codecov uploads the coverage report without issue.

**Additional context**
Makefile target that generates this error at the commit that triggered the build referenced above: https://github.com/tagatac/bagoup/blob/14d7c0cb2349754a7f777f3abb50f90d43c9d313/Makefile#L36-L44


Pull request:
fix: correct travis ci detection
fixes #284

Patch:
diff --git a/src/ci_providers/provider_travisci.ts b/src/ci_providers/provider_travisci.ts
index a09046c..b56cf18 100644
--- a/src/ci_providers/provider_travisci.ts
+++ b/src/ci_providers/provider_travisci.ts
@@ -1,7 +1,7 @@
 import { IServiceParams, UploaderEnvs, UploaderInputs } from '../types'
 
 export function detect(envs: UploaderEnvs): boolean {
-  return Boolean(envs.CI) && Boolean(envs.TRAVIS) && Boolean(envs.SHIPPABLE)
+  return (Boolean(envs.CI) && Boolean(envs.TRAVIS)) && (Boolean(envs.SHIPPABLE) === false)
 }
 
 function _getBuild(inputs: UploaderInputs): string {
@@ -65,5 +65,5 @@ export function getServiceParams(inputs: UploaderInputs): IServiceParams {
 }
 
 export function getEnvVarNames(): string[] {
-  return ['TRAVIS', 'SHIPPABLE']
+  return ['TRAVIS']
 }


Test patch:
diff --git a/test/providers/provider_travisci.test.ts b/test/providers/provider_travisci.test.ts
index 846f076..e26fdd4 100644
--- a/test/providers/provider_travisci.test.ts
+++ b/test/providers/provider_travisci.test.ts
@@ -9,7 +9,7 @@ describe('TravisCI Params', () => {
   })
 
   describe('detect()', () => {
-    it('does not run without TravisCI env variable', () => {
+    it('does not run with Shipable env variable', () => {
       const inputs: UploaderInputs = {
         args: {
           tag: '',
@@ -28,6 +28,10 @@ describe('TravisCI Params', () => {
 
       inputs.envs.TRAVIS = 'true'
       detected = providerTravisci.detect(inputs.envs)
+      expect(detected).toBeTruthy()
+
+      inputs.envs.SHIPPABLE = 'true'
+      detected = providerTravisci.detect(inputs.envs)
       expect(detected).toBeFalsy()
     })
 
@@ -36,7 +40,6 @@ describe('TravisCI Params', () => {
         args: {},
         envs: {
           CI: 'true',
-          SHIPPABLE: 'true',
           TRAVIS: 'true',
         },
       }
@@ -56,7 +59,6 @@ describe('TravisCI Params', () => {
       envs: {
         CI: 'true',
         TRAVIS: 'true',
-        SHIPPABLE: 'true',
         TRAVIS_JOB_NUMBER: '1',
         TRAVIS_BRANCH: 'main',
         TRAVIS_TAG: 'main',
@@ -90,7 +92,6 @@ describe('TravisCI Params', () => {
       },
       envs: {
         CI: 'true',
-        SHIPPABLE: 'true',
         TRAVIS: 'true',
         TRAVIS_BRANCH: 'branch',
         TRAVIS_COMMIT: 'testingsha',
@@ -127,7 +128,6 @@ describe('TravisCI Params', () => {
       },
       envs: {
         CI: 'true',
-        SHIPPABLE: 'true',
         TRAVIS: 'true',
         TRAVIS_BRANCH: 'branch',
         TRAVIS_COMMIT: 'testingsha',
@@ -168,7 +168,6 @@ describe('TravisCI Params', () => {
       },
       envs: {
         CI: 'true',
-        SHIPPABLE: 'true',
         TRAVIS: 'true',
       },
     }