refactor: use jubilant for main integration tests#1507
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 16/edge #1507 +/- ##
========================================
Coverage 70.43% 70.43%
========================================
Files 15 15
Lines 4282 4282
Branches 694 694
========================================
Hits 3016 3016
Misses 1057 1057
Partials 209 209 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5a2b318 to
8ee09c4
Compare
c764515 to
cce8959
Compare
taurus-forever
left a comment
There was a problem hiding this comment.
Wow, this is massive, but promising.
LGTM from my side, but some questions first.
The decision here is on @marceloneppel
|
Also, I have noticed this It looks like we are restoring backup having two units P.S. I do not recall such error in non-Jubilant tests |
|
I suspect the issue @taurus-forever commented about ( def block_until(self, *conditions, timeout=None, wait_period=0.5):
self._juju.wait(
lambda status: all(conditions),
...
)
This would cause If that's the case, the fix would be to actually call each condition: lambda status: all(c() for c in conditions), |
|
@taurus-forever @marceloneppel Thanks Alex for spotting that, and special thanks to Marcello for finding the root cause, which I also think is the issue. I'll fix that 👍 |
c3cf05b to
1b927b2
Compare
fb579ea to
a51998f
Compare
|
Sorry for making the reviews stale, I just had to rebase and sign the commits, and did some final, small tidy ups in this commit: 4193ae9 I'd also like to thank all the reviewers who provided valuable input. No need to mention that the decision to merge this or not is completely on the repo's maintainers, specially @marceloneppel. I have plans to make the migration full and remove |
marceloneppel
left a comment
There was a problem hiding this comment.
Thanks for the work on this, @imanenami! I've re-reviewed after the rebase, and the changes look good. Approving. Looking forward to the follow-up PR to go fully Jubilant-native, like the Kafka one! If the branch gets auto-deleted after the merge, we can restore it.
taurus-forever
left a comment
There was a problem hiding this comment.
Let's give it a try as 1) it works 2) build more experience and confidence in Jubilant 3) can help us merge PG14+PG16 tests.
We are open for AI tests rewrite to native Jubilant. @tonyandrewmeyer can you help us make it success story?
Happy to help. I'll take a closer look tomorrow. |
ae49d3b
taurus-forever
left a comment
There was a problem hiding this comment.
LGTM. Let's give it a try! Thank you Imam!
Issue
Migration of tests to
jubilant. All test files in thetests/integrationroot folder are migrated. HA & new_relations tests are skipped for now, to see how comfortable we are with this approach...Solution
Experimented with an Adapter-based approach. Quick and easy. Each test file took 5-10 min. to migrate once the adapters module was mature.
Findings:
model.block_untilmethod ofpython-libjujuis hard to adapt, the current implementation tries to leveragejubilant.Juju.wait, but comes with a performance penalty.Checklist