Skip to content

Commit

Permalink
fix scenario in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldmitry committed Sep 3, 2024
1 parent 04719f6 commit e7c6b04
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 4 additions & 3 deletions lib/charms/observability_libs/v1/cert_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def __init__(
peer_relation_name: str = "peers",
cert_subject: Optional[str] = None,
sans: Optional[List[str]] = None,
refresh_events: List[BoundEvent] = [],
refresh_events: Optional[List[BoundEvent]] = None,
):
"""CertHandler is used to wrap TLS Certificates management operations for charms.
Expand Down Expand Up @@ -360,8 +360,9 @@ def __init__(
self._on_upgrade_charm,
)

for ev in refresh_events:
self.framework.observe(ev, self._on_refresh_event)
if refresh_events:
for ev in refresh_events:
self.framework.observe(ev, self._on_refresh_event)

def _on_refresh_event(self, _):
"""Replace the latest current CSR with a new one if there are any CSR changes.
Expand Down
12 changes: 7 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ passenv =
HTTP_PROXY
HTTPS_PROXY
NO_PROXY
allowlist_externals = charmcraft
commands =
# update all charm libs
charmcraft fetch-lib charms.tls_certificates_interface.v3.tls_certificates
charmcraft fetch-lib charms.tls_certificates_interface.v2.tls_certificates

[testenv:fmt]
description = Apply coding style standards to code
Expand Down Expand Up @@ -96,10 +101,7 @@ commands =
pytest -v --tb native --log-cli-level=INFO -s {posargs} {toxinidir}/tests/integration

[testenv:scenario]
description = Scenario tests (CI satisfaction placeholder)

[testenv:scenario-manual]
description = Scenario tests (manual only: GH runner does not like charmcraft fetch-lib)
description = Scenario tests
deps =
pytest
ops-scenario
Expand All @@ -110,6 +112,6 @@ allowlist_externals =
charmcraft
rm
commands =
charmcraft fetch-lib charms.tls_certificates_interface.v2.tls_certificates
{[testenv]commands}
pytest -v --tb native {[vars]tst_path}/scenario --log-cli-level=INFO -s {posargs}
rm -rf ./lib/charms/tls_certificates_interface

0 comments on commit e7c6b04

Please sign in to comment.