-
Notifications
You must be signed in to change notification settings - Fork 47
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
Migrating the tests #19
Comments
To be quite honest, I don't think Cabal's test framework is very good, and I far prefer working with GHC's test suite which is fast (no need to compile/link the test binaries), easy to write tests for (Cabal tests need more boilerplate, as opposed to the expected stdout/stderr which is very convenient), parallel by default, more flexible (I can write an arbitrary shell script for the test if need be) and generally more convenient to work with. So I'd be more keen on B. |
Is there an easy way to get a minimal GHC test runner that is not tied specifically to a given GHC repository? Being able to run it on Travis without downloading and building GHC would be nice. |
Well, the test runner is all in Python and can be configured to point to your system GHC, so while the fact that the runner lives in the GHC repo proper might be a pain, you certainly don't have to build GHC. |
I just pulled the GHC git repo (from github, since I couldn't get the canonical link to respect
Some time later,
|
Might be related to this. I'm fairly certain a large number of the tests in directory are not safe to parallelize. |
Well, that's well worth fixing! |
Truthfully, I had only intended the above as a demonstration of not needing to build GHC to run the testsuite. The issue it raises does seem to be worth looking into, however. |
Failures in the above were due to accidentally linking against directory-1.2.1.0, so it appears that the technique is fundamentally sound (and the code isn't broken). Assuming Using the second method,
Suffice it to say, I also push for option B. |
As another data point, I've been unable to duplicate this success on Windows. Still looking into why that is (likely PEBCAK), but I can say it isn't as straight forward as running on Unix. |
I went with Option B since that seems to be the consensus. The changes can be seen in 23b416 to eaf723. Travis CI can now run the entire test suite automatically. It should also work on Windows with MSYS+Git+Python installed. In case anyone wants to use them in other packages like unix or win32: it can be done with minimal effort, especially if the relative file structure remains the same. The crucial files are:
|
Reopening this because, after having used it many times now, I really don't think it's worth the trouble anymore:
Just today I ran into another problem where it fails on Windows Command Prompt, because the GHC test suite changes the codepage to 65001 (UTF-8), which Python 2.7 fails to recognize and immediately bails. It works fine on MinTTY, and also fine on Python 3+ (probably because this bug got fixed). It's odd that I never discovered this until now, probably because I rarely use Command Prompt. In summary, it's a very fragile solution: the pieces just don't fit well in Cabal build system and I had to invent several dirty hacks to make it work. Future (long-term) plan: Rewrite a small pure-Haskell test library that mimics the essential features and then port all the tests over. Update: it seems that the codepage change was a red herring: although that was disruptive for interactive mode, it did not affect the actual scripts. The problem seems to manifest on both Command Prompt and MinTTY. The real reason was this change: the variable As a side-note: installing a GnuWin32 TL;DR. This change broke testing for out-of-tree compilers on MinGW. Also, do not use GnuWin32 P.S. And do not use the |
For various reasons outlined in this issue haskell#19 [1], the existing test suite does not serve our needs well and needs to be (eventually) replaced with a simple Cabal test suite. This commit implements the skeleton for the new test suite with a simple example for get/setModificationTime. [1]: haskell#19 (comment)
For various reasons outlined in this issue haskell#19 [1], the existing test suite does not serve our needs well and needs to be (eventually) replaced with a simple Cabal test suite. This commit implements the skeleton for the new test suite with a simple example for get/setModificationTime. [1]: haskell#19 (comment)
For various reasons outlined in this issue haskell#19 [1], the existing test suite does not serve our needs well and needs to be (eventually) replaced with a simple Cabal test suite. This commit implements the skeleton for the new test suite with a simple example for get/setModificationTime. [1]: haskell#19 (comment)
For various reasons outlined in this issue haskell#19 [1], the existing test suite does not serve our needs well and needs to be (eventually) replaced with a simple Cabal test suite. This commit implements the skeleton for the new test suite with a simple example for get/setModificationTime. [1]: haskell#19 (comment)
Fixed: 6323523...3df3097 |
Refactor splitDirectories
Currently, the majority of the tests require the framework that's bundled with the GHC repository, which makes testing directory independently rather difficult. All such tests are located under
tests
.@snoyberg has recently started a stub for tests that can be run under Cabal without the GHC test framework. It could use some love right now.
From here, there are two options I can think of:
I think Option A is more elegant and less difficult than Option B, since in B one would have to embed/install a minimal GHC framework (somehow).
What might be lost in Option A is the fine-grainedness of the tests: from GHC's perspective it will probably be an "all-or-nothing" test.
Questions:
The text was updated successfully, but these errors were encountered: