Skip to content

Commit 71fee0b

Browse files
fix: Find subdirectory commands and use harness id over drone variable conflict
1 parent e2d8835 commit 71fee0b

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

codecov_cli/helpers/ci_adapters/harness.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# The DRONE variables overlap with the Drone CI Adapter as Harness CI is built on top
99
class HarnessAdapter(CIAdapterBase):
1010
def detect(self) -> bool:
11-
return os.getenv("DRONE") == "true"
11+
return bool(os.getenv("HARNESS_BUILD_ID"))
1212

1313
def _get_branch(self):
1414
return os.getenv("DRONE_COMMIT_BRANCH")

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ Homepage = "https://about.codecov.io"
4747
requires = ["setuptools"]
4848
build-backend = "setuptools.build_meta"
4949

50-
[tool.setuptools]
51-
packages = ["codecov_cli"]
50+
[tool.setuptools.packages.find]
51+
include = ["codecov_cli*"]
5252

5353
[tool.pytest.ini_options]
5454
env = ["CODECOV_ENV=test"]

tests/ci_adapters/test_harnessci.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99

1010
class HarnessEnvEnum(str, Enum):
11+
HARNESS_BUILD_ID = "HARNESS_BUILD_ID"
1112
CI_BUILD_LINK = "CI_BUILD_LINK"
1213
CI_BUILD_NUMBER = "CI_BUILD_NUMBER"
1314
CI_REPO = "CI_REPO"
@@ -21,7 +22,7 @@ class TestHarnessCI(object):
2122
"env_dict,expected",
2223
[
2324
({}, False),
24-
({HarnessEnvEnum.DRONE: "true"}, True),
25+
({HarnessEnvEnum.HARNESS_BUILD_ID: "123"}, True),
2526
],
2627
)
2728
def test_detect(self, env_dict, expected, mocker):

0 commit comments

Comments
 (0)