- Unit tests:
github.com/stretchr/testify/require. - Integration tests: Ginkgo v2 + Gomega.
make unit-tests # all unit tests except Postgres (-race -cover)
make unit-tests-postgres # Postgres tests (requires Docker)
make unit-tests-sdk # SDK wiring tests (TestWiring)
go test -run TestMyTest ./platform/view/... # a single unit testThe full integration suite is slow and needs Fabric binaries + Docker. Run a focused target locally and let CI run the rest:
make integration-tests-fabric-iou
GINKGO_TEST_OPTS="--focus='IOU Life Cycle'" make integration-tests-fabric-iouSee integration-tests.md and
docs/dev/development.md.
var _ = Describe("Feature", func() {
s := NewTestSuite(opts...)
BeforeEach(s.Setup)
AfterEach(s.TearDown)
It("test case", s.TestFunction)
})- Define the network topology in
<test>/topology.goviaintegration.Generate(). - Put reusable test logic in
<test>/<test>.go. - For multi-node scenarios, use
integration.ReplicationOptions.
Use FIt/FDescribe to focus a spec or XIt to skip one while iterating —
never commit them (CI treats a stray focus as a failure). Prefer the
GINKGO_TEST_OPTS="--focus=..." flag for anything you might commit.
Mocks are generated with counterfeiter
(pinned in tools/tools.go). Regenerate with go generate ./... after changing a
mocked interface. See docs/dev/mocks.md.