rewriter

command
v0.0.0-...-6b0088a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Rewriter will take one or more existing Go test files on the command-line and rewrite "goconvey" tests in them to use go.chromium.org/luci/common/testing/ftt.

This makes the following changes:

  • Converts all Convey function calls to ftt.Run calls. This will also rewrite the callback from `func() {...}` to `func(t *ftt.Test) {...}`. If the test already had an explicit context variable (e.g. `func(c C)`), this will preserve that name.
  • Removes dot-imported convey.
  • Adds imports for go.chromium.org/luci/testing/common/truth/assert and go.chromium.org/luci/testing/common/truth/should.
  • Rewrites So and SoMsg calls.

Note that 'fancy' uses of Convey/So will likely be missed by this tool, and will require hand editing... however this does complete successfully for all code in luci-go, infra and infra_internal at the time of writing.

Directories

Path Synopsis
Package rewriteimpl will take one or more existing Go test files on the command-line and rewrite "goconvey" tests in them to use go.chromium.org/luci/common/testing/ftt.
Package rewriteimpl will take one or more existing Go test files on the command-line and rewrite "goconvey" tests in them to use go.chromium.org/luci/common/testing/ftt.
testinputs
Package testinputs is a valid Go package which contains test files (and only test files) using a variety of testing functionality.
Package testinputs is a valid Go package which contains test files (and only test files) using a variety of testing functionality.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL