Skip to content

CI: Print warnigns on stderr as well

Peter Leitzen requested to merge pl-fail-on-warnings-stderr into master

What does this MR do and why?

This side steps sync problems in CI trace logs and makes printing consistent.

For example: https://gitlab.com/gitlab-org/gitlab/-/jobs/3525673683.

Refs #386693 (comment 1221407748)

Screenshots or screen recordings

Before After
Screenshot_from_2022-12-27_16-37-42 Screenshot_from_2022-12-27_16-34-48

How to set up and validate locally

  1. Create foo.sh and make it executable with chmod a+x foo.sh:
#!/bin/bash

warn() {
  echo "$*" >&2
}

warn "foo"
warn "Type application/netcdf is already registered as a variant of application/netcdf."
  1. Test via fail_on_warnings ./foo.sh
  2. Silence stdout via fail_on_warnings ./foo.sh >/dev/null
  3. Silence stderr via fail_on_warnings ./foo.sh 2>/dev/null

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports