Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: mock and test provider calls from lifecycle.py #3928

Merged
merged 3 commits into from Oct 3, 2022

Conversation

mr-cal
Copy link
Collaborator

@mr-cal mr-cal commented Sep 30, 2022

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run make lint?
  • Have you successfully run pytest tests/unit?

Overview

Mock and test calls made to craft-providers from lifecycle.py. This code was not being tested.

I also simplified the verbosity call to match charmcraft and rockcraft.

Details

3 weeks ago, I added some unit tests for run_in_provider(). Today, I am extending those tests further.

The test fixtures are copies of the implementations in charmcraft and rockcraft.

I'll be using these tests next week when I pull code out of the providers directory.

Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
@mr-cal mr-cal enabled auto-merge (squash) September 30, 2022 18:26
@mr-cal mr-cal enabled auto-merge (squash) September 30, 2022 18:26
@codecov-commenter
Copy link

codecov-commenter commented Sep 30, 2022

Codecov Report

Merging #3928 (9aa97dc) into main (4e23e8f) will increase coverage by 0.10%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #3928      +/-   ##
==========================================
+ Coverage   89.77%   89.88%   +0.10%     
==========================================
  Files          61       61              
  Lines        4177     4170       -7     
==========================================
- Hits         3750     3748       -2     
+ Misses        427      422       -5     
Impacted Files Coverage Δ
snapcraft/parts/lifecycle.py 88.30% <100.00%> (+5.16%) ⬆️
snapcraft/providers/_logs.py 35.00% <0.00%> (-45.00%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mr-cal mr-cal merged commit f0173be into canonical:main Oct 3, 2022
@mr-cal mr-cal deleted the lifecycle-tests branch October 3, 2022 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants