Skip to content

Commit

Permalink
fix itests
Browse files Browse the repository at this point in the history
  • Loading branch information
IbraAoad committed Dec 5, 2024
1 parent ccfa8ce commit fddc71f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
1 change: 0 additions & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def copy_traefik_library_into_tester_charms(ops_test):
libraries = [
"traefik_k8s/v2/ingress.py",
"traefik_k8s/v1/ingress_per_unit.py",
"observability_libs/v1/kubernetes_service_patch.py",
"traefik_k8s/v0/traefik_route.py",
]
for tester in ["forward-auth", "ipa", "ipu", "tcp", "route"]:
Expand Down
12 changes: 1 addition & 11 deletions tests/integration/testers/tcp/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,17 @@
# See LICENSE file for licensing details.
from pathlib import Path

from charms.observability_libs.v1.kubernetes_service_patch import (
KubernetesServicePatch,
ServicePort,
)
from charms.traefik_k8s.v1.ingress_per_unit import IngressPerUnitRequirer
from ops.charm import CharmBase, PebbleReadyEvent
from ops.model import ActiveStatus, Container, WaitingStatus
from ops.pebble import Layer


class TCPRequirerMock(CharmBase):
_tcp_port = 9999 # port is hard-coded in workload.py

def __init__(self, framework):
super().__init__(framework)

self.service_patch = KubernetesServicePatch(
charm=self,
ports=[ServicePort(self._tcp_port, name=f"{self.app.name}")],
)

self.unit.open_port("tcp", 9999)
self.unit.status = ActiveStatus("ready")

# dummy charm: only create the relation AFTER pebble ready has fired.
Expand Down
2 changes: 1 addition & 1 deletion tests/interface/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# to include the new identifier/location.
@pytest.fixture
def interface_tester(interface_tester: InterfaceTester):
with patch("charm.KubernetesServicePatch", lambda **unused: None):
with patch("charm.KubernetesLoadBalancer", lambda **unused: None):
interface_tester.configure(
charm_type=TraefikIngressCharm,
state_template=State(
Expand Down

0 comments on commit fddc71f

Please sign in to comment.