-
Notifications
You must be signed in to change notification settings - Fork 429
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
Tests fail under Cygwin/ConEmu due to ANSI in output #1103
Comments
I should mention that
|
Tests may want to verify that none of these color options are set before running, or the tests become unrepeatable. |
Thank you for raising this! @Rule
public final TestRule restoreSystemProperties = new RestoreSystemProperties();
@Rule
public final ProvideSystemProperty ansiOFF = new ProvideSystemProperty("picocli.ansi", "false"); This should make the tests much more reproducible in various environments. Does the same problem still occur with the latest from master? |
It seems much better now as it is down to only two failures:
Are we sure this test was passing? It seems to look for text
but the text in
|
Yes, these tests pass on Windows and on Linux at least. The test does not look for the exact text generated by I am not sure what the exact mismatch is between the expected and actual text on Cygwin. Does the prefix not match (so the actual trace text contains "ANSI is enabled by default")? Can you post details about the diff? |
It correctly contains everything up to I already gave the error above:
The prefix matches. It is the suffix that causes the problem. It looks like Therefore, if any of these environment variables contains a Also, that |
…les contain closing brace ')' characters
Thanks for helping figure out why these tests failed! I've fixed the
That is certainly not the intention. The intention is that the loop will stop when no more replacements were made. (This allows replacing multiple occurrences of |
The way it's currently used, it's OK. It's theoretically possible that it doesn't find the search string, doesn't do the replacement, and just loops forever. I thought it would probably be simpler if you could just use a regex and |
It's not working. Now it ends up with:
Looks like it has now also added |
Ouch! I added a test for About the
No, that is not true. It may go through the loop many times finding the search string, but there is always a final iteration where it goes through that loop without finding the search string (so it is not just theoretically possible, it should always happen by design). Then, when the search string is not found, the |
Yes, everything seems to pass except for these messages:
It's not causing the test to fail. but maybe under Cygwin it shouldn't try this. I am not sure.
I changed something and caused the loop to get stuck, but maybe it was my fault. I no longer have the code, so let's assume it was my fault. |
Thanks for the confirmation! I tried to find the cause of the In an interactive session, when I run the command that picocli uses internally to figure out the terminal windows width ( Perhaps we should avoid calling So there may be no way to check in advance whether |
And thank you again for helping improve the quality of the tests. Much appreciated! |
Same here. It works for me in an interactive session, but not the test. There may be an alternate way. At least under ConEmu, it will set the environment variable |
Interesting! I created #1104 as a follow-up ticket. |
Thanks for your responsiveness. |
This reverts commit 6f932d4.
This reverts commit 6f932d4.
Some of these failures may be related to #581. Many tests fail string comparison under Windows (Cygwin) due to ANSI in output. I assume that the tests are meant to disable ANSI, but it's not working. I didn't quite find where this is in the code.
I can force ANSI off with
Then, only 5 tests fail.
These are due to trying to turn ANSI on and off. There are other tests that fail try to use
stty
. The/dev/tty
device shouldn't be used under Cygwin, I think. It just respondsstty: /dev/tty: No such device or address
.And
fail with
The text was updated successfully, but these errors were encountered: