Testo is a modular testing framework for Go built on top of testing.T.
It is focused on suite-based tests and has an extensive plugin system.
Testo (/tɛstɒ/) is a play on words "test" and "тесто", meaning "dough". Just like you can cook anything from dough, you can test anything with Testo!
Add some flavor to your tests with toppings - a collection of small, miscellaneous plugins for Testo framework.
- Plugins - adapt your tests to any scenario with features you need.
- Parametrized tests - describe a test once, repeat it with different parameters.
- Parallel tests - make your tests faster by running them all at once.
- Lifecycle hooks - before and after any suite, test & sub-test.
- Test annotations - attach static options to any test.
- Informative errors and traces - no need to guess what went wrong.
- Sub-tests - support for nested tests.
- Test reflection - deeply inspect test's meta-information.
- Caching - key-value storage persistent between test runs.
At Ozon, Testo powers thousands of end-to-end tests daily in production.
With plugins, it is flexible enough to adapt to diverse requirements,
without leaving the Go ecosystem - just a layer over testing.T.
If your needs are outgrowing standard testing package, Testo is a great choice.
go get github.com/ozontech/testoYour first test with Testo:
// file: main_test.go
package main
import (
"testing"
"github.com/ozontech/testo"
)
// A special construct that describes what plugins to use.
// Here we use the base T without plugins.
type T struct { *testo.T }
type Suite struct{ testo.Suite[T] }
func (Suite) TestHelloWorld(t T) {
t.Log("hello from testo!")
}
func Test(t *testing.T) {
testo.RunSuite(t, new(Suite))
}And run it with go test as usual:
go test .See also VS Code extension for Testo.
- Take a guided tour of Testo by making simple plugins and running the tests using various features.
- See test examples.
- Learn how to use various Testo features.
- Read a brief description and technical overview of Testo.
- View API documentation.
Testo features a powerful plugin system.
Plugins can:
- Provide
BeforeAll/AfterAll,BeforeEach/AfterEach&BeforeSubEach/AfterSubEachhooks. - Plan tests for execution - filter, duplicate & reorder.
- Override built-in
Tmethods, such asLog,Errorand etc. - Extend
Tby adding new methods. - Allow users to configure their behavior through options.
- Communicate with other plugins.
- Add command line flags for
go testcommand.
Examples:
- Testo Allure Plugin - enhance your tests with automatically generated Allure Reports.
- Testo Rerun Plugin - adds
--last-failed-like behaviour from Pytest to Testo. Makes it possible to rerun only failed tests. - Testo XFail Plugin - adds
t.XFail()method to mark a test as "expected to fail". - Testo Parallel Plugin - marks all tests as parallel by default.
Testo has its own VS Code extension.
Makes it easier to run and debug individual suite tests.
Testo guarantees to support at least 3 latest major Go releases.
Currently, minimum supported Go version is 1.24
This project is released under the Apache-2.0 license.
