YamlCliTestCollection.cs 1.2 KB

1234567891011121314151617181920212223
  1. namespace Tests.EndToEnd.Infra;
  2. /// <summary>
  3. /// Every test that registers RackPeek's services, directly or through the CLI host.
  4. /// <para>
  5. /// Registration writes process-wide statics as a side effect —
  6. /// <c>RpkConstants.HasGitServices</c> among them — which is harmless in
  7. /// production, where a process registers once, and a race in a test run, where
  8. /// dozens of classes register with different configuration. Two classes in
  9. /// different collections run in parallel, so a test asserting on one of those
  10. /// statics can read a value another class set microseconds earlier.
  11. /// </para>
  12. /// <para>
  13. /// One collection with parallelisation off is what makes those assertions mean
  14. /// anything. The name is deliberately about the shared state rather than about
  15. /// the YAML CLI, because membership is decided by "does this touch the statics",
  16. /// not by what the test is nominally exercising.
  17. /// </para>
  18. /// </summary>
  19. [CollectionDefinition("Process-wide static state", DisableParallelization = true)]
  20. public class YamlCliTestCollection
  21. : ICollectionFixture<TempYamlCliFixture> {
  22. }