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

Support local options in consoleOutput #232

Closed
wants to merge 2 commits into from

Conversation

dustin
Copy link

@dustin dustin commented Dec 13, 2018

In particular, this addresses #231 by allowing HideSuccesses to be honored at result reporting time.

@dustin
Copy link
Author

dustin commented Dec 13, 2018

This was a first pass I did last night (before AoC took over). It seemed to do what I wanted quite well.

It might be nice to go further and have only one console output mechanism, but I don't know that I understand all of your use cases.

In particular, this addresses UnkindPartition#231 by allowing HideSuccesses to be
honored at result reporting time.
@dustin
Copy link
Author

dustin commented Dec 13, 2018

I don't understand that appveyor failure, and I haven't figured out how to run your tests properly (I found the built executables and everything passes).

This is redundant since consoleOutput is capable of deciding whether
to hide successes granularly.
@dustin
Copy link
Author

dustin commented Dec 14, 2018

Optionally added a commit to remove consoleOutputHidingSuccesses which is now redundant.

@dustin
Copy link
Author

dustin commented Dec 14, 2018

Removing consoleOutputHidingSuccesses does reveal a bit more complication since the groups don't receive options either, and that stems from core. I'll await guidance.

@@ -71,6 +71,7 @@ data TestOutput
{- test name -} String
{- print test name -} (IO ())
{- print test result -} (Result -> IO ())
{- get test options -} OptionSet
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you align this with the other comments please? :)

printResult r
_ <- if resultSuccessful r && hideSuccesses
then do pure $ Any False
else do printName :: IO (); printResult r :: IO (); return $ Any True
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any True and Any False don't do anything since the result is ignored. This hints at an issue: you are not erasing the empty headings like the original implementation did. Try compiling core-tests/hide-successes-test.hs on master and your branch and compare the output.

streamOutputHidingSuccesses :: (?colors :: Bool) => TestOutput -> StatusMap -> IO ()
streamOutputHidingSuccesses toutput smap =
void . flip evalStateT [] . getApp $
foldTestOutput foldTest foldHeading toutput smap
where
foldTest _name printName getResult printResult =
foldTest _name printName getResult printResult _opts =
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should update this function too; otherwise your new feature will work only in terminals.

@dustin
Copy link
Author

dustin commented Mar 31, 2021

I'm going to go ahead and close this. I don't think it's actually that important as I've found better ways to accomplish my goals.

@dustin dustin closed this Mar 31, 2021
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 this pull request may close these issues.

None yet

2 participants