Skip to content

Add pluggable TSS backend support to smoke test infrastructure#8401

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

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

Conversation

@cnewkirk
Copy link
Copy Markdown
Contributor

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
  • 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 and architecture diagram

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

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
@marshallmassengill
Copy link
Copy Markdown
Contributor

I'll let others comment on the code (and CI failures) but I suspect we may want to target this at foundation-2025 (maybe 2024 since it seems not breaking?) so that we can leverage it with testing for that version. https://opennms.atlassian.net/browse/NMS-19646 created for this.

Copy link
Copy Markdown
Contributor

@cgorantla cgorantla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think cortex plugin itself is better place to have these tests. We just need to bring up OpenNMS container there (which is already available through docker hub), see https://github.com/OpenNMS/alec for reference.

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.

3 participants