All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH] automation: Rework "build-each-commit-gcc" test
Date: Mon, 26 Feb 2024 10:23:37 +0100	[thread overview]
Message-ID: <e48c4fce-e7f3-4bce-bf7b-2cfcc0659426@suse.com> (raw)
In-Reply-To: <20240220140733.40980-1-anthony.perard@citrix.com>

On 20.02.2024 15:07, Anthony PERARD wrote:
> Current issues with this test are:
> - when the job timeout, the log file is lost as there is no chance to
>   run the `mv` command.
> - GitLab job log is limited in size, so one usually have to download
>   the artifacts, which may be missing.
> 
> Use $GITLAB_CI to detect when the script is run as part of a GitLab
> pipeline. GitLab will add "GITLAB_CI=true" in the environment
> variables.
> 
> When run as part of $GITLAB_CI, ignore "dirty" worktree to allow to
> write "build-each-commit-gcc.log", which can then be grabbed as
> artifacts, even when the job timeout. The `git clean` command is
> changed to keep those build logs.
> 
> When run as part of $GITLAB_CI, we will also store the build output in
> a log file instead of writing it to stdout, because GitLab's job log
> is limited. But we will write the log to stdout in case of error, so
> we can find out more quickly why there's been an error.
> 
> This patch also make use of a GitLab feature, "log sections", which we
> will collapse by default. One section per commit been built.
> 
> There's a bit of colour added to the logs.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

I was trying to commit this, but ...

> --- a/automation/scripts/build-test.sh
> +++ b/automation/scripts/build-test.sh
> @@ -9,6 +9,37 @@
>  # Set NON_SYMBOLIC_REF=1 if you want to use this script in detached HEAD state.
>  # This is currently used by automated test system.
>  
> +# Colors with ANSI escape sequences
> +txt_info='^[[32m'
> +txt_err='^[[31m'
> +txt_clr='^[[0m'
> +
> +# $GITLAB_CI should be "true" or "false".
> +if [ "$GITLAB_CI" != true ]; then
> +    GITLAB_CI=false
> +fi
> +
> +gitlab_log_section() {
> +    if $GITLAB_CI; then
> +        echo -n "^[[0Ksection_$1:$(date +%s):$2
> ^[[0K"

... there was either corruption on transmit here, or there's an embedded
newline that I don't know how to deal with.

Jan


  parent reply	other threads:[~2024-02-26  9:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20 14:07 [XEN PATCH] automation: Rework "build-each-commit-gcc" test Anthony PERARD
2024-02-23  0:57 ` Stefano Stabellini
2024-02-26  9:23 ` Jan Beulich [this message]
2024-02-26 14:49   ` Anthony PERARD
2024-02-26 15:10     ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e48c4fce-e7f3-4bce-bf7b-2cfcc0659426@suse.com \
    --to=jbeulich@suse.com \
    --cc=anthony.perard@citrix.com \
    --cc=cardoe@cardoe.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.