Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 6 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ set quiet # Recipes are silent by default
set export # Just variables are exported to the environment

terraform := `which terraform || which tofu || echo ""` # require 'terraform' or 'opentofu'
uv_flags := "--frozen --isolated"

[private]
default:
just --list

# Update uv.lock with the latest deps
lock:
uv lock --upgrade --no-cache

# Lint everything
[group("Lint")]
lint: lint-workflows lint-terraform lint-terraform-docs
Expand Down Expand Up @@ -53,4 +58,4 @@ validate-terraform:
# Run integration tests
[working-directory("./tests/integration")]
integration *args='':
uv run pytest -vv --capture=no --exitfirst "${args}"
uv run ${uv_flags} pytest -vv --capture=no --exitfirst "${args}"
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ version = "0.0.0"
dependencies = [
"jubilant",
"pytest",
"jinja2",
]
14 changes: 14 additions & 0 deletions terraform/cos-lite/integrations.tf
Original file line number Diff line number Diff line change
Expand Up @@ -411,3 +411,17 @@ resource "juju_integration" "external_grafana_ca_cert" {
endpoint = module.grafana.endpoints.receive_ca_cert
}
}

resource "juju_integration" "external_prom_ca_cert" {
count = local.tls_termination ? 1 : 0
model_uuid = var.model_uuid

application {
offer_url = var.external_ca_cert_offer_url
}

application {
name = module.prometheus.app_name
endpoint = module.prometheus.endpoints.receive_ca_cert
}
}
14 changes: 14 additions & 0 deletions terraform/cos/integrations.tf
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,20 @@ resource "juju_integration" "external_grafana_ca_cert" {
}
}

resource "juju_integration" "external_otelcol_ca_cert" {
count = local.tls_termination ? 1 : 0
model_uuid = var.model_uuid

application {
offer_url = var.external_ca_cert_offer_url
}

application {
name = module.opentelemetry_collector.app_name
endpoint = module.opentelemetry_collector.endpoints.receive_ca_cert
}
}

# -------------- # Telemetry correlations ---------------------

resource "juju_integration" "traces_and_logs_correlation" {
Expand Down
36 changes: 17 additions & 19 deletions tests/integration/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@
import jubilant


def refresh_o11y_apps(juju: jubilant.Juju, channel: str, base: Optional[str] = None):
"""Temporary workaround for the issue:

FIXME: https://github.com/juju/terraform-provider-juju/issues/967
"""
for app in juju.status().apps:
if app in {"traefik", "ca"}:
continue
juju.refresh(app, channel=channel, base=base)


class TfDirManager:
def __init__(self, base_tmpdir):
self.base: str = str(base_tmpdir)
Expand Down Expand Up @@ -53,21 +42,30 @@ def destroy(self, **kwargs):
subprocess.run(shlex.split(cmd_str), check=True)


def refresh_o11y_apps(juju: jubilant.Juju, channel: str, base: Optional[str] = None):
"""Temporary workaround for the issue:

FIXME: https://github.com/juju/terraform-provider-juju/issues/967
"""
for app in juju.status().apps:
if app in {"traefik", "ca"}:
continue
if "s3-integrator" in app:
continue
juju.refresh(app, channel=channel, base=base)


def wait_for_active_idle_without_error(
jujus: List[jubilant.Juju], timeout: int = 60 * 30
jujus: List[jubilant.Juju], timeout: int = 60 * 45
):
for juju in jujus:
print(f"\nwaiting for the model ({juju.model}) to settle ...\n")
juju.wait(jubilant.all_active, delay=5, timeout=timeout)
print("\nwaiting for no errors ...\n")
juju.wait(
jubilant.all_active, delay=5, timeout=60 * 5, error=jubilant.any_error
)
juju.wait(jubilant.all_active, delay=10, timeout=timeout)
print("\nwaiting for agents idle ...\n")
juju.wait(
jubilant.all_agents_idle,
delay=5,
timeout=60 * 10,
delay=10,
timeout=timeout,
error=jubilant.any_error,
)

Expand Down
Loading
Loading