Skip to content

Add extensive tests for CLI, parser, query, server, and Badger storage behavior#41

Draft
mchurichi wants to merge 1 commit intomainfrom
codex/increase-code-coverage-to-90%
Draft

Add extensive tests for CLI, parser, query, server, and Badger storage behavior#41
mchurichi wants to merge 1 commit intomainfrom
codex/increase-code-coverage-to-90%

Conversation

@mchurichi
Copy link
Owner

Motivation

  • Increase automated test coverage across the command-line layer, parsers, query logic, HTTP/WebSocket server, and Badger storage to catch regressions and clarify expected behavior.
  • Verify edge cases for parsing (JSON/logfmt), Lucene-like query parsing and duration/time formats, and operational flows such as server start/shutdown, collect mode, and DB maintenance.

Description

  • Added cmd/peek/main_test.go with a broad suite of tests covering validateNoPositionalArgs, parseDuration, expandPath, DB subcommands (runDbStats, runDbClean), runServerMode, runCollectMode, CLI flows via main, and helper utilities like captureStdout and isStdinPiped.
  • Updated pkg/parser/parser_test.go for style cleanup and added tests including TestParseLogfmtEdgeCases and TestLogfmtParser_ParsesTimestampField, plus existing parser behavior and ID generation checks.
  • Introduced pkg/query/lucene_behavior_test.go with tests for extended duration parsing, multiple time value formats, query matching semantics, token reading, range parsing, and filter edge cases.
  • Introduced pkg/server/server_test.go to exercise HTTP handlers, WebSocket subscribe/broadcast flows, static asset handlers, broadcast worker behavior, and error handling when storage is unavailable.
  • Introduced pkg/storage/badger_behavior_test.go to validate storage behaviors including time-range queries, field discovery, deletion APIs, subscription notifications, compaction/retention helpers, scan error propagation, and stats/expandPath behavior.

Testing

  • Ran the Go test suite with go test ./... across the repository and all new and existing tests completed successfully.

Codex Task

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

Release Label Suggestion

Suggested label: skip-release
If merged now, estimated next tag: no tag (skip-release)
Why: No bump signal found; defaulting to skip-release (source: default policy)

You can change this by updating PR labels before merge.

Allowed labels (exactly one required):

  • release:patch
  • release:minor
  • release:major
  • skip-release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant