diff --git a/ddev/changelog.d/24099.fixed b/ddev/changelog.d/24099.fixed new file mode 100644 index 0000000000000..890e7774162f0 --- /dev/null +++ b/ddev/changelog.d/24099.fixed @@ -0,0 +1 @@ +Skip code coverage gate validation for extras repos, which do not enforce a required per-integration coverage threshold. diff --git a/ddev/src/ddev/cli/validate/ci.py b/ddev/src/ddev/cli/validate/ci.py index ee50af3cc6800..06d9cf5756b80 100644 --- a/ddev/src/ddev/cli/validate/ci.py +++ b/ddev/src/ddev/cli/validate/ci.py @@ -42,6 +42,7 @@ def ci(app: Application, sync: bool): is_core = app.repo.name == 'core' is_marketplace = app.repo.name == 'marketplace' + is_extras = app.repo.name == 'extras' # For non-core repos, extract the workflow reference from existing workflow files # This allows using either @master or @ @@ -229,7 +230,7 @@ def ci(app: Application, sync: bool): if repo_choice not in valid_repos: app.abort(f'Unknown repository `{repo_choice}`') - if is_marketplace: + if is_marketplace or is_extras: validation_tracker.success() validation_tracker.display() return diff --git a/ddev/tests/cli/validate/test_ci.py b/ddev/tests/cli/validate/test_ci.py index c033eb81e1307..879d8d9a9a0d2 100644 --- a/ddev/tests/cli/validate/test_ci.py +++ b/ddev/tests/cli/validate/test_ci.py @@ -143,6 +143,23 @@ def test_code_coverage_file_missing(ddev, repository, helpers): assert "Unable to find the code coverage config file" in helpers.remove_trailing_spaces(result.output) +def test_code_coverage_skipped_for_extras(ddev, repository, helpers, config_file): + config_file.model.repos['extras'] = str(repository.path) + config_file.model.repo = 'extras' + config_file.save() + + # Remove the coverage file entirely — extras should not care + coverage_file = repository.path / 'code-coverage.datadog.yml' + if coverage_file.exists(): + coverage_file.unlink() + + result = ddev('validate', 'ci', '--sync') + assert result.exit_code == 0, result.output + + result = ddev('validate', 'ci') + assert result.exit_code == 0, result.output + + @pytest.mark.parametrize( 'repo_name', [