-
Notifications
You must be signed in to change notification settings - Fork 710
Migrate integration tests to shell based format, fixed travis #2868
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
Conversation
I'm 99% percent sure it won't run on Windows, I believe a previous iteration did this exact thing. @phadej Thanks for the fixes. I'll rework the "/bin/bash" one (see comment there) and see if I can improve on the "extra-source-files" bit sometime during the next week or so (again, see comment there). |
For extra-source-files, IIRC recent enough |
And if someone wants to test on windows (now or later): https://dev.modern.ie/tools/vms is handy (minghc works nice too). |
And last comments:
this LGTM otherwise. The I need this PR in to get going with parsec parser (there is something weird happening in my branch, and this version of integration tests is much much more nicer to debug 👍). |
Yeah, I agree that the glob vs. extra-sources thing isn't a show-stopper, it can be fixed in a diferent PR. (I'll create the issue after this PR lands. If I forget, please somebody remind me.) I'm not sure what to make of #2711, but given that it's a previously existing issue and I don't think this necessarily changes anything much about a possible resolution, I think we should just punt on fixing #2711 with this PR -- and get this merged ASAP so everybody else who wants to use EasyTests(TM) becomes unblocked. I'll go squash into a series of meaningful commits which build individually a little later tonight (or tomorrow). At least, I think it would be best to have that, I don't know if there's a project policy for this in Cabal/cabal-install land? @phadej : I'm not sure if I can preserve authorship of all your patches if we want each individual commit to build -- do you mind if I just pull the "source" -> "." and "extra-sources" ones into the main commit here? (I think the Windows-compat bits can be separate, but if you don't mind I'd also be happy to just pull them in.) |
Globs of form |
Re: the glob thing. I think the only downside here that it's yet-another-surprise for when building on travis suddenly fails rather inexplicably, but perhaps we should just have a FAQ-type thing? (Or maybe a "checklist-before-creating-a-PR"?). Obviously, it would be ideal to just have an "extra-source-dir" or full recursive glob support, but until then this really only affects the PR phase of development. During normal running-of-tests, it's completely irrelevant. |
@@ -0,0 +1,276 @@ | |||
-- | Groups black-box tests of cabal-install and configures them to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the tasty-golden
package can be used to simplify code in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did check out tasty-golden
, but it doesn't really seem to get us much since all the traversal stuff it pretty specialized anyway. Did you have something particular in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, it just looked like tasty-golden
does something similar. I haven't read the code closely.
@BardurArantsson, I'm not particularly attached to those commits, thet are quite mechanical anyway. Actually I'll just squash everything myself. |
This is required for the reworking of integration tests to use shell scripts.
Fixes haskell#2797 Squashed commits: - Use ., not source
122c330
to
1919061
Compare
- findExecutable sh - Use single quotes for cabal exec
@phadej Great, thanks. AFAICT this is good to go from my perspective. |
@@ -0,0 +1,6 @@ | |||
. ../common.sh | |||
|
|||
# We should probably be using a .err file and should_fail, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One possible future solution for these kinds of problems is to add support for platform-specific .err
files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we could add support for matching against a set of regexes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also see how LLVM solves this: http://llvm.org/docs/CommandGuide/FileCheck.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I considered line-by-line regex comparison instead, but it's a bit noisy if you have to escape all the lines containing special characters (and where you don't want special treatment). FileCheck looks somewhat similar to that, but I think it's probably overkill for what we want.
Maybe we could add something simple here like line-based comparison, but with
RE:this is a regex
this is not
i.e. just using the a RE: prefix to designate regexes. (It's ulikely enough to appear in actual output that it wouldn't need to be "escapable".)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RE:
prefix idea sounds good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll create an issue to add it and assign it to myself. (No guarantees on when I'll get 'round to it, though.)
OK, I think this is good to go. @phadej @BardurArantsson Thanks for your contributions! |
Migrate integration tests to shell based format, fixed travis
Improves on #2864