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

Means to test charm upgrade #879

Closed
sed-i opened this issue Jan 9, 2023 · 4 comments
Closed

Means to test charm upgrade #879

sed-i opened this issue Jan 9, 2023 · 4 comments
Assignees
Labels
blocked Blocked on another team/project/item

Comments

@sed-i
Copy link
Contributor

sed-i commented Jan 9, 2023

upgrade-charm is different from regular charm startup:

  1. Not the same events fire
  2. use_juju_for_storage=True/False may have unexpected results for upgrade

It would be handy if it was possible to cover some aspects of upgrading using unit tests.

Related:

@benhoyt
Copy link
Collaborator

benhoyt commented Jan 10, 2023

I'm trying to understand this better: why is it not enough to exercise the upgrade-charm hook using self.harness.charm.on.upgrade_charm.emit() in the test, and assert that it did the right thing? Is it because we care about the sequence of events, rather than just the one? Is that appropriate for a unit test?

I've scheduled a video chat with you tomorrow to get a bit more context and understanding here.

@benhoyt
Copy link
Collaborator

benhoyt commented Sep 29, 2023

@sed-i I can't for the life of me remember whether our video chat about this happened, but either way, I don't have any notes. :-) Do you remember? And if not, is manually triggering the event per my comment above enough?

@benhoyt benhoyt self-assigned this Sep 29, 2023
@benhoyt benhoyt added the blocked Blocked on another team/project/item label Sep 29, 2023
@sed-i
Copy link
Contributor Author

sed-i commented Sep 29, 2023

I think we did. Afaict,

  • Yes the sequence is important, but the sequence won't matter if we don't have charm reinit.
  • On upgrade, non persistent storage needs to be wiped by harness.
  • On upgrade, realtion data is already in place and the charm needs to be able to start up without relation events.

That being said, perhaps ops-scenario is a better avenue.

@benhoyt
Copy link
Collaborator

benhoyt commented Oct 1, 2023

Yeah, let's punt on this for now and spend our energy pursuing ops-scenario and firming up our "testing story" (we have both of those as items on the 24.04 roadmap).

@benhoyt benhoyt closed this as not planned Won't fix, can't repro, duplicate, stale Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked on another team/project/item
Projects
None yet
Development

No branches or pull requests

2 participants