Skip to content

Add pluggable TSS backend support to smoke test infrastructure#1

Open
cnewkirk wants to merge 1 commit into
developfrom
feature/tss-smoke-test-infrastructure
Open

Add pluggable TSS backend support to smoke test infrastructure#1
cnewkirk wants to merge 1 commit into
developfrom
feature/tss-smoke-test-infrastructure

Conversation

@cnewkirk

@cnewkirk cnewkirk commented Mar 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add INTEGRATION strategy to TimeSeriesStrategy enum, enabling smoke tests to run against pluggable TSS backends (Cortex TSS plugin with Prometheus/Thanos)
  • Add ThanosReceiveContainer and ThanosQueryContainer for distributed Thanos backend testing
  • Add PrometheusContainer as a standalone building block (not wired into default INTEGRATION stack)
  • Add TimeSeriesValidationUtils with strategy-agnostic validation methods for resource trees, measurements, metadata, and all aggregation types
  • Add CortexTestUtils.resolveKarFile() shared utility for KAR file resolution
  • Wire OpenNMSStack and OpenNMSContainer for INTEGRATION strategy (cortex.cfg overlay, opennms.properties, features boot)
  • Expand CortexTssPluginIT to 26 test methods covering plugin lifecycle, write/read path, meta tags, metric sanitization, label ordering, resource discovery, two-phase discovery, and data consistency
  • Update CortexTssTimeseriesPluginIT to use shared CortexTestUtils
  • Add smoke-test/README.md with INTEGRATION section, Mermaid architecture diagram, prerequisites, and validation utilities

Companion PR

KAR File Resolution

Tests use CortexTestUtils.resolveKarFile() to find the Cortex TSS plugin KAR:

  • -Dcortex.kar=/path/to/plugin.kar — explicit path (throws if path invalid)
  • -Dorg.opennms.dev.m2=$HOME/.m2/repository — bind-mount Maven repo for Karaf resolution

Test plan

  • Compiles clean with Java 17 and -Dsmoke --projects :smoke-test
  • Full project build clean (./compile.pl -DskipTests install)
  • Assembly builds clean (./assemble.pl -Dopennms.home=/opt/opennms -DskipTests)
  • No unused imports or dead code
  • All test assertions use proper guards and error messages
  • queryThanos() checks HTTP response code and includes error body
  • resolveKarFile() deduplicated into CortexTestUtils with consistent error handling
  • README Mermaid diagram and container table use correct ports
  • Smoke tests pass on CI (Linux/Docker) — cannot run locally on macOS/podman due to pre-existing opennms/deploy-base amd64-only limitation

@cnewkirk

Copy link
Copy Markdown
Owner Author

Related PR: cnewkirk/opennms-cortex-tss-plugin#1 — Cortex TSS plugin changes including label values discovery optimization, multi-backend E2E smoke test harness (45 tests), and comprehensive architecture documentation.

The two PRs are complementary:

  • This PR (OpenNMS repo): smoke test framework changes (INTEGRATION strategy, Thanos/Prometheus containers, CortexTssPluginIT)
  • That PR (plugin repo): the plugin feature, standalone E2E harness, and documentation

@cnewkirk
cnewkirk force-pushed the feature/tss-smoke-test-infrastructure branch 5 times, most recently from f29064f to e971fce Compare March 16, 2026 04:27
@cnewkirk
cnewkirk force-pushed the feature/tss-smoke-test-infrastructure branch from 426319f to 16b0a9a Compare March 29, 2026 01:37
Adds INTEGRATION time series strategy with Prometheus-compatible backend
containers for end-to-end testing of TSS plugins via the Integration API:

- INTEGRATION enum value for TimeSeriesStrategy
- ThanosReceiveContainer (write endpoint) and ThanosQueryContainer (read endpoint)
- PrometheusContainer as standalone building block
- OpenNMSContainer/OpenNMSStack wiring for INTEGRATION strategy with
  Cortex plugin config, meta tags, and features-on-boot
- CortexTestUtils with shared resolveKarFile() for KAR resolution
- TimeSeriesValidationUtils for strategy-agnostic validation
  (resource tree, measurements, metadata)
- Expanded CortexTssPluginIT with comprehensive coverage: write/read path,
  meta tags, metric sanitization, label ordering, resource discovery,
  two-phase discovery, data consistency
- smoke-test README with INTEGRATION section and architecture diagram
@cnewkirk
cnewkirk force-pushed the feature/tss-smoke-test-infrastructure branch from 16b0a9a to 555f52f Compare March 29, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant