For a log line like
```
x-amz-id-2: WxwS/N175wqLyRlzCXLpGZGszCEbQA0f63uFgdQN1qfcPr2IAmwE/P7HF2b1NdZLg18pNLF3ecTw5CrItXJid/uLe+fxh3jMBiJ7UlUxidw=
```
The level will be inferred as fatal because it contains `CrIt`, which is incorrect.
To fix this, we need to add a word boundary at the start
Ref: HDX-3439
CLAUDE: made a mistake.
```
❌ Test expects "ALERTING" to match "alert" keyword → "ALERTING" won't match with word boundary because "alert" is a substring, not at a word boundary. Expected should be "info",9,"ALERTING system engaged" not "fatal",21.
```
-> incorrect statement
|
||
|---|---|---|
| .. | ||
| data | ||
| test_helpers | ||
| auto-parse-json.bats | ||
| docker-compose.yaml | ||
| normalize-severity.bats | ||
| README.md | ||
| receiver-config.yaml | ||
| setup_suite.bash | ||
| severity-inference.bats | ||
OpenTelemetry Collector Smoke Tests
This directory contains smoke tests for validating the OpenTelemetry Collector functionality in HyperDX.
Prerequisites
Before running the tests, ensure you have the following tools installed:
- Bats - Bash Automated Testing System
- Docker and Docker Compose
- curl - Command line tool for transferring data
- ClickHouse client -
Command-line client for ClickHouse
- Make sure to run
clickhouse installto install the ClickHouse client after downloading ClickHouse
- Make sure to run
Running the Tests
To run all the tests:
cd smoke-tests/otel-collector
bats *.bats
To run a specific test file:
bats hdx-1453-auto-parse-json.bats
Test Structure
*.bats- Test files written in Batssetup_suite.bash- Contains global setup_suite and teardown_suite functions that run once for the entire test suitedata/- Test data used by the teststest_helpers/- Utility functions for the testsdocker-compose.yaml- Docker Compose configuration for the test environment
The test suite uses Bats' setup_suite and teardown_suite hooks to initialize
the environment only once, regardless of how many test files are run. This
optimizes test execution by:
- Validating the environment once
- Starting Docker containers once at the beginning of the test suite
- Cleaning up containers once at the end of the test suite
Debugging
If you need to debug the tests, you can set the SKIP_CLEANUP environment
variable to prevent the Docker containers from being torn down after the tests
complete:
SKIP_CLEANUP=1 bats *.bats
or
SKIP_CLEANUP=true bats *.bats
With SKIP_CLEANUP enabled, the test containers will remain running after the
tests complete, allowing you to inspect logs, connect to the containers, and
debug issues.
To manually clean up the containers after debugging:
docker compose down