Skip to content

Turing integration tests should be moved to (or included in) Turing repo #703

@penelopeysm

Description

@penelopeysm

DynamicPPL contains a series of integration tests in the test/turing directory.

The way it's set up in CI, it fetches the most recent version of Turing, and if it's compatible with the version of DynamicPPL being tested, it runs the tests. If it's not compatible, it logs it and exits.

- name: Load this and run the downstream tests
shell: julia --color=yes --project=downstream {0}
run: |
using Pkg
try
# force it to use this PR's version of the package
Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
Pkg.update()
Pkg.test(julia_args=["--depwarn=no"]) # resolver may fail with test time deps
catch err
err isa Pkg.Resolve.ResolverError || rethrow()
# If we can't resolve that means this is incompatible by SemVer and this is fine
# It means we marked this as a breaking change, so we don't need to worry about
# Mistakenly introducing a breaking change, as we have intentionally made one
@info "Not compatible with this release. No problem." exception=err
exit(0) # Exit immediately, as a success
end

This unfortunately has the potential to cause breakage, as illustrated by this sequence of events with DynamicPPL 0.30:

  1. DynamicPPL v0.30 was released.
  2. Turing 0.35.2 was released. I fixed the tests that broke in the Turing test suite, but the DPPL integration tests didn't get run.
  3. On the next PR to DynamicPPL, which was on something completely unrelated, the integration tests failed.
  4. But we have already released Turing 0.35.2 which means that people out there can be using a bugged version where generated_quantities resamples values it shouldn't be resampling.

The solution to this, IMO, is to move the integration tests to the Turing.jl repo. That way, this chain of events would have been arrested at step 2. It's true that DynamicPPL itself would have a buggy release, but at least we wouldn't be letting ordinary Turing-users access it; they would have to be fiddling with internals to access a version that wasn't compatible with Turing.

More generally speaking, the integration tests get run on new patch releases but don't get run on new minor releases (because Turing's compat can't have been updated yet). This is a bit counterintuitive, because it's far more likely that a minor release breaks Turing rather than a patch release. I think it also leads to a false confidence when seeing the green tick.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions