Skip to content

Reorganize tests with hspec-like naming

Horizon Bot requested to merge add-expect-failure-meta-test into master

Summary

Reorganizes the test suite to use hspec-like naming conventions, making tests more descriptive and easier to understand.

Tests are now organized by the module under test, with descriptive "it-" names that clearly state the behavior being tested:

Test Structure

gitlab-ci/ (core gitlab-ci module):

  • it-generates-simple-config
  • it-generates-config-with-extra-modules
  • it-deduplicates-module-imports
  • it-evaluates-modules

Module-specific validators:

  • flake-strict-inputs/it-rejects-invalid-inputs
  • flake-lock/it-detects-outdated-lock
  • flake-show/it-detects-eval-errors

expect-failure/ (expect-failure module):

  • it-passes-when-job-fails
  • it-fails-when-job-succeeds

Changes

  • Move from test/{positive,negative}/* to test/{module}/*
  • Use hspec-like naming: {module}/it-{does-what}
  • Split expect-failure-meta test into two focused tests
  • Create nix/configuration/test.nix for test child pipelines
  • Update ci.nix to remove direct flake tests (now use child pipelines)

Benefits

  1. Clearer intent: Module-based organization provides the "describe" context
  2. Better discoverability: Easy to find tests for a specific module
  3. Focused tests: Split meta-test into granular behavior tests
  4. Consistent naming: All tests follow the same pattern

🤖 Generated with Claude Code

Merge request reports