mix test.regression (sc v1.0.2)

View Source

Run regression tests that should always pass.

This task reads from test/passing_tests.json and runs only the tests listed there to ensure we don't break existing functionality.

Usage

mix test.regression

Options

  • --update - Update the passing_tests.json file with currently passing tests
  • --verbose - Show detailed output for each test run

Summary

Functions

Expands a list of test patterns, supporting glob wildcards.

Loads the passing tests registry from test/passing_tests.json.

Functions

expand_test_patterns(test_patterns)

@spec expand_test_patterns([String.t()]) :: [String.t()]

Expands a list of test patterns, supporting glob wildcards.

Takes a list of test file patterns (which may include glob patterns like test/sc/**/*_test.exs) and returns a sorted list of actual test files that exist on the filesystem.

Examples

iex> Mix.Tasks.Test.Regression.expand_test_patterns(["test/sc_test.exs"])
["test/sc_test.exs"]

iex> Mix.Tasks.Test.Regression.expand_test_patterns(["test/sc/**/*_test.exs"])
["test/sc/parser/scxml_test.exs", "test/sc/document_test.exs", ...]

load_passing_tests(path \\ "test/passing_tests.json")

@spec load_passing_tests(String.t()) :: {:ok, map()} | {:error, String.t()}

Loads the passing tests registry from test/passing_tests.json.

Returns {:ok, tests_map} if successful, or {:error, reason} if the file cannot be read or contains invalid JSON.

Examples

iex> Mix.Tasks.Test.Regression.load_passing_tests()
{:ok, %{"internal_tests" => [...], "scion_tests" => [...], "w3c_tests" => [...]}}