How onsi/ginkgo works
Ginkgo is a Go BDD testing framework and companion CLI. A user defines specs through the DSL, then invokes the CLI or Go testing entry point to discover, filter, compile, and execute suites; results are reported in human-readable or machine-readable formats. The CLI also supports bootstrapping, code generation, outlining, labels, profiling, and watch mode. The graph preserves these documented capabilities, while its detailed execution and parallel-coordination links rely on sampled source. Other subsystem relationships are documented at a capability level in the README, not traced through unsampled implementations.
Main entry points: program.go CLI Dispatcher · suite.go Suite Runtime · run.go Suite Runner · server_handler.go Parallel Coordination
Components 23
Spec Authoring
- Ginkgo DSL
core_dsl.go - Table DSL
table_dsl.go - Spec Decorators
dsl/decorators/decorators_dsl.go
Suite Runtime
- Suite Runtime
internal/suite.go - Spec Tree
internal/tree.go - Spec Context
internal/spec_context.go - Config and Filters
types/label_filter.go
Reporting
- Default Reporter
reporters/default_reporter.go - Report Formats
reporters/junit_report.go - Custom Reporting
reporters/reporter.go - Output Formatting
formatter/formatter.go
CLI Workflows
- Run Command
ginkgo/run/run_command.go - CLI Dispatcher
ginkgo/command/program.go - CLI Entry
ginkgo/main.go - Suite Runner
ginkgo/internal/run.go - Bootstrap and Generate
ginkgo/generators/generate_command.go - Suite Outline
ginkgo/outline/ginkgo.go - Label Commands
ginkgo/labels/labels_command.go - Watch Mode
ginkgo/watch/watch_command.go
Runtime Support
- Interrupt Handling
internal/interrupt_handler/interrupt_handler.go - Parallel Coordination
internal/parallel_support/server_handler.go
Other components
- Go Developer
- Go testing
Connections 31
- Go Developer → Ginkgo DSL: writes specs
README.md - Go Developer → Table DSL: defines tables
README.md - Go Developer → Spec Decorators: adds decorators
README.md - Ginkgo DSL → Suite Runtime: registers specs
- Table DSL → Ginkgo DSL: builds specs
- Spec Decorators → Config and Filters: sets metadata
- Go testing → Suite Runtime: hosts suite
README.md - Suite Runtime → Spec Tree: organizes nodes
- Suite Runtime → Spec Context: provides context
README.md - Suite Runtime → Config and Filters: filters specs
README.md - Go Developer → Run Command: runs suites
README.md - CLI Entry → CLI Dispatcher: starts dispatch
ginkgo/main.go - CLI Dispatcher → Run Command: routes default
ginkgo/command/program.go - Run Command → Suite Runner: runs suites
ginkgo/run/run_command.go - Suite Runner → Parallel Coordination: coordinates workers
ginkgo/internal/run.go - Suite Runner → Default Reporter: creates reporter
ginkgo/internal/run.go - Suite Runtime → Parallel Coordination: sends suite events
- Parallel Coordination → Custom Reporting: aggregates reports
internal/parallel_support/server_handler.go - Interrupt Handling → Parallel Coordination: checks abort state
internal/interrupt_handler/interrupt_handler.go - Default Reporter → Output Formatting: formats output
reporters/default_reporter.go - Default Reporter → Report Formats: emits reports
README.md - Go Developer → Custom Reporting: builds reporters
README.md - CLI Dispatcher → Bootstrap and Generate: routes commands
- CLI Dispatcher → Suite Outline: routes commands
- CLI Dispatcher → Label Commands: routes commands
- CLI Dispatcher → Watch Mode: routes commands
- Watch Mode → Suite Runner: reruns suites
ginkgo/watch/watch_command.go - Go Developer → Suite Outline: inspects suites
README.md - Go Developer → Label Commands: filters by labels
README.md - Go Developer → Watch Mode: reruns on change
README.md - Suite Runner → Report Formats: writes profiles
README.md