Skip to content

e2e: monitoring OIDC has no Chainsaw coverage (port the removed BATS pair) #4051

Description

@mattia-eleuteri

hack/e2e-chainsaw/ has no monitoring OIDC coverage, in either shape.

The two BATS suites that carried it, hack/e2e-apps/monitoring-oidc-system.bats and
hack/e2e-apps/monitoring-oidc-customconfig.bats, were executed by nothing and are removed in
#3520, which takes the decision #3638 and #3786 asked for. This issue keeps the other half of that
decision on the board: the port is still wanted, as an ordinary feature request rather than as an
executable file nothing runs.

What the removed pair asserted on a live cluster, and what a port would need to reproduce:

  • System mode (monitoring-oidc-system.bats): that spec.oidc.* is admitted on the Monitoring
    CR and accepted by cozystack-api; that the HelmRelease renders the OIDC templates; and that the
    resulting KeycloakClient, audience KeycloakClientScope, persistent client-secret Secret,
    Grafana CR and users-reconcile Job carry the expected shape. Authorization is asserted through the
    users-Job reconciling spec.oidc.users into Grafana orgs, not through chart-owned
    KeycloakRealmGroups or role_attribute_path (see the design note in docs/oidc-grafana.md).
  • Custom config mode (monitoring-oidc-customconfig.bats): the BYO issuer path, including the
    negative assertions that no chart-owned Keycloak object is created.

Neither drove a browser login through Keycloak; that was deferred, same posture as the tenant
kube-apiserver suites, and a port need not take it on.

Two things to know before writing it:

  • The removed suites skipped when the EDP Keycloak CRDs were absent, and the probe they used tested
    the exit code of kubectl api-resources, which is 0 for an absent API group. Probe the output
    (--output=name piped to an anchored grep), and keep a failed discovery call distinct from an
    empty list: a test has no reason to conflate them.
  • The skip those suites called does not exist in hack/cozytest.sh (cozytest.sh implements no skip: a skipping test hard-fails at exit 127 #3827). Chainsaw has its own
    skip semantics, so this only matters if the port lands in BATS after all.

Existing coverage nearby: packages/system/monitoring/tests/oidc_test.yaml covers the render side as
Helm unit tests, so a Chainsaw port is about admission and reconciliation on a real cluster, not
about template output. #3785 tracks a separate gap in the same area (mode swap from inline to
secretRef).

Activity

  1. myasnikovdaniil commented on Sep 3, 2026

    @myasnikovdaniil
    Contributor

    Hi! Already doing it here #4019, not port but deletion, because assertions in those test give almost nothing new comparing to correct rendering tests, it is part of my larger list of prs for CI optimization (#4020, #4005, #4008, #4021, #4018, #4022, #4011 and finally #4019 as least important one)

  2. added
    kind/cleanupCategorizes issue or PR as related to cleanup of code, process, or technical debt
    triage/acceptedIndicates an issue is ready to be actively worked on
    area/testingIssues or PRs related to testing (e2e, bats, unit tests)
    and removed
    triage/needs-triageIndicates an issue needs triage by a maintainer
    on Sep 3, 2026
  3. added a commit that references this issue on Oct 5, 2026
    858ca4d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area/monitoringIssues or PRs related to the monitoring stack (vlogs, vmstack, grafana, workloadmonitor)area/testingIssues or PRs related to testing (e2e, bats, unit tests)kind/cleanupCategorizes issue or PR as related to cleanup of code, process, or technical debttriage/acceptedIndicates an issue is ready to be actively worked on

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions