# onsi/ginkgo

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/onsi-ginkgo).**

9,014 stars · 702 forks · Go · MIT

## Links

- GitHub: https://github.com/onsi/ginkgo
- Homepage: http://onsi.github.io/ginkgo/
- awesome-repositories: https://awesome-repositories.com/repository/onsi-ginkgo.md

## Description

Ginkgo is a behavior-driven development testing framework, assertion library, and test runner for Go. It provides a domain-specific language for writing human-readable specifications, organizing tests into hierarchical containers and subjects to describe system behavior.

The project distinguishes itself through advanced execution control and observability, featuring a test runner capable of parallel distribution, sharding, and randomized execution order to detect flaky tests. It includes specialized diagnostic tools for goroutine leak detection, hanging spec monitoring, and failure state debugging.

The framework covers a broad range of testing capabilities, including asynchronous system validation with polling and timeouts, complex data structure assertions, and comprehensive lifecycle management for nested setup and teardown. It also provides automation for test filtering via labels or descriptions and the generation of machine-readable reports.

The test suite can be precompiled into a standalone binary for faster execution and distribution.

## Tags

### Testing & Quality Assurance

- [BDD Specification Structuring](https://awesome-repositories.com/f/testing-quality-assurance/bdd-specification-structuring.md) — Organizes test logic into a hierarchical structure using containers and subjects to describe system behavior. ([source](https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/README.md))
- [BDD Test Hierarchies](https://awesome-repositories.com/f/testing-quality-assurance/bdd-test-hierarchies.md) — Organizes tests into a nested structure of containers and specs to map system behavior to a descriptive hierarchy.
- [Behavior Driven Development](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/behavior-driven-development.md) — Implements a behavior-driven development framework for Go using human-readable specifications and hierarchical containers.
- [Assertion Libraries](https://awesome-repositories.com/f/testing-quality-assurance/assertion-libraries.md) — Provides a wide range of matchers for both synchronous and asynchronous state verification in Go.
- [Assertion Matchers](https://awesome-repositories.com/f/testing-quality-assurance/assertion-matchers.md) — Provides a comprehensive set of assertion matchers that can be combined using logical operators. ([source](https://onsi.github.io/gomega/))
- [Asynchronous Logic Validation](https://awesome-repositories.com/f/testing-quality-assurance/asynchronous-logic-validation.md) — Provides specialized tools for validating eventual consistency in asynchronous Go code using polling and timeouts.
- [Suite-Level Resource Initialization](https://awesome-repositories.com/f/testing-quality-assurance/automated-test-suites/suite-level-resource-initialization.md) — Performs expensive setup and teardown exactly once for the entire suite to manage external dependencies. ([source](https://onsi.github.io/ginkgo/))
- [Test Lifecycle Hooks](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/test-lifecycle-hooks.md) — Manages the setup and teardown of resources across nested test containers to ensure environment isolation.
- [Go Testing Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/go-testing-frameworks.md) — Provides a comprehensive testing environment for Go applications with support for data-driven scenarios and complex assertions.
- [Parallel Test Execution](https://awesome-repositories.com/f/testing-quality-assurance/parallel-test-execution.md) — Distributes test specifications across multiple CPU cores to reduce total execution time in Go projects.
- [Assertion and Validation Utilities](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/assertions-and-validation/assertion-validation-utilities.md) — Provides comprehensive utilities for defining test conditions and assertions with multi-return error handling. ([source](https://onsi.github.io/gomega/))
- [Custom Matchers](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/assertions-and-validation/assertion-validation-utilities/snapshot-testing-utilities/custom-matcher-pipelines/custom-matchers.md) — Implements a common matcher interface supporting both synchronous checks and eventual consistency polling.
- [Test Execution Runners](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/execution-and-infrastructure/test-execution-runners.md) — Ships a test execution engine featuring parallelization, sharding, and randomized ordering to detect flakiness.
- [Global Test Lifecycle Hooks](https://awesome-repositories.com/f/testing-quality-assurance/testing-infrastructure-management/test-orchestration/global-test-lifecycle-hooks.md) — Provides global hooks to perform one-time setup and teardown for the entire test suite. ([source](http://onsi.github.io/ginkgo/))
- [Nested Setup Nodes](https://awesome-repositories.com/f/testing-quality-assurance/testing-infrastructure-management/test-orchestration/test-setup-orchestrators/nested-setup-nodes.md) — Supports hierarchical environment refinement using nested setup nodes to initialize shared state. ([source](https://onsi.github.io/ginkgo/))
- [Test Lifecycle Hooks](https://awesome-repositories.com/f/testing-quality-assurance/testing-infrastructure-management/test-orchestration/test-setup-orchestrators/test-lifecycle-hooks.md) — Manages test setup and teardown by wrapping test nodes in initialization and cleanup functions.
- [Description-Based Filtering](https://awesome-repositories.com/f/testing-quality-assurance/description-based-filtering.md) — Matches regular expressions against the concatenated description of the spec hierarchy to isolate specific tests. ([source](https://onsi.github.io/ginkgo/))
- [Execution State Inspection](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-failure-debugging-tools/failure-verification-tools/execution-state-inspection.md) — Pauses execution after a failure but before teardown to enable manual inspection of the system state. ([source](http://onsi.github.io/ginkgo/))
- [Test Reporters](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-reporters.md) — Generates machine-readable and formatted test reports with support for custom metadata.
- [Flaky Test Analyzers](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-reporters/ai-driven-test-analyzers/flaky-test-analyzers.md) — Identifies non-deterministic failures using randomized execution order and automated retries. ([source](http://onsi.github.io/ginkgo/))
- [Programmable Reporting Nodes](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-reporters/external-result-reporters/programmable-reporting-nodes.md) — Implements programmable reporting nodes that execute before or after specs to aggregate results. ([source](http://onsi.github.io/ginkgo/))
- [Test Report Exporters](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-reporters/external-result-reporters/tap-result-exporters/test-report-exporters.md) — Produces test results in standardized, machine-readable formats for CI/CD integration. ([source](https://onsi.github.io/ginkgo/))
- [Execution Randomizers](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/execution-randomizers.md) — Shuffles the execution order of tests using a seed to uncover hidden dependencies and state pollution.
- [Conditional Skipping](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/test-execution-controls/conditional-skipping.md) — Skips tests at compile time as pending or bypasses them dynamically at runtime based on conditions. ([source](http://onsi.github.io/ginkgo/))
- [Transient Failure Reruns](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/transient-failure-reruns.md) — Automatically reruns failed tests a specified number of times to mitigate flaky or transient failures. ([source](https://onsi.github.io/ginkgo/))
- [HTTP Mock Servers](https://awesome-repositories.com/f/testing-quality-assurance/http-mock-servers.md) — Simulates an HTTP server with a stack of handlers to validate incoming requests and return prefabricated responses. ([source](https://onsi.github.io/gomega/))
- [Label-Based Filtering](https://awesome-repositories.com/f/testing-quality-assurance/label-based-filtering.md) — Includes or excludes tests based on textual tags and complex logical queries using set-based operations. ([source](https://onsi.github.io/ginkgo/))
- [Parallel Setup Synchronization](https://awesome-repositories.com/f/testing-quality-assurance/parallel-setup-synchronization.md) — Coordinates a single setup process across multiple parallel workers to share expensive external resources. ([source](http://onsi.github.io/ginkgo/))
- [Test Case Generators](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/test-execution-orchestration/test-case-generators.md) — Creates test cases programmatically using loops or configuration files during the suite construction phase. ([source](https://onsi.github.io/ginkgo/))
- [Test Execution Filtering](https://awesome-repositories.com/f/testing-quality-assurance/test-execution-filtering.md) — Provides the ability to isolate and run tests based on their file paths or specific line number ranges. ([source](https://onsi.github.io/ginkgo/))
- [Shared Behaviors](https://awesome-repositories.com/f/testing-quality-assurance/testing-best-practices-methodologies/quality-assurance-practices/testing-methodologies/behavior-driven-testing/shared-behaviors.md) — Extracts common sets of assertions into reusable functions to avoid duplicating tests across contexts. ([source](https://onsi.github.io/ginkgo/))
- [Sequence Controllers](https://awesome-repositories.com/f/testing-quality-assurance/testing-infrastructure-management/test-execution-management/execution-ordering/sequence-controllers.md) — Ensures specific groups of tests run in a fixed sequence when they rely on shared mutating state. ([source](https://onsi.github.io/ginkgo/))
- [Test Sharding](https://awesome-repositories.com/f/testing-quality-assurance/testing-infrastructure-management/test-execution-management/test-sharding.md) — Distributes test workloads across multiple processes to utilize multiple CPU cores and reduce runtime.
- [Test Suite Filters](https://awesome-repositories.com/f/testing-quality-assurance/testing-infrastructure-management/test-execution-management/test-suite-filters.md) — Isolates and runs specific subsets of a large test suite using labels and command-line flags. ([source](https://github.com/onsi/ginkgo#readme))
- [Serial Test Execution Modes](https://awesome-repositories.com/f/testing-quality-assurance/testing-infrastructure-management/test-infrastructure/test-execution-strategies/serial-test-execution-modes.md) — Guarantees that specific tests run sequentially on a single process to avoid resource contention. ([source](https://onsi.github.io/ginkgo/))

### Data & Databases

- [Nested Data Matchers](https://awesome-repositories.com/f/data-databases/structural-data-validators/nested-data-matchers.md) — Supports building nested matchers to apply individual validation tests to specific fields within large data sets. ([source](https://onsi.github.io/gomega/))

### Development Tools & Productivity

- [Testing Frameworks](https://awesome-repositories.com/f/development-tools-productivity/go-cli-frameworks/testing-frameworks.md) — Implements a hierarchical BDD testing framework specifically for the Go ecosystem.
- [Focused Test Execution](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/test-execution-management/test-suites/focused-test-execution.md) — Enables rapid iteration by isolating a small set of specifications and skipping all non-focused tests. ([source](http://onsi.github.io/ginkgo/))
- [Table-Driven Tests](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/test-execution-management/test-suites/table-driven-tests.md) — Generates multiple test cases from tables of inputs and expected outputs for repetitive scenarios. ([source](https://github.com/onsi/ginkgo/blob/master/plugins/ginkgo/README.md))
- [Stream Buffer Assertions](https://awesome-repositories.com/f/development-tools-productivity/terminal-output-monitors/output-validation/stream-buffer-assertions.md) — Captures data in an in-memory buffer to perform ordered assertions against incremental or streaming output. ([source](https://onsi.github.io/gomega/))

### DevOps & Infrastructure

- [Test](https://awesome-repositories.com/f/devops-infrastructure/cicd-pipeline-automation/workflow-orchestration/node-lifecycle-management/test.md) — Runs setup and teardown functions before or after individual test nodes using context wrapping and thread-locking. ([source](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md))
- [Specification Timeouts](https://awesome-repositories.com/f/devops-infrastructure/execution-timeouts/specification-timeouts.md) — Enforces deadlines and grace periods for individual specifications to ensure timely completion. ([source](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md))

### Programming Languages & Runtimes

- [Testing Specifications](https://awesome-repositories.com/f/programming-languages-runtimes/domain-specific-languages/testing-specifications.md) — Offers a domain-specific language for writing human-readable specifications using containers and subjects.

### Operating Systems & Systems Programming

- [Subprocess Assertions](https://awesome-repositories.com/f/operating-systems-systems-programming/external-process-management/subprocess-assertions.md) — Allows compiling binaries and monitoring external processes to validate exit codes and output streams. ([source](https://onsi.github.io/gomega/))

### Software Engineering & Architecture

- [Test Reporting Pipelines](https://awesome-repositories.com/f/software-engineering-architecture/event-driven-architectures/test-reporting-pipelines.md) — Streams test results through a pipeline of customizable nodes that aggregate data or generate reports.
- [Deferred Cleanup Registration](https://awesome-repositories.com/f/software-engineering-architecture/function-execution-engines/cleanup-hooks/deferred-cleanup-registration.md) — Ensures resources are released regardless of test outcome by registering cleanup functions adjacent to setup code. ([source](https://onsi.github.io/ginkgo/))
- [Goroutine Leak Prevention](https://awesome-repositories.com/f/software-engineering-architecture/memory-usage-analysis/memory-leak-prevention/goroutine-leak-prevention.md) — Verifies that test executions finish without leaving orphaned or leaked goroutines. ([source](https://onsi.github.io/gomega/))

### System Administration & Monitoring

- [Test State Cleanup](https://awesome-repositories.com/f/system-administration-monitoring/execution-callbacks/cleanup-callbacks/test-state-cleanup.md) — Executes cleanup code after specifications to restore external systems and prevent state pollution between tests. ([source](http://onsi.github.io/ginkgo/))
- [Execution State Streaming](https://awesome-repositories.com/f/system-administration-monitoring/execution-state-streaming.md) — Emits current execution state and source code location in real-time to help debug slow or stuck tests. ([source](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md))
- [Stuck Process Monitoring](https://awesome-repositories.com/f/system-administration-monitoring/stuck-process-monitoring.md) — Emits progress reports and stack traces for hanging tests via system signals or polling intervals. ([source](https://onsi.github.io/ginkgo/))

### Part of an Awesome List

- [Frameworks and Libraries](https://awesome-repositories.com/f/awesome-lists/devtools/frameworks-and-libraries.md) — BDD-style testing framework for Go.
