Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Request: Some way of logging that tests build but don't pass #430

Closed
JulianBirch opened this issue Jun 26, 2015 · 11 comments
Closed

Request: Some way of logging that tests build but don't pass #430

JulianBirch opened this issue Jun 26, 2015 · 11 comments
Milestone

Comments

@JulianBirch
Copy link
Contributor

I'd like to be able to "auto commit" anything where the tests build, but log a different message depending on whether the tests pass. I don't think this is currently possible. stack test --no-test or similar would solve the problem, as would a more general system where you could insert commands into the process.

Apologies if this is a solved problem that I can't figure out.

@snoyberg
Copy link
Contributor

It's not solved yet, and should be pretty trivial to implement. Want to give a shot at a PR? The relevant code is the singleTest function in Stack.Build.Execute, and you'll likely want to add a field to BuildOpts (or perhaps add a field to the DoTests constructor of FinalAction).

@snoyberg snoyberg added this to the 0.2.0.0 milestone Jun 27, 2015
@JulianBirch
Copy link
Contributor Author

Thanks I'll give it a go. (I'm a rank beginner, so this may take me a while.)

@snoyberg
Copy link
Contributor

Hit us up with questions, happy to help

On Sun, Jun 28, 2015, 12:26 AM Julian Birch notifications@github.com
wrote:

Thanks I'll give it a go. (I'm a rank beginner, so this may take me a
while.)


Reply to this email directly or view it on GitHub
#430 (comment)
.

@JulianBirch
Copy link
Contributor Author

Okay, I really can't figure this bit out: after adding something to BuildOpts, where do I register the command line flag and command line documentation? I'm finding it pretty hard to find anything that actually creates one except from Upgrade.hs.

@snoyberg
Copy link
Contributor

@JulianBirch Just make the change and try to compile, GHC should help you here. The relevant location is src/main/Main.hs, the buildOpts parser.

@JulianBirch
Copy link
Contributor Author

Thanks, I should have thought of that. I've also learned about strict fields. :)

@snoyberg
Copy link
Contributor

snoyberg commented Jul 7, 2015

Pull request sent and merged, thanks!

@snoyberg snoyberg closed this as completed Jul 7, 2015
@Blaisorblade
Copy link
Collaborator

Sorry if I ask, but why is building tests only reachable through test (creating the weird test --no-tests or test --no-run-tests) rather than build --test?

@snoyberg
Copy link
Contributor

Not sure if I parsed your comment correctly, but I think that's exactly how stack behaves today. Perhaps toy can clarify with a command line that's not doing what you expected?

@Blaisorblade
Copy link
Collaborator

I think cabal test --no-run-tests shouldn't exist (but it does exist on 0.1.3.1), but apparently the interface changed further, and there's (also) a more sensible interface.

@snoyberg
Copy link
Contributor

I actually use that command line occasionally.

On Wed, Aug 19, 2015, 4:44 PM Paolo G. Giarrusso notifications@github.com
wrote:

I think cabal test --no-run-tests shouldn't exist (but it does exist on
0.1.3.1), but apparently the interface changed further, and there's (also)
a more sensible interface.


Reply to this email directly or view it on GitHub
#430 (comment)
.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants