Skip to content

azure: fix misleading messages printed to stderr being #5392

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

Merged
merged 4 commits into from
Feb 8, 2020

Conversation

pks-t
Copy link
Member

@pks-t pks-t commented Feb 7, 2020

Azure Pipelines will report all messages printed to stderr at the end of a pipeline step, leading to output like below. It's convoluted, hard to read and ultimately completely pointless clutter that points to nonexistent errors. So let's fix all instances that caused prints to stderr without any real (or at least with irrelevant) reason.

Total Test time (real) =   0.05 sec
Cleaning up...
Stopping git daemon...
Stopping SSH...
Done.
Some tests failed.
/home/libgit2/source/azure-pipelines/test.sh: line 317:    26 Terminated              git daemon --listen=localhost --export-all --enable=receive-pack --base-path="${GITDAEMON_DIR}" "${GITDAEMON_DIR}" 2> /dev/null
##[error]useradd: warning: the home directory already exists.
##[error]Not copying any file from skel directory into it.
##[error]  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
##[error]                                 Dload  Upload   Total   Spent    Left  Speed
##[error]
100   609    0   609    0     0   2381      0 --:--:-- --:--:-- --:--:--  2388
##[error]
100 73489  100 73489    0     0   125k      0 --:--:-- --:--:-- --:--:--  383k
##[error]ceived % Xferd  Average Speed   Time    Time     Time  Current
##[error]                                 Dload  Upload   Total   Spent    Left  Speed
##[error]
100   608    0   608    0     0   2491      0 --:--:-- --:--:-- --:--:--  2502
##[error]
100 71645  100 71645    0     0   184k      0 --:--:-- --:--:-- --:--:--  184k
##[error]Errors while running CTest
##[error]Errors while running CTest
##[error]Errors while running CTest
##[error]/home/libgit2/source/azure-pipelines/test.sh: line 317:    26 Terminated              git daemon --listen=localhost --export-all --enable=receive-pack --base-path="${GITDAEMON_DIR}" "${GITDAEMON_DIR}" 2> /dev/null
##[error]/usr/bin/docker failed with return code: 1
Finishing: Test

pks-t added 4 commits February 7, 2020 13:34
When building dependencies for our Docker images, we first download the
sources to disk first, unpack them and finally remove the archive again.
This can be sped up by piping the downloading archive into tar(1)
directly to parallelize both tasks. Furthermore, let's silence curl(1)
to not print to status information to stderr, which tends to be
interpreted as errors by Azure Pipelines.
Without the "--silent" parameter, curl will print a progress meter to
stderr. Azure has the nice feature of interpreting any output to stderr
as errors with a big red warning towards the end of the build. Let's
thus silence curl to not generate any misleading messages.
The Docker entrypoint currently creates the libgit2 user with "useradd
--create-home". As we start the Docker container with two volumes
pointing into "/home/libgit2/", the home directory will already exist.
While useradd(1) copes with this just fine, it will print error messages
to stderr which end up as failures in our Azure pipelines.

Fix this by simply removing the "--create-home" parameter.
In order to properly tear down the test environment, we will kill
git-daemon(1) if we've exercised it. As git-daemon(1) is spawned as a
background process, it is still owned by the shell and thus killing it
later on will print a termination message to the shell's stderr, causing
Azure to report it as an error.

Fix this by disowning the background process.
@ethomson ethomson merged commit ee3307a into libgit2:master Feb 8, 2020
@pks-t pks-t deleted the pks/ci-warnings branch February 9, 2020 12:42
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.

2 participants