Skip to content

ozontech/testo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testo banner showing its chef gopher macost

Testo

Go Reference Go Report Card Code Coverage Quality Assurance

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.

Features

  • 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.

Why Testo

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.

Quick Start

go get github.com/ozontech/testo

Your 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.

Next steps

Plugins

Testo features a powerful plugin system.

Plugins can:

  • Provide BeforeAll/AfterAll, BeforeEach/AfterEach & BeforeSubEach/AfterSubEach hooks.
  • Plan tests for execution - filter, duplicate & reorder.
  • Override built-in T methods, such as Log, Error and etc.
  • Extend T by adding new methods.
  • Allow users to configure their behavior through options.
  • Communicate with other plugins.
  • Add command line flags for go test command.

Examples:

VS Code Extension

Testo has its own VS Code extension.

Makes it easier to run and debug individual suite tests.

VSCode extension screenshot showing codelens buttons for running and debugging a test

Minimum supported Go version

Testo guarantees to support at least 3 latest major Go releases.

Currently, minimum supported Go version is 1.24

Contributing

Contributions are welcome!

See contributing guidelines.

License

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!

About

Modular testing framework for Go. Featuring plugins, suites, parallel tests and much more!

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages