Opened 3 weeks ago

Closed 3 weeks ago

#1745 closed defect (fixed)

Problem with vim tests in LFS

Reported by: bdubbs Owned by: Pierre Labastie
Priority: normal Milestone:
Component: jhalfs Version: GIT
Severity: normal Keywords:
Cc:

Description

What we have in LFS when we test vim is

su tester -c "TERM=xterm-256color LANG=en_US.UTF-8 make -j1 test" \
   &> vim-test.log

jhalfs is translating this to:

#su tester -c "TERM=xterm-256color LANG=en_US.UTF-8 make -k -j1 test" \ >> $TEST_LOG 2>&1 || true
#   &> vim-test.log >> $TEST_LOG 2>&1 || true

When I run jhalfs, I do not select "Run testsuites", but remove the hashes from the scriptlets where I do want to run tests.

It looks like that second line is wrong primarily because the book's backslash-newline is converted to backslash-space.

The problem I had is that the tests hang with "Press ENTER or type command to continue" but there is no way to do that without just killing the tests.

I'll do another build to test, but I suspect that 2nd line in the scriptlet is just unneeded when testing in jhalfs.

Change History (7)

comment:1 by Pierre Labastie, 3 weeks ago

Owner: changed from alfs-log@… to Pierre Labastie
Status: newaccepted

Thanks for report, will look at this. While removing hashes, you can of course edit those lines, but the problem is that the same lines are generated when tests are enabled.

comment:2 by Pierre Labastie, 3 weeks ago

Normally, an ending backslash is tested and then nothing is added to the line, but because of an error in logic, the test was not done for lines containing "make".

Also if a line already contains '>>', nothing is added either. I've added the case of '&>'. Problem is that in those cases the logs are not conserved... I suppose we should do something like "tail -n x <logfile>" so that at least the lines containing test summary are conserved.

Of course another possibility is to replace the log file with $TEST_LOG in the scriptlet... But this would be specific to vim.

Now for the problem of input needed during test, I think we should use yes "" | if the test output is redirected, because there is no way to know why the test stops in this case.

comment:3 by bdubbs, 3 weeks ago

I think adding 'yes "" |' to the line is a good idea. We may want to add this to the book too.

This issue seems to be highly specific to vim in LFS. The reason we redirect is because the vim output during tests can corrupt the user's terminal. That's not good in the chroot environment. I like the idea of jhalfs not modifying the line in the book but adding an instruction to copy vim-test.log to $TEST_LOG.

I don't recall why we don't do the test redirection when building vim in BLFS. I think it may be because the user has more options if the virtual terminal gets corrupted.

In a related matter, we have the test line in LFS split into two physical lines. Looking at the rendered book, that does not seem to be needed. Would it help to reformat that command to be on one physical line?

comment:4 by Pierre Labastie, 3 weeks ago

Well I think it's not the job of jhalfs to add "yes something"... My suggestion was for LFS :)

There are two possibilities with vim-test.log: replace it with $TEST_LOG directly in the scriptlet or adding a line to copy it to $TEST_LOG. I'd rather use the first possibility. Note that "|| true" should be added at the end, otherwise jhalfs would exit if an error occurs in tests.

About BLFS: I remember I add some problems with a needed user input during tests a while ago. But IIRC, it had something to do with configuration files...

Ah yes, we still have a note:

If the global configuration file <filename>/etc/vimrc</filename>
references the <envar>VIMRUNTIME</envar> environment variable, some
tests may complain about being unable to find the corresponding
directory and wait for user input. If this is the case, this file
should be saved and removed before running the tests.  Or if
<xref linkend='bubblewrap'/> is installed, it's also possible to
create a lightweight container environment where this file is hidden
and run the tests in the container.

in reply to:  3 ; comment:5 by xry111, 3 weeks ago

Replying to bdubbs:

In a related matter, we have the test line in LFS split into two physical lines. Looking at the rendered book, that does not seem to be needed. Would it help to reformat that command to be on one physical line?

That line would exceed 80 characters, and we generally don't like such a long line.

Maybe we can change "en_US.UTF-8" to "C.UTF-8" to fit it in 80 characters.

in reply to:  5 comment:6 by Pierre Labastie, 3 weeks ago

Replying to xry111:

Replying to bdubbs:

In a related matter, we have the test line in LFS split into two physical lines. Looking at the rendered book, that does not seem to be needed. Would it help to reformat that command to be on one physical line?

That line would exceed 80 characters, and we generally don't like such a long line.

Maybe we can change "en_US.UTF-8" to "C.UTF-8" to fit it in 80 characters.

In any case, now jhalfs is ok with it...

comment:7 by Pierre Labastie, 3 weeks ago

Resolution: fixed
Status: acceptedclosed

Fixed at a4a8cc8. The "yes ..." part is left to LFS editors, but I suspect Bruce tried to (re)run the tests after creating /etc/vimrc.

Note: See TracTickets for help on using tickets.