Testo is a modular testing framework for Go built on top of testing.T
with 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 & sub-suites - support for nested tests and nested suites.
- 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:
package main
import (
"testing"
"github.com/ozontech/testo"
)
func Test(t *testing.T) {
testo.RunTest(t, func(t *testo.T) {
t.Log("Hello, Testo!")
})
}And run it with go test as usual:
go test .But there is more! Testo supports suites, parametrized tests & plugins, see Next steps.
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 and adds helpful snippets.
Testo guarantees to support at least 3 latest major Go releases.
Currently, minimum supported Go version is 1.24
Contributions are welcome!
This project is released under the Apache-2.0 license.
Tip
If you find Testo useful, consider giving this repository a star to help it reach more people. Thank you!
