Skip to content

Functional CI validation

The default, sidecar, and SSO package CI overlays enable both Cypress and script Helm tests. The image supplied through upstream.image is used by the deployed Query, Query Frontend, Store Gateway, and Compactor. The umbrella also supplies the Prometheus Thanos sidecar image.

The browser suite checks the UI, successful PromQL evaluation, live up samples, and healthy discovered sidecars. API checks use bbtests.cypress.envs.cypress_thanos_api_url so they still run when the external route is protected by SSO. Query responses must succeed without partial-response warnings. The SSO suite separately checks the external redirect and authenticated query path.

The script first checks that the metrics pipeline uploaded a complete TSDB block with valid metadata and nonempty index and chunk objects. The CI overlays also configure the fixture volume/mount, storage deadline, and internal script Query URL. These CI-specific settings live in the three tests/*.yaml overlays rather than the chart defaults. They set THANOS_STORAGE_E2E=true, which renders the fixture ConfigMap and adds these checks:

  1. Query healthy up samples at a timestamp inside the shipped live block, restricted to Store Gateway. This exercises data actually written by the deployed Prometheus sidecar.
  2. Upload six small historical fixture blocks with fresh IDs and a unique bb_ci_run external label. Publish metadata only after index/chunk upload.
  3. Discover healthy Store Gateway addresses using /api/v1/stores and restrict historical range queries to those exact addresses using storeMatch[]. Every expected historical sample must equal the fixture value. Prometheus sidecars cannot satisfy this query.
  4. Wait for a higher-level block from this run’s sources, verify its sample count and object completeness, and repeat the historical query.

The compaction check requires real output; an available or non-halted Compactor alone is insufficient. Each run has fresh identifiers so an old compacted block cannot satisfy a new test. The script uses a shared bounded deadline and fails on missing data, errors, warnings, or timeout.

Only enable fixture writes against disposable CI storage. Tests leave synthetic blocks in the bucket until the CI dependency stack is destroyed. CI overrides shorten the compactor loop and Store Gateway synchronization interval and disable downsampling of the old fixture data; production chart defaults are unchanged. See fixture generation.

Run the offline failure-path checks from the repository root:

PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s tests/unit -v
node --check chart/tests/cypress/e2e/01-thanos-healthspec.cy.js
helm lint chart
helm template thanos chart --set bbtests.enabled=true >/dev/null

Offline checks and native local testing do not replace the deployed package CI lanes, where Garage, Istio, Flux, and the image under test are exercised together.