Test Categories & Run Guide

FluentDocker uses xUnit [Trait("Category", "...")] attributes to classify tests. This document lists every category, how to run it, and what infrastructure it needs.

Category Reference

Category Count CI-Safe? Infrastructure Required Makefile Target
Unit ~2,700 Yes None make test
Integration ~140 Yes Docker daemon make test-integration
PodmanIntegration ~45 Yes* Podman + running machine make test-integration
DevLocal ~25 No Docker Swarm + local registry make test-devlocal
LongRunning ~12 No Podman machine (may start/stop) manual
ManualOnly ~20 No Local registry, manual config manual
WaitCondition ~10 Yes Docker daemon make test-integration
Regression ~6 Yes Docker daemon make test-integration
MultiContainer ~10 Yes Docker daemon make test-integration
FluentVolume ~6 Yes Docker daemon make test-integration
FluentNetwork ~6 Yes Docker daemon make test-integration
FluentContainer ~14 Yes Docker daemon make test-integration
Compose ~13 Yes Docker daemon + Compose make test-integration

* PodmanIntegration is CI-safe only when a Podman machine is pre-provisioned in the CI environment.

Counts as of 2026-05-11; numbers reflect [Fact] + [Theory] occurrences in files carrying the matching [Trait("Category", ...)] attribute. Refresh by running dotnet test --list-tests --filter "Category=Unit" (or the appropriate category) against the test project. Some categories overlap (a test may carry both Integration and WaitCondition, for example).

Running Tests

Unit tests (CI default)

make test
# equivalent to: dotnet test --filter "Category=Unit"

All integration tests (Docker + Podman)

make test-integration
# runs ALL tests, not just Unit

A single category

dotnet test --filter "Category=PodmanIntegration"
dotnet test --filter "Category=Regression"

Combining categories

# Unit + Integration only
dotnet test --filter "Category=Unit|Category=Integration"

# Everything except DevLocal and ManualOnly
dotnet test --filter "Category!=DevLocal&Category!=ManualOnly&Category!=LongRunning"

DevLocal tests (Swarm + registry)

# 1. Start infrastructure
make devlocal-setup

# 2. Run DevLocal tests
make test-devlocal

# 3. Tear down infrastructure
make devlocal-teardown

devlocal-setup initialises Docker Swarm mode and starts the Podman machine. devlocal-teardown leaves Swarm and stops the Podman machine.

Cleanup stale test resources

make cleanup-test-resources
# removes leftover containers, networks, and volumes from previous test runs

Trait Usage Patterns

Tests use class-level traits for the primary category and may add secondary traits:

[Trait("Category", "Integration")]
[Trait("Category", "WaitCondition")]
public class WaitConditionTests { }

When filtering, secondary traits allow finer-grained selection:

dotnet test --filter "Category=WaitCondition"

Adding a New Category

  1. Apply [Trait("Category", "YourCategory")] to the test class.
  2. Add a row to the table above.
  3. If special infrastructure is needed, add setup/teardown instructions.
  4. If CI should skip it, ensure the make test filter excludes it.