query_builder_test.go
query_builder_test.go - Overview
-
Overview This file contains unit tests for the query builder, verifying the correctness of generated SQL queries for various scenarios, including different filter combinations, grouping, temporality, and aggregation types.
-
Detailed Documentation
TestPrepareTimeseriesFilterQuery(t *testing.T)
- Purpose: Tests the
PrepareTimeseriesFilterQuery
function, verifying the generated time series filter sub-query. - Parameters:
t
: *testing.T - Testing object for running the test case.
- Returns:
- None (test function)
TestPrepareMetricQueryCumulativeRate(t *testing.T)
- Purpose: Tests the generated query for cumulative metrics with time aggregation set to rate and space aggregation set to sum.
- Parameters:
t
: *testing.T - Testing object for running the test case.
- Returns:
- None (test function)
TestPrepareMetricQueryDeltaRate(t *testing.T)
- Purpose: Tests the generated query for delta metrics with time aggregation set to rate and space aggregation set to sum.
- Parameters:
t
: *testing.T - Testing object for running the test case.
- Returns:
- None (test function)
TestPrepreMetricQueryCumulativeQuantile(t *testing.T)
- Purpose: Tests the generated query for cumulative metrics with a quantile space aggregation (e.g., percentile 99).
- Parameters:
t
: *testing.T - Testing object for running the test case.
- Returns:
- None (test function)
TestPrepreMetricQueryDeltaQuantile(t *testing.T)
- Purpose: Tests the generated query for delta metrics with a quantile space aggregation (e.g., percentile 99).
- Parameters:
t
: *testing.T - Testing object for running the test case.
- Returns:
- None (test function)
TestPrepareMetricQueryGauge(t *testing.T)
- Purpose: Tests the generated query for gauge metrics with various aggregation settings.
- Parameters:
t
: *testing.T - Testing object for running the test case.
- Returns:
- None (test function)
TestPrepareMetricQueryValueTypePanelWithGroupBY(t *testing.T)
- **Purpose**: Tests the generated query for value type panel with grouping.
- **Parameters**:
- `t`: *testing.T - Testing object for running the test case.
- **Returns**:
- None (test function) - Purpose: Tests the
-
Code Examples
None
-
Clarity and Accuracy
All documented functions are test functions and their purposes are described clearly.
-
Markdown & MDX Perfection
The documentation uses proper markdown syntax for headings, lists, and code blocks.
-
Edge Cases To Avoid Breaking MDX
- No unescaped special characters.
- No broken links or images.
- No raw HTML tags.
- No HTML comments.
- No tables.
- Lists are properly indented.
- Code blocks and headings are properly closed.
-
Getting Started Relevance Include in Getting Started: NO