Go Testing: Difference between revisions
Jump to navigation
Jump to search
Line 18: | Line 18: | ||
==System Tests== | ==System Tests== | ||
=<span id='Integration_Testing'><span>Integration Tests= | =<span id='Integration_Testing'><span>Integration Tests= | ||
{{Internal|Go_Integration_Tests#Overview|Go Integration Tests}} | {{Internal|Go_Integration_Tests#Overview|Go Integration Tests}} |
Revision as of 16:56, 11 March 2024
External
Internal
Overview
Go comes with a lightweight test framework that includes the go test
command and the testing
package. The tests live in *_test.go
files, located in the package directory.
Packages
Test Types in Go
Unit Tests
Integration Tests
System Tests
Integration Tests
System Tests
Benchmarks
Process this: https://pkg.go.dev/testing#hdr-Benchmarks.
Fuzzing
Process this: https://pkg.go.dev/testing#hdr-Fuzzing.
Skipping
Process this: https://pkg.go.dev/testing#hdr-Skipping.
Subtests and Sub-benchmarks
Process this: https://pkg.go.dev/testing#hdr-Subtests_and_Sub_benchmarks.
Main
Process this: https://pkg.go.dev/testing#hdr-Main.
Mocks
Mock support: github.com/golang/mock/mockgen
TO DO
- Integrate see external test packages.
- Testing idiom "Introducing Go" page 96.
- Investigate gotest.tools module.
- Running go test immediately after cloning should succeed without any configuration or any running database. If a database is required, those are integration tests.
- https://about.sourcegraph.com/blog/go/advanced-testing-in-go