Skip to content

ozontech/testo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testo banner showing its chef gopher mascot on a blue background

Testo

Go Reference Code Coverage Quality Assurance Mentioned in Awesome Go

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!

See also toppings - a collection of small optional plugins for Testo.

Features

Why Testo

Ozon runs thousands of end-to-end tests on Testo every day.

Plugins let teams add what they need: reporting, retries, custom T methods. Tests stay plain go test tests.

See comparison with other frameworks.

Quick Start

go get github.com/ozontech/testo

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

Testo can do more. For example, run parametrized tests in suite:

type Suite struct{ testo.Suite[*testo.T] }

func (Suite) CasesWord() []string {
    return []string{"dough", "bread"}
}

func (Suite) TestLen(t *testo.T, p struct{ Word string }) {
    if len(p.Word) == 0 {
        t.Error("word must not be empty")
    }
}

func TestSuite(t *testing.T) {
    testo.RunSuite(t, new(Suite))
}

TestLen runs once per word from CasesWord.

Next steps

Plugins

Plugins can:

  • Provide BeforeAll/AfterAll, BeforeEach/AfterEach & BeforeEachSub/AfterEachSub hooks.
  • Plan tests for execution - filter, duplicate & reorder.
  • Override built-in T methods, such as Log and Error.
  • 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.

See the guide on writing plugins.

Examples:

VS Code Extension

Testo has its own VS Code extension.

The extension adds run/debug buttons for individual suite tests, plus snippets.

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, the 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.

About

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

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages