Skip to content

Commit 5269a4a

Browse files
Do not validate the codecov file in marketplace when running the validate ci command (#16144)
1 parent fa7b0a3 commit 5269a4a

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

ddev/changelog.d/16144.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Do not validate the codecov file in marketplace when running the `validate ci` command

ddev/src/ddev/cli/validate/ci.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ def ci(app: Application, sync: bool):
136136
if repo_choice not in valid_repos:
137137
app.abort(f'Unknown repository `{repo_choice}`')
138138

139+
# marketplace does not have a .codecov.yml file
140+
if app.repo.name == 'marketplace':
141+
return
142+
139143
testable_checks = {integration.name for integration in app.repo.integrations.iter_testable('all')}
140144

141145
cached_display_names: defaultdict[str, str] = defaultdict(str)

ddev/tests/cli/validate/test_ci.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# (C) Datadog, Inc. 2023-present
22
# All rights reserved
33
# Licensed under a 3-clause BSD style license (see LICENSE)
4+
import pytest
45
import yaml
56

67

@@ -145,6 +146,26 @@ def test_codecov_missing_flag(ddev, repository, helpers):
145146
assert error in helpers.remove_trailing_spaces(result.output)
146147

147148

149+
# TODO We do not have an off the shelf fixture to generate a marketplace repository
150+
@pytest.mark.parametrize(
151+
'repository_name, repository_flag, expected_exit_code, expected_output',
152+
[
153+
pytest.param('core', '-c', 1, 'Unable to find the Codecov config file', id='integrations-core'),
154+
],
155+
)
156+
def test_codecov_file_missing(
157+
ddev, repository, helpers, config_file, repository_name, repository_flag, expected_exit_code, expected_output
158+
):
159+
config_file.model.repos[repository_name] = str(repository.path)
160+
config_file.save()
161+
162+
(repository.path / '.codecov.yml').unlink()
163+
164+
result = ddev(repository_flag, "validate", "ci")
165+
assert result.exit_code == expected_exit_code, result.output
166+
assert expected_output in helpers.remove_trailing_spaces(result.output)
167+
168+
148169
def test_validate_ci_success(ddev, helpers):
149170
result = ddev('validate', 'ci')
150171
assert result.exit_code == 0, result.output

0 commit comments

Comments
 (0)