You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by Atle Tokle <at...@gmail.com> on 2018/03/11 08:32:55 UTC

Building log4j2 from console supporting ANSI colors fails

I tried to build from GIT bash on windows 10, and first test that failed
was

testSynopsisOrderCorrectWhenParametersDeclaredOutOfOrder in

org.apache.logging.log4j.core.tools.picocli.

CommandLineHelpTest:2008


It seems like the expected result

format("<main class> <param0> <param1>%n") on line 2014 always assumes
that no ANSI color codes is output, while the actual results have ANSI
codes.

I looked into the code, and saw that one of the things that was check
was if TERM environment variable started with xterm, and did a test
where I first did

export TERM=zzzzz

and did then build it again. Now without faults.

The test should have more control on what environment it is running
on. It is several other tests in the same testclass that fails because
of same issue.


I guess this is the same fault that Gary Gregory experienced here
https://www.mail-archive.com/dev@logging.apache.org/msg05223.html

in message from Nov 19, 2017, at 6:32 PM


Best regards

Atle

Re: Building log4j2 from console supporting ANSI colors fails

Posted by Remko Popma <re...@gmail.com>.
These tests have been removed.

On Wed, Mar 21, 2018 at 7:39 PM, Remko Popma <re...@gmail.com> wrote:

> We will probably just remove these tests; there is no need to bring the
> picocli tests in to the Log4j2 project.
>
> On Wed, Mar 21, 2018 at 3:20 PM, Atle Tokle <at...@gmail.com> wrote:
>
>> I made a fresh clone from master today, and looked into it myself.
>> In CommandLineHelpTest.java all the tests that is failing is instanciating
>> a Help class. In all cases it have an alternative constructor where you
>> can
>> specify Help.Ansi.OFF to avoid that the test depends on the console it run
>> from.
>>
>> CommandLineTest did also have 3 faults, and here it is CommandLine.run()
>> that needs Help.Ansi.OFF as it's third argument. I can send you patch if
>> you tell me how you want it.
>>
>> Atle
>>
>>
>> Den søn. 11. mar. 2018 kl. 11:04 skrev Remko Popma <remko.popma@gmail.com
>> >:
>>
>> > Thanks for reporting this. I’ll take a look.
>> >
>> > Remko
>> >
>> > > On Mar 11, 2018, at 17:32, Atle Tokle <at...@gmail.com> wrote:
>> > >
>> > > I tried to build from GIT bash on windows 10, and first test that
>> failed
>> > > was
>> > >
>> > > testSynopsisOrderCorrectWhenParametersDeclaredOutOfOrder in
>> > >
>> > > org.apache.logging.log4j.core.tools.picocli.
>> > >
>> > > CommandLineHelpTest:2008
>> > >
>> > >
>> > > It seems like the expected result
>> > >
>> > > format("<main class> <param0> <param1>%n") on line 2014 always assumes
>> > > that no ANSI color codes is output, while the actual results have ANSI
>> > > codes.
>> > >
>> > > I looked into the code, and saw that one of the things that was check
>> > > was if TERM environment variable started with xterm, and did a test
>> > > where I first did
>> > >
>> > > export TERM=zzzzz
>> > >
>> > > and did then build it again. Now without faults.
>> > >
>> > > The test should have more control on what environment it is running
>> > > on. It is several other tests in the same testclass that fails because
>> > > of same issue.
>> > >
>> > >
>> > > I guess this is the same fault that Gary Gregory experienced here
>> > > https://www.mail-archive.com/dev@logging.apache.org/msg05223.html
>> > >
>> > > in message from Nov 19, 2017, at 6:32 PM
>> > >
>> > >
>> > > Best regards
>> > >
>> > > Atle
>> >
>>
>
>

Re: Building log4j2 from console supporting ANSI colors fails

Posted by Remko Popma <re...@gmail.com>.
We will probably just remove these tests; there is no need to bring the
picocli tests in to the Log4j2 project.

On Wed, Mar 21, 2018 at 3:20 PM, Atle Tokle <at...@gmail.com> wrote:

> I made a fresh clone from master today, and looked into it myself.
> In CommandLineHelpTest.java all the tests that is failing is instanciating
> a Help class. In all cases it have an alternative constructor where you can
> specify Help.Ansi.OFF to avoid that the test depends on the console it run
> from.
>
> CommandLineTest did also have 3 faults, and here it is CommandLine.run()
> that needs Help.Ansi.OFF as it's third argument. I can send you patch if
> you tell me how you want it.
>
> Atle
>
>
> Den søn. 11. mar. 2018 kl. 11:04 skrev Remko Popma <remko.popma@gmail.com
> >:
>
> > Thanks for reporting this. I’ll take a look.
> >
> > Remko
> >
> > > On Mar 11, 2018, at 17:32, Atle Tokle <at...@gmail.com> wrote:
> > >
> > > I tried to build from GIT bash on windows 10, and first test that
> failed
> > > was
> > >
> > > testSynopsisOrderCorrectWhenParametersDeclaredOutOfOrder in
> > >
> > > org.apache.logging.log4j.core.tools.picocli.
> > >
> > > CommandLineHelpTest:2008
> > >
> > >
> > > It seems like the expected result
> > >
> > > format("<main class> <param0> <param1>%n") on line 2014 always assumes
> > > that no ANSI color codes is output, while the actual results have ANSI
> > > codes.
> > >
> > > I looked into the code, and saw that one of the things that was check
> > > was if TERM environment variable started with xterm, and did a test
> > > where I first did
> > >
> > > export TERM=zzzzz
> > >
> > > and did then build it again. Now without faults.
> > >
> > > The test should have more control on what environment it is running
> > > on. It is several other tests in the same testclass that fails because
> > > of same issue.
> > >
> > >
> > > I guess this is the same fault that Gary Gregory experienced here
> > > https://www.mail-archive.com/dev@logging.apache.org/msg05223.html
> > >
> > > in message from Nov 19, 2017, at 6:32 PM
> > >
> > >
> > > Best regards
> > >
> > > Atle
> >
>

Re: Building log4j2 from console supporting ANSI colors fails

Posted by Remko Popma <re...@gmail.com>.
Sorry it took me so long to get around to it. 



> On Mar 21, 2018, at 20:59, Apache <ra...@dslextreme.com> wrote:
> 
> Obviously I didn’t see Remko’s reply before sending mine.
> 
> Ralph
> 
>> On Mar 21, 2018, at 4:57 AM, Apache <ra...@dslextreme.com> wrote:
>> 
>> Please do. Thanks!
>> 
>> Ralph
>> 
>>> On Mar 20, 2018, at 11:20 PM, Atle Tokle <at...@gmail.com> wrote:
>>> 
>>> I made a fresh clone from master today, and looked into it myself.
>>> In CommandLineHelpTest.java all the tests that is failing is instanciating
>>> a Help class. In all cases it have an alternative constructor where you can
>>> specify Help.Ansi.OFF to avoid that the test depends on the console it run
>>> from.
>>> 
>>> CommandLineTest did also have 3 faults, and here it is CommandLine.run()
>>> that needs Help.Ansi.OFF as it's third argument. I can send you patch if
>>> you tell me how you want it.
>>> 
>>> Atle
>>> 
>>> 
>>>> Den søn. 11. mar. 2018 kl. 11:04 skrev Remko Popma <re...@gmail.com>:
>>>> 
>>>> Thanks for reporting this. I’ll take a look.
>>>> 
>>>> Remko
>>>> 
>>>>> On Mar 11, 2018, at 17:32, Atle Tokle <at...@gmail.com> wrote:
>>>>> 
>>>>> I tried to build from GIT bash on windows 10, and first test that failed
>>>>> was
>>>>> 
>>>>> testSynopsisOrderCorrectWhenParametersDeclaredOutOfOrder in
>>>>> 
>>>>> org.apache.logging.log4j.core.tools.picocli.
>>>>> 
>>>>> CommandLineHelpTest:2008
>>>>> 
>>>>> 
>>>>> It seems like the expected result
>>>>> 
>>>>> format("<main class> <param0> <param1>%n") on line 2014 always assumes
>>>>> that no ANSI color codes is output, while the actual results have ANSI
>>>>> codes.
>>>>> 
>>>>> I looked into the code, and saw that one of the things that was check
>>>>> was if TERM environment variable started with xterm, and did a test
>>>>> where I first did
>>>>> 
>>>>> export TERM=zzzzz
>>>>> 
>>>>> and did then build it again. Now without faults.
>>>>> 
>>>>> The test should have more control on what environment it is running
>>>>> on. It is several other tests in the same testclass that fails because
>>>>> of same issue.
>>>>> 
>>>>> 
>>>>> I guess this is the same fault that Gary Gregory experienced here
>>>>> https://www.mail-archive.com/dev@logging.apache.org/msg05223.html
>>>>> 
>>>>> in message from Nov 19, 2017, at 6:32 PM
>>>>> 
>>>>> 
>>>>> Best regards
>>>>> 
>>>>> Atle
>>>> 
>> 
>> 
>> 
> 
> 

Re: Building log4j2 from console supporting ANSI colors fails

Posted by Apache <ra...@dslextreme.com>.
Obviously I didn’t see Remko’s reply before sending mine.

Ralph

> On Mar 21, 2018, at 4:57 AM, Apache <ra...@dslextreme.com> wrote:
> 
> Please do. Thanks!
> 
> Ralph
> 
>> On Mar 20, 2018, at 11:20 PM, Atle Tokle <at...@gmail.com> wrote:
>> 
>> I made a fresh clone from master today, and looked into it myself.
>> In CommandLineHelpTest.java all the tests that is failing is instanciating
>> a Help class. In all cases it have an alternative constructor where you can
>> specify Help.Ansi.OFF to avoid that the test depends on the console it run
>> from.
>> 
>> CommandLineTest did also have 3 faults, and here it is CommandLine.run()
>> that needs Help.Ansi.OFF as it's third argument. I can send you patch if
>> you tell me how you want it.
>> 
>> Atle
>> 
>> 
>>> Den søn. 11. mar. 2018 kl. 11:04 skrev Remko Popma <re...@gmail.com>:
>>> 
>>> Thanks for reporting this. I’ll take a look.
>>> 
>>> Remko
>>> 
>>>> On Mar 11, 2018, at 17:32, Atle Tokle <at...@gmail.com> wrote:
>>>> 
>>>> I tried to build from GIT bash on windows 10, and first test that failed
>>>> was
>>>> 
>>>> testSynopsisOrderCorrectWhenParametersDeclaredOutOfOrder in
>>>> 
>>>> org.apache.logging.log4j.core.tools.picocli.
>>>> 
>>>> CommandLineHelpTest:2008
>>>> 
>>>> 
>>>> It seems like the expected result
>>>> 
>>>> format("<main class> <param0> <param1>%n") on line 2014 always assumes
>>>> that no ANSI color codes is output, while the actual results have ANSI
>>>> codes.
>>>> 
>>>> I looked into the code, and saw that one of the things that was check
>>>> was if TERM environment variable started with xterm, and did a test
>>>> where I first did
>>>> 
>>>> export TERM=zzzzz
>>>> 
>>>> and did then build it again. Now without faults.
>>>> 
>>>> The test should have more control on what environment it is running
>>>> on. It is several other tests in the same testclass that fails because
>>>> of same issue.
>>>> 
>>>> 
>>>> I guess this is the same fault that Gary Gregory experienced here
>>>> https://www.mail-archive.com/dev@logging.apache.org/msg05223.html
>>>> 
>>>> in message from Nov 19, 2017, at 6:32 PM
>>>> 
>>>> 
>>>> Best regards
>>>> 
>>>> Atle
>>> 
> 
> 
> 



Re: Building log4j2 from console supporting ANSI colors fails

Posted by Apache <ra...@dslextreme.com>.
Please do. Thanks!

Ralph

> On Mar 20, 2018, at 11:20 PM, Atle Tokle <at...@gmail.com> wrote:
> 
> I made a fresh clone from master today, and looked into it myself.
> In CommandLineHelpTest.java all the tests that is failing is instanciating
> a Help class. In all cases it have an alternative constructor where you can
> specify Help.Ansi.OFF to avoid that the test depends on the console it run
> from.
> 
> CommandLineTest did also have 3 faults, and here it is CommandLine.run()
> that needs Help.Ansi.OFF as it's third argument. I can send you patch if
> you tell me how you want it.
> 
> Atle
> 
> 
>> Den søn. 11. mar. 2018 kl. 11:04 skrev Remko Popma <re...@gmail.com>:
>> 
>> Thanks for reporting this. I’ll take a look.
>> 
>> Remko
>> 
>>> On Mar 11, 2018, at 17:32, Atle Tokle <at...@gmail.com> wrote:
>>> 
>>> I tried to build from GIT bash on windows 10, and first test that failed
>>> was
>>> 
>>> testSynopsisOrderCorrectWhenParametersDeclaredOutOfOrder in
>>> 
>>> org.apache.logging.log4j.core.tools.picocli.
>>> 
>>> CommandLineHelpTest:2008
>>> 
>>> 
>>> It seems like the expected result
>>> 
>>> format("<main class> <param0> <param1>%n") on line 2014 always assumes
>>> that no ANSI color codes is output, while the actual results have ANSI
>>> codes.
>>> 
>>> I looked into the code, and saw that one of the things that was check
>>> was if TERM environment variable started with xterm, and did a test
>>> where I first did
>>> 
>>> export TERM=zzzzz
>>> 
>>> and did then build it again. Now without faults.
>>> 
>>> The test should have more control on what environment it is running
>>> on. It is several other tests in the same testclass that fails because
>>> of same issue.
>>> 
>>> 
>>> I guess this is the same fault that Gary Gregory experienced here
>>> https://www.mail-archive.com/dev@logging.apache.org/msg05223.html
>>> 
>>> in message from Nov 19, 2017, at 6:32 PM
>>> 
>>> 
>>> Best regards
>>> 
>>> Atle
>> 



Re: Building log4j2 from console supporting ANSI colors fails

Posted by Atle Tokle <at...@gmail.com>.
I made a fresh clone from master today, and looked into it myself.
In CommandLineHelpTest.java all the tests that is failing is instanciating
a Help class. In all cases it have an alternative constructor where you can
specify Help.Ansi.OFF to avoid that the test depends on the console it run
from.

CommandLineTest did also have 3 faults, and here it is CommandLine.run()
that needs Help.Ansi.OFF as it's third argument. I can send you patch if
you tell me how you want it.

Atle


Den søn. 11. mar. 2018 kl. 11:04 skrev Remko Popma <re...@gmail.com>:

> Thanks for reporting this. I’ll take a look.
>
> Remko
>
> > On Mar 11, 2018, at 17:32, Atle Tokle <at...@gmail.com> wrote:
> >
> > I tried to build from GIT bash on windows 10, and first test that failed
> > was
> >
> > testSynopsisOrderCorrectWhenParametersDeclaredOutOfOrder in
> >
> > org.apache.logging.log4j.core.tools.picocli.
> >
> > CommandLineHelpTest:2008
> >
> >
> > It seems like the expected result
> >
> > format("<main class> <param0> <param1>%n") on line 2014 always assumes
> > that no ANSI color codes is output, while the actual results have ANSI
> > codes.
> >
> > I looked into the code, and saw that one of the things that was check
> > was if TERM environment variable started with xterm, and did a test
> > where I first did
> >
> > export TERM=zzzzz
> >
> > and did then build it again. Now without faults.
> >
> > The test should have more control on what environment it is running
> > on. It is several other tests in the same testclass that fails because
> > of same issue.
> >
> >
> > I guess this is the same fault that Gary Gregory experienced here
> > https://www.mail-archive.com/dev@logging.apache.org/msg05223.html
> >
> > in message from Nov 19, 2017, at 6:32 PM
> >
> >
> > Best regards
> >
> > Atle
>

Re: Building log4j2 from console supporting ANSI colors fails

Posted by Remko Popma <re...@gmail.com>.
Thanks for reporting this. I’ll take a look. 

Remko 

> On Mar 11, 2018, at 17:32, Atle Tokle <at...@gmail.com> wrote:
> 
> I tried to build from GIT bash on windows 10, and first test that failed
> was
> 
> testSynopsisOrderCorrectWhenParametersDeclaredOutOfOrder in
> 
> org.apache.logging.log4j.core.tools.picocli.
> 
> CommandLineHelpTest:2008
> 
> 
> It seems like the expected result
> 
> format("<main class> <param0> <param1>%n") on line 2014 always assumes
> that no ANSI color codes is output, while the actual results have ANSI
> codes.
> 
> I looked into the code, and saw that one of the things that was check
> was if TERM environment variable started with xterm, and did a test
> where I first did
> 
> export TERM=zzzzz
> 
> and did then build it again. Now without faults.
> 
> The test should have more control on what environment it is running
> on. It is several other tests in the same testclass that fails because
> of same issue.
> 
> 
> I guess this is the same fault that Gary Gregory experienced here
> https://www.mail-archive.com/dev@logging.apache.org/msg05223.html
> 
> in message from Nov 19, 2017, at 6:32 PM
> 
> 
> Best regards
> 
> Atle