|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN PATCH] automation: Rework "build-each-commit-gcc" test
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@xxxxxxxxxx>
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |