Skip reports coverage when no tests are available#345
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (22)
📝 WalkthroughSummary by CodeRabbitRelease Notes
WalkthroughThe ChangesConditional Coverage Report Generation
Sequence DiagramsequenceDiagram
participant ReportsCommand
participant ProjectCapabilitiesResolver
participant ProcessQueue
participant Logger
ReportsCommand->>ProjectCapabilitiesResolver: resolve()
ProjectCapabilitiesResolver-->>ReportsCommand: ProjectCapabilities
ReportsCommand->>ReportsCommand: evaluate canRunTests()
alt Tests Available
ReportsCommand->>ProcessQueue: build & queue tests ("Generating Coverage Report")
else No Tests
ReportsCommand->>Logger: warn "Skipping coverage — no runnable tests"
end
ReportsCommand->>ProcessQueue: queue docs (detached)
ReportsCommand->>ProcessQueue: queue metrics
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ed5eb7c24
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
🚀 Preview is available for this pull request. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5862564175
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| public function canRunTests(): bool | ||
| { | ||
| return $this->hasTestsPath || $this->hasPhpSourceFiles; | ||
| return $this->hasPhpSourceFiles; |
There was a problem hiding this comment.
Restore tests-path fallback in canRunTests
canRunTests() now returns only hasPhpSourceFiles, but TestsCommand::execute() still uses this flag to decide whether to run PHPUnit at all. That means repositories with a valid tests directory but no Composer-autoloaded source (for example, tests that exercise generated assets, external integrations, or temporarily empty src/) are now reported as success without executing tests, which can hide real failures in CI. Keep hasTestsPath as a runtime gate for running PHPUnit and scope the new source-file check to coverage/report decisions instead.
Useful? React with 👍 / 👎.
Summary
standards:reportsto resolve project capabilities before running coverage.Testing
dev-toolspre-commit in this environment because./bin/dev-tools tests --coverage=.dev-tools/coveragereturns process failure code while tests reportassertions: 2148,errors: 0,failures: 0,risky: 0.Changelog
Closes #344