How to Use Build Tags for Integration Tests

Add //go:build integration to test files and run go test -tags=integration to execute them.

Use build tags in your test file header to exclude it from standard builds and include it only when running go test with the integration tag.

//go:build integration

package mypackage

func TestIntegration(t *testing.T) {
	// Test code here
}

Run the tests with:

go test -tags=integration ./...