Re: meson: Make test output much more useful on failure (both in CI and locally) - Mailing list pgsql-hackers

From Christoph Berg
Subject Re: meson: Make test output much more useful on failure (both in CI and locally)
Date
Msg-id ahXyVYd6RYJIYbTu@msg.df7cb.de
Whole thread
In response to Re: meson: Make test output much more useful on failure (both in CI and locally)  ("Jelte Fennema-Nio" <postgres@jeltef.nl>)
List pgsql-hackers
Re: Jelte Fennema-Nio
> 5. Reduce the default diff truncation limit to 50.

Could we also get a "show everything" mode, perhaps based on an env var?

Debian's build and test machinery doesn't provide means to get at
files from the build/test run, so all evidence needs to be in the
build log. The debian/rules file for the PG server currently has this
contraption:

override_dh_auto_test-arch:
ifeq (, $(findstring nocheck, $(DEB_BUILD_OPTIONS)))
    # when tests fail, print newest log files
    # initdb doesn't like LANG and LC_ALL to contradict, unset LANG and LC_CTYPE here
    # temp-install wants to be invoked from a top-level make, unset MAKELEVEL here
    # tell pg_upgrade to create its sockets in /tmp to avoid too long paths
    unset LANG LC_CTYPE MAKELEVEL; ulimit -c unlimited; \
    if ! make -C build check-world \
      PGSOCKETDIR="/tmp" \
      PG_TEST_EXTRA='ssl' \
      PROVE_FLAGS="--verbose"; \
    then \
        for l in `find build -name 'regression.*' -o -name '*.log' -o -name '*_log_*' | perl -we 'print map { "$$_\n";
}sort { (stat $$a)[9] <=> (stat $$b)[9] } map { chomp; $$_; } <>' | tail -n 10`; do \
 
        echo "******** $$l ********"; \
        cat $$l; \
        done; \
        for c in `find build -name 'core*'`; do \
            echo "******** $$c ********"; \
            gdb -batch -ex 'bt full' build/tmp_install/usr/lib/postgresql/$(MAJOR_VER)/bin/postgres $$c || :; \
        done; \
        $(TEST_FAIL_COMMAND); \
    fi
ifeq ($(WITH_PG_BSD_INDENT),y)
    $(MAKE) -C build/src/tools/pg_bsd_indent test DESTDIR=$(CURDIR)/debian/tmp
endif
endif

The part with the TAP output files is ugly, and the "sort files by
mtime and show the 10 newest ones" even more so. I would welcome
anything that allowed me to simplify this.

Thanks,
Christoph



pgsql-hackers by date:

Previous
From: Adam Brusselback
Date:
Subject: Re: [Patch] Add WHERE clause support to REFRESH MATERIALIZED VIEW
Next
From: Nathan Bossart
Date:
Subject: Re: expand refint docs with usage info