Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Fix CI (#57)
Browse files Browse the repository at this point in the history
* fix lint

* pin scenario
  • Loading branch information
michaeldmitry authored Sep 13, 2024
1 parent 4f267dc commit 400535d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from ops.charm import CharmBase
from ops.main import main
from ops.model import ActiveStatus, BlockedStatus, Relation, Unit

from types_ import TraefikConfig, UnitConfig

logger = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion tests/scenario/test_route_interface.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import pytest
import yaml
from charm import TraefikRouteK8SCharm
from scenario import Context, Relation, State

from charm import TraefikRouteK8SCharm


@pytest.fixture
def ctx():
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
import json

import pytest as pytest
from charm import TraefikRouteK8SCharm
from ops import framework, storage
from ops.testing import Harness

from charm import TraefikRouteK8SCharm

MODEL_NAME = "model"
REMOTE_APP_NAME = "remote" # the app requesting ingress
REMOTE_UNIT_NAME = f"{REMOTE_APP_NAME}/0" # the unit requesting ingress
Expand Down
9 changes: 2 additions & 7 deletions tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@

import pytest
import yaml
from charm import TraefikRouteK8SCharm
from charms.harness_extensions.v0.capture_events import capture
from charms.traefik_k8s.v1.ingress_per_unit import IngressDataReadyEvent
from ops.model import ActiveStatus, BlockedStatus
from ops.testing import Harness

from tests.unit.conftest import (
REMOTE_UNIT_NAME,
SAMPLE_INGRESS_DATA,
mock_config,
mock_happy_path,
)
from charm import TraefikRouteK8SCharm
from tests.unit.conftest import REMOTE_UNIT_NAME, SAMPLE_INGRESS_DATA, mock_config, mock_happy_path

EXPECTED_TRAEFIK_CONFIG = {
"http": {
Expand Down
8 changes: 5 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ description = Apply coding style standards to code
deps =
black
ruff
isort
commands =
ruff --fix {[vars]all_path}
isort {[vars]all_path}
black {[vars]all_path}
ruff check {[vars]all_path} --fix

[testenv:lint]
description = Check code against coding style standards
Expand All @@ -42,7 +44,7 @@ commands =
codespell {[vars]lib_path}
codespell . --skip .git --skip .tox --skip build --skip lib --skip venv* \
--skip .mypy_cache --skip icon.svg
ruff {[vars]all_path}
ruff check {[vars]all_path}
black --check --diff {[vars]all_path}

[testenv:static-{charm,lib,unit,integration}]
Expand Down Expand Up @@ -78,7 +80,7 @@ description = Run integration tests
deps =
pytest
jsonschema
ops-scenario>=5.0
ops-scenario>=5.0,<7.0.0
-r{toxinidir}/requirements.txt
commands =
pytest -v --tb native --log-cli-level=INFO -s {[vars]tst_path}scenario {posargs}
Expand Down

0 comments on commit 400535d

Please sign in to comment.