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 checkPhase to ensure compiled packages actually work #50

Open
considerate opened this issue Mar 28, 2023 · 4 comments · May be fixed by #51
Open

Add checkPhase to ensure compiled packages actually work #50

considerate opened this issue Mar 28, 2023 · 4 comments · May be fixed by #51

Comments

@considerate
Copy link
Member

Missing FFI files is not an error so to ensure a package set actually works together running tests is important.

@thomashoneyman
Copy link

Unfortunately the registry does not include test directories by default (because build tools like Spago and Pulp ignore them) but we could reconsider that if you want to raise an issue.

@considerate
Copy link
Member Author

I’m not sure to what extent this should be enforced. The issue with tests is that some tests may be flaky or depend on having an Internet connection. There’s also the issue of how to treat packages with very extensive and computationally heavy tests.

Nonetheless, when trying to establish package sets for purenix I ran into the issue that it was difficult to verify if the built packages actually:

  1. Compiled the sources into meaningful nix files
  2. Created outputs that would be able to construct a cohesive application or library
  3. Had an implementation that wouldn’t just result in a lot of runtime errors

I think some of the above could be done by inspecting the purs logs for warnings and treating those as failures but that only gets you so far. Hence, I want to move forwards with optionally running tests for each package in a package set.

@considerate
Copy link
Member Author

@thomashoneyman Your point completely escaped me. It would indeed be nice if the test directories were included so that it’s possible to test the package sets even though spago won’t do so by default.

It wouldn’t be nice to fetch the test directories separately since then it wouldn’t give as much confidence that the published (tarball) version works.

@considerate
Copy link
Member Author

Apart from including the test sources in the registry storage backend the registry would also need to support declaring test dependencies.

The purs.json file format doesn't have a field for test dependencies like spago does.

@considerate considerate linked a pull request May 6, 2023 that will close this issue
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 a pull request may close this issue.

2 participants