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

Add golden test machinery #311

Merged
merged 5 commits into from
Nov 26, 2020
Merged

Add golden test machinery #311

merged 5 commits into from
Nov 26, 2020

Conversation

isovector
Copy link
Contributor

This PR adds a new GoldenTestSpec, which exposes a golden combinator for building golden tests. These tests take a SymbolicObj3, and will raytrace it, checking the resulting STL against a known-good version. The result is a robust system for ensuring mesh generation doesn't subtly change when working on the underlying infrastructure.

@julialongtin, you seemed somewhat against golden tests in our brief discussion on IRC. I'd urge you to reconsider; checking in the test result artifacts has the benefit that changes which (intentionally or otherwise) modify the mesh generation must come with a corresponding diff to the tests. This gives at-a-glance review-time reassurance that no bugs have been smuggled in.

Furthermore, it reifies your testing strategy of "check out the old branch, build some STLs, hash them, check out the new branch, build the same STLs, and compare the hashes" --- allowing other contributors to share that testing burden with you (albeit in an automated way.) The current makefile-based solution doesn't work at all for stack-managed GHC installs, and as we've seen on the GHC codebase, this is a surprisingly difficult problem to get right. Simpler for everyone to just put it into Haskell.

This PR adds a new GoldenTestSpec, which exposes a `golden` combinator
for building golden tests. These tests take a SymbolicObj3, and will
raytrace it, checking the resulting STL against a known-good version.
The result is a robust system for ensuring mesh generation doesn't
subtly change when working on the underlying infrastructure.
Copy link
Member

@julialongtin julialongtin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code speaks loudly. This looks great. Gladly approved!

@isovector
Copy link
Contributor Author

Excellent! In that case I'll do some more work on it tomorrow to get everything nicely polished here.

@isovector isovector marked this pull request as draft November 24, 2020 10:58
@isovector isovector changed the title Add golden test machinery [wip] Add golden test machinery Nov 24, 2020
@isovector isovector marked this pull request as ready for review November 25, 2020 21:21
@isovector isovector changed the title [wip] Add golden test machinery Add golden test machinery Nov 25, 2020
@isovector
Copy link
Contributor Author

@julialongtin PTAL

@isovector
Copy link
Contributor Author

I plan to follow up this PR with another that copies the haskell examples in as golden tests.

@julialongtin julialongtin merged commit b725422 into Haskell-Things:master Nov 26, 2020
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.

2 participants