Skip to content

test(stjm): run the previous release's test suite against the current library in CI #218

Closed

Description

@egil

The contract that matters most for this package is that JSON written by an earlier release still reads the same. Running the last release's own behavior tests, unmodified, against the current library is a cheap and direct check of that, and doing it by hand on #213 found a real 1.x-to-2.0 read regression (numeric payload for an enum source with JsonStringEnumConverter, introduced in #199's non-object matching rewrite).

Change

  • Add a CI job (or a target in the test project) that resolves the latest egil-systemtextjson-migration/v* tag, extracts test/Egil.SystemTextJson.Migration.Tests from it with git archive, drops in the current test csproj, and runs it against the current src on every target framework.
  • Maintain an explicit allowlist of previous-release test names that are expected to fail because of a documented behavior change (currently Copied_options_use_their_own_metadata_context_for_converter_creation), so every other failure breaks the build. Each allowlist entry must link the upgrade-page section that documents the change.
  • Skip tests that no longer compile against the current API only when a documented API removal exists; today there are none.
  • Mention the job in docs/recipes/upgrading-to-v2.md as the mechanism behind the "stored data" guarantee.

The manual recipe used on #213 (from the project root):

git archive <tag> test/Egil.SystemTextJson.Migration.Tests | tar -x -C test/Compat --strip-components=2
cp test/Egil.SystemTextJson.Migration.Tests/*.csproj test/Compat/Compat.csproj
dotnet test --project test/Compat -c Release --framework net10.0

Activity

  1. added
    enhancementNew feature or request
    stjmEgil.SystemTextJson.Migration scope
    on Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requeststjmEgil.SystemTextJson.Migration scope

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions