Ginkgo

go get github.com/tracera-dev/tracera-go/ginkgo

Requires Go ≥ 1.25 and Ginkgo v2 (see Autotest adapters). ginkgo on pkg.go.dev.

Environment variables and run mode: Autotest adapters.

Call Register() once in the suite file:

import tracera_ginkgo "github.com/tracera-dev/tracera-go/ginkgo"

var _ = tracera_ginkgo.Register()

Bind testCaseId and autotestName

Prefer Ginkgo Labels (bind works even when the body skips early):

It("checks out", Label("tracera.id:42"), func() {
    // …
})

It("checks out", Label("tracera.id:42", "tracera.name:e2e/checkout"), func() {
    // …
})

Or bind imperatively with tracera.TestCase(42) / tracera.TestCase(42, "e2e/checkout").

Skip

Use stock Ginkgo skip (Skip("…")). The skip reason is added to the result as comment.

Steps

Use tracera.Step("…", func() { … }). Steps inside BeforeEach / AfterEach go to Setup / Teardown; steps inside the spec go to Test. Suite-level hooks (BeforeSuite / AfterSuite) are not reported.

BeforeEach(func() {
    tracera.Step("open shop", func() {})
})

It("pays", Label("tracera.id:10"), func() {
    tracera.Step("add item", func() {
        tracera.Step("nested leaf", func() {})
    })
})

Comments, errors, and attachments

Limits and allowed MIME types: Autotest adapters.

Use tracera.Comment, tracera.Error, tracera.AttachmentFile, and tracera.AttachmentBytes on the open step or the result.

If you start a goroutine and call Tracera APIs there (steps, comments, errors, attachments), save the context on the test goroutine first and run the worker with tracera.RunWithContext — otherwise those calls are not reported:

ctx := tracera.GetContext()
go tracera.RunWithContext(ctx, func() {
    tracera.Step("worker", func() { /* ... */ })
})

Parallel suites (ginkgo -p, --procs=N) share one test run across processes — no extra setup.

Parameterized

Use Ginkgo DescribeTable / Entry. Put a fixed tracera.id: on a Label (table or entry). If the name is omitted, autotestName takes the value of the Ginkgo test name — give each Entry its own title (for example "one item" / "two items" below). Or pass a name to tracera.TestCase:

DescribeTable("checkout", Label("tracera.id:101"),
    func(qty int) { /* ... */ },
    Entry("one item", 1),
    Entry("two items", 2),
)