Aligned behavior using build
Please check if the PR fulfills these requirements
- [ ] The commit message follows our guidelines
- [ ] Tests for the changes have been added (for bug fixes/features)
- [ ] Docs have been added/updated (for bug fixes/features)
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...) Bug fix
What is the current behavior? (You can also link to an open issue here)
Bug: Misaligned behavior with build The package has changed from using a boot method with passed modules to adding modules and having a build stage before boot.
Not all the tests were aligned by the time the new approach was added. I added some tests to check the current behavior and found a couple of misalignments.
Bug: Calling $package->build() several times change package status to STATUS_FAILED
What is the new behavior (if this is a feature change)?
- It is not possible to connect packages if the caller is built. Tests were added.
- It is possible to call
$package->build()and the status of the package will not change.
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Current consumers using the following code will have to adapt it.
$package1 = Package::new()->addModule($serviceModule1)->build();
$package2 = Package::new()->addModule($serviceModule2)->build();
$package2->connect($package1);
Other information: We need to find a better way to get Container Status as mentioned in here
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.88%. Comparing base (
7538809) to head (4f1825c). Report is 19 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #45 +/- ##
============================================
+ Coverage 98.87% 98.88% +0.01%
- Complexity 192 196 +4
============================================
Files 9 9
Lines 531 538 +7
============================================
+ Hits 525 532 +7
Misses 6 6
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 98.88% <100.00%> (+0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
No need for this anymore.
The combination of #49 #51 and #52 addresses all the issues raised in this PR.
Thank you everyone involved.