travis-ci / travis-ci

Free continuous integration platform for GitHub projects.

Home Page:https://travis-ci.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linux builds don't respect log folding messages

agc93 opened this issue · comments

Injecting code folding messages using the following format:

travis_fold:end:name

works on OS X/macOS builds, but does not work for Linux builds. For example, this build includes the exact same build (with the exact same log output) on both and while log-based folding works correctly on the macOS build (starts on line 229), it doesn't appear to function at all for the Linux build (should start on line 1184, but doesn't).

The service/command messages do not appear in the Linux build's log output so they are clearly being identified/detected by Travis, just the folding is not kicking in.

Note that this only applies to the in-build messages. The environment setup/installer folding is working correctly for both.

@agc93 Your Linux build https://api.travis-ci.org/jobs/197297726/log.txt does not have any marker that Mac one does https://api.travis-ci.org/jobs/197297727/log.txt. (Search for travis_fold: and compare what you see.)

@devlead Yours looks the same.

I'm guessing that these compiled binary files Cake.TravisCI.Module.* are responsible for marking your logs. Where did you get them? Do you know if the folding works for Linux?

@BanzaiMan I'm not using that module, but we're both using Cake build scripts, I'll  try to add some more debug output. Strange thing is that it has worked, it's the same build script for Mac & Linux.  By looking at code , the current theory would be not identifying that it's running under Travis, but that's just checking that the environment variable TRAVIS isn't empty. So one cause could be that Travis isn't delivering that variable?
But I'll add some more logging to a fork to see what's present and not.

TRAVIS is always set to true on our builds. This has not changed at least in the last 3 years. Try dumping it with echo $TRAVIS.

@BanzaiMan I've just run the exact same script locally on a Fedora 25 machine after setting TRAVIS to 1 and I can see the messages being output: https://gist.github.com/agc93/398c9b8701b338f9f8bd58a8ce040405


Anyone can replicate the messages by cloning the repo, setting a non-empty value to TRAVIS and running build.sh (don't worry, doesn't do anything).

Tracvis does get identified correctly, see here on Linux

Still waiting for Mac build to start.

The raw log does seem truncated/transformed though some = and > chars not displayed locally, I'll try to tee the log and post it somewhere else.

Interesting tee:ing the log solves the issue,
https://travis-ci.org/devlead/Cake_Git/jobs/197917264#L1108
https://travis-ci.org/devlead/Cake_Git/jobs/197917264#L1447

So it would seem to be an issue that it's likely (as tee strips that info) Travis's having issues with the colorized log on Linux, but it works on Mac.

Looks like the raw log indead is mangled on several places when not tee:ing i.e. comparing
https://api.travis-ci.org/jobs/197911946/log.txt?deansi=true
to
https://api.travis-ci.org/jobs/197917264/log.txt?deansi=true
I spot that something is indeed lost
image

And there's several places like that, which can be spotted in the log.

On Mac same thing works regardless of tee:ing or not.

Did a gist comparing raw unbuffered log with travis raw log
https://gist.github.com/devlead/caa05c1acf2daf83edba5953b1463dd3/revisions#diff-88c4547d54924c2e69e96e3823f1d10eL65
https://gist.github.com/devlead/caa05c1acf2daf83edba5953b1463dd3/revisions#diff-88c4547d54924c2e69e96e3823f1d10eL404

So the service messages are clearly there, although with an escape sequence, but raw log indeed seems filtered.

@BanzaiMan any chance we'll see a fix to support folding regardless of any escape sequences?

@BanzaiMan also would be nice if the raw log wasn't truncated, can be a real wild goose chase troubleshooting if certain details are omitted from the log.

@BanzaiMan Any progress on this one?

Log folding is very useful for long logs but extremely limiting to use in its current state.

Sorry, but we do not have updates to share.

commented

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues