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

test: use scenario for unit testing #220

Merged
merged 6 commits into from
Aug 16, 2024
Merged

test: use scenario for unit testing #220

merged 6 commits into from
Aug 16, 2024

Conversation

gruyaume
Copy link
Contributor

@gruyaume gruyaume commented Aug 15, 2024

Description

Here we replace harness with scenario for unit testing. Doing so, I identified an issue with self-signed certificates where the CA certificate expiry was not handled properly in charm code.

Rationale

The scenario framework enforces our current approach with:

  • Arrange (state in)
  • Act (juju event)
  • Assert (state out)

This makes tests easier to read, to write, and to parameterise .

Reference

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that validate the behaviour of the software
  • I validated that new and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have bumped the version of the library

Signed-off-by: guillaume <guillaume.belanger27@gmail.com>
@gruyaume gruyaume requested a review from a team as a code owner August 15, 2024 18:20
Signed-off-by: guillaume <guillaume.belanger27@gmail.com>
Signed-off-by: guillaume <guillaume.belanger27@gmail.com>
@gruyaume gruyaume marked this pull request as draft August 15, 2024 20:45
Signed-off-by: guillaume <guillaume.belanger27@gmail.com>
@gruyaume gruyaume marked this pull request as ready for review August 15, 2024 22:11
gruyaume and others added 2 commits August 16, 2024 06:59
@gruyaume gruyaume merged commit 97ef4f8 into main Aug 16, 2024
12 checks passed
@gruyaume gruyaume deleted the dev-scenario branch August 16, 2024 11:30
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.

2 participants