|
1 | 1 | # (C) Datadog, Inc. 2023-present |
2 | 2 | # All rights reserved |
3 | 3 | # Licensed under a 3-clause BSD style license (see LICENSE) |
| 4 | +import pytest |
4 | 5 | import yaml |
5 | 6 |
|
6 | 7 |
|
@@ -145,6 +146,26 @@ def test_codecov_missing_flag(ddev, repository, helpers): |
145 | 146 | assert error in helpers.remove_trailing_spaces(result.output) |
146 | 147 |
|
147 | 148 |
|
| 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 | + |
148 | 169 | def test_validate_ci_success(ddev, helpers): |
149 | 170 | result = ddev('validate', 'ci') |
150 | 171 | assert result.exit_code == 0, result.output |
|
0 commit comments