liveBook · Manning

Evaluation suite

As explained in gRPC Microservices in Go

A test suite is a collection of tests and associated lifecycle behavior organized to verify a set of requirements.

A test suite groups related tests around a system under test (SUT). Each test supplies inputs, execution conditions, and expected results; together, the tests verify happy paths and edge cases for a class, architectural layer, or entire application. section 7.2.1

Use suite lifecycle hooks to control shared state and per-test isolation:

  • Before each test, create or reset test-specific dependencies such as mocks. section 7.3.1
  • After each test, remove files, folders, or other state that could affect the next test. section 7.3.1
  • Before all tests, initialize shared resources such as a database or Testcontainers environment. section 7.3.1
  • After all tests, destroy shared resources and leave the environment clean. section 7.3.1

Testing an order database adapter

Define an OrderDatabaseTestSuite struct embedding suite.Suite, then use SetupSuite to start a MySQL 8.0.30 container with testcontainers-go and wait for its SQL endpoint. Add tests that save an order and retrieve it to verify the customer ID, and run the receiver-based tests with suite.Run. Execute the suite with `go test ./...`. section 7.3.2

Figure 7.2 A test suite is formed by a set of related tests, and its goal is to verify a SUT.

Shows how related happy-path and edge-case tests combine to verify one system under test. section 7.2.1

How gRPC Microservices in Go covers it

How deep it goes
Explains grouping, setup, teardown, shared resources, and execution, then demonstrates a database integration suite without detailing the full test pyramid.
Examples
Uses happy-path and edge-case tests, a MySQL Testcontainers instance, and order save-and-get adapter tests.
What it assumes
Assumes familiarity with SUTs and testing layers while teaching suite grouping, lifecycle hooks, integration setup, and shared-resource cleanup.
What you can do after
Builds Go suites that prepare dependencies, exercise database adapters, assert results, clean resources, and run through `go test ./...`.
How it connects
Connects system under test, unit testing, integration testing, end-to-end testing, Testcontainers, and CI pipelines.

Also explained in

Compare how 11 books explain evaluation suite →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of gRPC Microservices in Go. The section links point to the parts of the book it draws on.