Repository navigation
Conversation
RunDatabaseBackup::dispatch() comes from the Dispatchable trait. Several test files define an empty Illuminate\Foundation\Bus\Dispatchable shim, so when one of them loads first the static dispatch() is missing and DatabaseBackupsTest fails depending on test order (PHP CI on release/v1.6.69 fails this way). Dispatching through the bus contract behaves the same at runtime and does not depend on the trait.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/v1.6.69 #295 +/- ##
====================================================
Coverage 100.00% 100.00%
- Complexity 7940 8059 +119
====================================================
Files 438 443 +5
Lines 25670 25974 +304
====================================================
+ Hits 25670 25974 +304
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PHP CI on
release/v1.6.69fails inDatabaseBackupsTestwithCall to undefined method Fleetbase\Jobs\RunDatabaseBackup::dispatch()(runs 37580012747, 37578658850).Cause: several test files define an empty
Illuminate\Foundation\Bus\Dispatchableshim (for exampletests/Unit/Jobs/LogApiRequestTest.php). When one of them loads beforeRunDatabaseBackup, the job gets the empty trait and has no staticdispatch(). The failure therefore depends on test order.Fix:
DatabaseBackupController::run()dispatchesnew RunDatabaseBackup(...)through theIlluminate\Contracts\Bus\Dispatchercontract. That is the same at runtime, and the existing test already asserts on the bus fake bound to that contract.This also unblocks #290 (socket auth), which now targets this release branch.
Test plan: verified by CI (PHP CI on this PR).