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

Duplicated test logic #297

Open
travitch opened this issue Jun 25, 2022 · 2 comments
Open

Duplicated test logic #297

travitch opened this issue Jun 25, 2022 · 2 comments
Labels
tech-debt Technical debt that would be nice to clean up testing Issues related to the test suite

Comments

@travitch
Copy link
Contributor

There is a bit of logic duplicated in the architecture backend tests that saves macaw IR for debugging purposes e.g.,:

instance TTO.IsOption SaveMacaw where
defaultValue = SaveMacaw False
parseValue v = SaveMacaw <$> TTO.safeReadBool v
optionName = pure "save-macaw"
optionHelp = pure "Save Macaw IR for each test case to /tmp for debugging"

We should consolidate this into one place. The major question is where. We could put it in a new module like Data.Macaw.Testing in macaw-base, or split out this common testing functionality into a new package like macaw-testing.

@travitch travitch added tech-debt Technical debt that would be nice to clean up testing Issues related to the test suite labels Jun 25, 2022
@RyanGlScott
Copy link
Contributor

There is some prior art in macaw-symbolic's Data.Macaw.Symbolic.Testing module, so it wouldn't be too much of a stretch to put Data.Macaw.Testing in macaw-base. We could also split out the testing logic into their own packages, although we'd likely need both macaw-testing and macaw-testing-symbolic.

@travitch
Copy link
Contributor Author

I did that out of expedience, but I'm not sure that I like having a dependency on a testing library in one of the core libraries. That generally doesn't feel great, and I've been burned by weird e.g., quickcheck dependency issues before. I'm not opposed obviously, but maybe a general macaw-testing library to hold all of that might be better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt Technical debt that would be nice to clean up testing Issues related to the test suite
Projects
None yet
Development

No branches or pull requests

2 participants