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

Add upgrade charm on refresh_events to COSAgent #151

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix lint
gabrielcocenza committed Nov 25, 2024
commit 500a65d5c17ac6af2ed91544c35d0cd5fdeacff9
8 changes: 5 additions & 3 deletions tests/scenario/test_machine_charm/test_cos_agent_e2e.py
Original file line number Diff line number Diff line change
@@ -53,9 +53,11 @@ def placeholder_cfg_path(tmp_path):

@pytest.fixture(autouse=True)
def patch_all(placeholder_cfg_path):
with patch("subprocess.run", MagicMock()), patch(
"grafana_agent.CONFIG_PATH", placeholder_cfg_path
), patch("socket.getfqdn", return_value="localhost"):
with (
patch("subprocess.run", MagicMock()),
patch("grafana_agent.CONFIG_PATH", placeholder_cfg_path),
patch("socket.getfqdn", return_value="localhost"),
):
yield


8 changes: 5 additions & 3 deletions tests/scenario/test_machine_charm/test_scrape_configs.py
Original file line number Diff line number Diff line change
@@ -65,9 +65,11 @@ def mock_write(_, path, text):

my_uuid = str(uuid.uuid4())

with patch("charms.operator_libs_linux.v2.snap.SnapCache"), patch(
"charm.GrafanaAgentMachineCharm.write_file", new=mock_write
), patch("charm.GrafanaAgentMachineCharm.is_ready", return_value=True):
with (
patch("charms.operator_libs_linux.v2.snap.SnapCache"),
patch("charm.GrafanaAgentMachineCharm.write_file", new=mock_write),
patch("charm.GrafanaAgentMachineCharm.is_ready", return_value=True),
):
state = State(
relations=[cos_relation, loki_relation, PeerRelation("peers")],
model=Model(name="my-model", uuid=my_uuid),
5 changes: 3 additions & 2 deletions tests/scenario/test_start_statuses.py
Original file line number Diff line number Diff line change
@@ -31,8 +31,9 @@ def _subp_run_mock(*a, **kw):

@pytest.fixture(autouse=True)
def patch_all(placeholder_cfg_path):
with patch("subprocess.run", _subp_run_mock), patch(
"grafana_agent.CONFIG_PATH", placeholder_cfg_path
with (
patch("subprocess.run", _subp_run_mock),
patch("grafana_agent.CONFIG_PATH", placeholder_cfg_path),
):
yield