Files
openobserve/tests/api-testing
Neha PandClaude 33608a09b2 test: add max_query_range enforcement tests (#10907)
Add comprehensive pytest tests for max_query_range stream setting that
silently truncates queries exceeding the configured time limit.

- TestLogsMaxQueryRange: 4 tests verifying truncation for logs streams
- TestMetricsMaxQueryRange: 1 test for metrics stream truncation
- TestTracesMaxQueryRange: 1 test for traces stream truncation
- TestMaxQueryRangeNegativeCases: 7 edge case tests (zero value,
negative values, inverted time range, non-existent stream, boundary
conditions)

Tests inject backdated data (3h, 2h, 90min, 45min, 30min, 15min, 5min,
now) and verify that with max_query_range=1h, only data within 1 hour is
returned.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-14 22:16:29 +05:30
..
2026-01-14 16:54:35 +08:00
2025-07-31 14:31:33 +08:00
2026-01-14 16:54:35 +08:00
2026-01-14 16:54:35 +08:00

pytest-openobserve

This is a repo to test openobserve API endpoints.

Introduction:

The tests are running using pytest against alpha1 for now. Idea is to parametrize it for the other endpoints like production as well.

Getting Started

  • We use rye to manage the python version and environment - https://github.com/mitsuhiko/rye
  • Once installed, simply run the following steps:
    • rye sync
    • rye run pytest

TODOS:

  • Parametrize tests to run against different environments
  • Run the tests as cron-job every few hours or daily etc. for different environments
  • Send slack-notification ( use github-actions ) in case something fails on alpha1 or production endpoints.