Skip to main content

test.sh

test.sh - Overview

This script executes various tests for the Badger database, including package tests, manual tests, root-level tests, and stream tests. It also handles code coverage reporting when running in a CI environment.

Detailed Documentation

manual()

Purpose: Runs a suite of "manual" tests, including specific test cases for truncate, large key-value pairs, value log limits, key counts, iterator behavior, stream handling, goroutine leaks, and GetMore functionality.

Parameters: None

Returns: None. Exits the script if any test fails.

root()

Purpose: Executes tests in the root directory.

Parameters: None

Returns: None. Exits the script if any test fails.

stream()

Purpose: Runs benchmark and stream tests for the Badger database. It creates a temporary directory, performs write and read benchmarks, streams the data to another directory, and checks for memory leaks.

Parameters: None

Returns: 0 on success, 1 on failure (if a memory leak is detected).

write_coverage()

Purpose: Appends coverage data from temporary files to a main coverage file (cover.out) when running in a CI environment.

Parameters: None

Returns: None.

Code Examples

None.

Getting Started Relevance

YES