haf / expecto

A smooth testing lib for F#. APIs made for humans! Strong testing methodologies for everyone!
Apache License 2.0
663 stars 96 forks source link

Migrate to FsCheck3 in a separate project #450

Closed farlee2121 closed 1 year ago

farlee2121 commented 1 year ago

Motivation

I'd like to FsCheck version 3 for some of its improvements, but Expecto currently doesn't work with FsCheck 3.

What This PR Changes

Separate Migrated Assembly

This PR adds a new project with FsCheck 3 support that we could publish separately. FsCheck 3 may not reach full-release any time soon. This way users can opt-in to FsCheck3 without disrupting the mainline Expecto.FsCheck project.

An alternative solution would be to create pre-release versions of the Expecto.FsCheck package using a -fscheck3 suffix to differentiate from the normal pre-release packages. This option may require maintaining a special branch. It might also be possible to leave the separate projects but use the same package id and publish special pre-release versions from the migrated project. However, it's unclear how version selection may work for users that specify non-deterministic pre-release versions. In short, the pro is that we don't have to manage a separate package and eventually deprecate it. The con is a potentially confusing version experience.

Migration changes

The migration itself was pretty simple.

No new FsCheck features are directly leveraged in the current migration.

Breaking Changes

FsCheck changed the way they handle random values, so the same Repeat seed does not produce consistent results across verions. Thus Expecto's unit tests depending on a deterministic result cannot pass on FsCheck 2 & 3 without modification.

farlee2121 commented 1 year ago

Hmm. I maybe squashed the changes too aggressively. It's hard to pick out the migration changes from the copying of the projects and tests. Should I try to split those commits out to simplify review?

farlee2121 commented 1 year ago

@ratsclub You mentioned fixes to the build system, does that include packing? I noticed there is a Fake target for pack, but it doesn't seem to be working for me.

ratsclub commented 1 year ago

I intend to write the new Fake scripts over the weekend. In the meantime, let me see if I can make it work for you.

Also, @haf can you provide one of us access to this repo's secret, please? This way we could setup a CI job to do releases.

ratsclub commented 1 year ago

@farlee2121 It's now published, thanks!

farlee2121 commented 1 year ago

@ratsclub Thanks for updating the build scripts!