Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to FsCheck3 in a separate project #450

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

farlee2121
Copy link
Collaborator

@farlee2121 farlee2121 commented Apr 18, 2023

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.

  • FsCheck's configuration flow changed to a builder format.
  • Replay was changed to a new type, but we can map our current format into the new one.
  • The names and a few parameters of test result union cases were changed, but updating the mapping was 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
Copy link
Collaborator Author

farlee2121 commented Apr 24, 2023

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?

@haf haf merged commit a2a81ea into haf:main Jun 7, 2023
@farlee2121
Copy link
Collaborator Author

@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
Copy link
Collaborator

ratsclub commented Jun 8, 2023

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
Copy link
Collaborator

ratsclub commented Jun 8, 2023

@farlee2121 It's now published, thanks!

@farlee2121
Copy link
Collaborator Author

@ratsclub Thanks for updating the build scripts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants