Skip to content

Commit

Permalink
test: update deprecated label (#96)
Browse files Browse the repository at this point in the history
* test: update deprecated label

* test: remove deprecated agent relation tests

* fix: lint
  • Loading branch information
yanksyoon authored Jan 19, 2024
1 parent 0b19b82 commit d2671cb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
3 changes: 1 addition & 2 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,11 @@ async def jenkins_machine_agents_fixture(
app: Application = await machine_model.deploy(
"jenkins-agent",
channel="latest/edge",
config={"labels": "machine"},
config={"jenkins_agent_labels": "machine"},
application_name=f"jenkins-agent-{app_suffix}",
num_units=num_units,
)
await machine_model.create_offer(f"{app.name}:{state.AGENT_RELATION}", state.AGENT_RELATION)
await machine_model.create_offer(f"{app.name}:slave", state.DEPRECATED_AGENT_RELATION)
await machine_model.wait_for_idle(
apps=[app.name], status="blocked", idle_period=30, timeout=1200, check_freq=5
)
Expand Down
13 changes: 0 additions & 13 deletions tests/integration/test_machine_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""Integration tests for jenkins-k8s-operator charm."""

import jenkinsapi.jenkins
import pytest
from juju.application import Application

import state
Expand Down Expand Up @@ -50,15 +49,3 @@ async def test_jenkins_machine_agent_relation(

# 2. Assert that the agent nodes are deregistered from Jenkins.
assert not any((application.name in key for key in jenkins_client.get_nodes().keys()))


@pytest.mark.usefixtures("machine_deprecated_agent_related_app")
async def test_jenkins_machine_deprecated_agent_relation(
jenkins_machine_agents: Application, jenkins_client: jenkinsapi.jenkins.Jenkins
):
"""
arrange: given a cross controller cross model jenkins machine agent with an offer.
act: when the relation is setup through the offer.
assert: the relation succeeds and the agent is able to run jobs successfully.
"""
assert_job_success(jenkins_client, jenkins_machine_agents.name, "machine")

0 comments on commit d2671cb

Please sign in to comment.