Github messages for voidlinux
 help / color / mirror / Atom feed
From: Chocimier <Chocimier@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] xbps-src: add make_check=ci-skip
Date: Sat, 24 Apr 2021 18:37:14 +0200	[thread overview]
Message-ID: <20210424163714.WFUbzqkjjk2B8yvJjWC0p7EMkV0w2tqoBTIum2Wrn_g@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-30339@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 641 bytes --]

There is an updated pull request by Chocimier against master on the void-packages repository

https://github.com/Chocimier/void-packages-org ci-skip
https://github.com/void-linux/void-packages/pull/30339

xbps-src: add make_check=ci-skip
For packages with tests failing as root or similar.

`test $XBPS_CHROOT_CMD = ethereal` could be used in practice instead of XBPS_BUILD_ENVIRONMENT, but I like that way more for possibility of configuration local env as ci, and not conflating CI with chroot style.

Some packages are not tested locally yet.

A patch file from https://github.com/void-linux/void-packages/pull/30339.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-skip-30339.patch --]
[-- Type: text/x-diff, Size: 11654 bytes --]

From 0f8f35b2c2b9c5ccd6d7e394ac9707d65fe263d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Tue, 20 Apr 2021 00:05:49 +0200
Subject: [PATCH 1/9] xbps-src: add make_check=ci-skip

---
 Manual.md                                   | 14 +++++++++-----
 common/travis/prepare.sh                    |  1 +
 common/xbps-src/libexec/xbps-src-docheck.sh |  6 ++++++
 etc/defaults.conf                           |  6 ++++++
 xbps-src                                    |  2 +-
 5 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/Manual.md b/Manual.md
index 8c2afbaca71d..3efcfac35494 100644
--- a/Manual.md
+++ b/Manual.md
@@ -176,9 +176,8 @@ can be used to perform other operations before configuring the package.
 - `check` This optional phase checks the result of the `build` phase by running the testsuite provided by the package.
 If the default `do_check` function provided by the build style doesn't do anything, the template should set
 `make_check_target` and/or `make_check_args` appropriately or define its own `do_check` function. If tests take too long
-or can't run in all environments, they should be run only if `XBPS_CHECK_PKGS` is `full`, which means they should either
-be under a `[ "$XBPS_CHECK_PKGS" = full ]` conditional (especially useful with custom `do_check`) or `make_check=extended`
-should be set in the template.
+or can't run in all environments, `make_check` should be set to fitting value or
+`do_check` should be customized to limit testsuite unless `$XBPS_CHECK_PKGS` is `full`.
 
 - `install` This phase installs the `package files` into the package destdir `<masterdir>/destdir/<pkgname>-<version>`,
 via `make install` or any other compatible method.
@@ -606,10 +605,15 @@ patches to the package sources during `do_patch()`. Patches are stored in
 - `disable_parallel_build` If set the package won't be built in parallel
 and `XBPS_MAKEJOBS` has no effect.
 
-- `make_check` Sets the cases in which the `check` phase is run. Can be `yes` (the default) to run if
-`XBPS_CHECK_PKGS` is set, `extended` to run if `XBPS_CHECK_PKGS` is `full` and `no` to never run.
+- `make_check` Sets the cases in which the `check` phase is run.
 This option should usually be accompanied by a comment explaining why it was set, especially when
 set to `no`.
+Allowed values:
+  - `yes` (the default) to run if `XBPS_CHECK_PKGS` is set.
+  - `extended` to run if `XBPS_CHECK_PKGS` is `full`.
+  - `ci-skip` to run locally if `XBPS_CHECK_PKGS` is set, but not as part of pull request checks.
+  - `no` to never run.
+
 
 - `keep_libtool_archives` If enabled the `GNU Libtool` archives won't be removed. By default those
 files are always removed automatically.
diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 1e17be97545b..550fbd7598d0 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -5,6 +5,7 @@
 [ "$XLINT" ] && exit 0
 
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
+echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
 
 /bin/echo -e '\x1b[32mEnabling ethereal chroot-style...\x1b[0m'
diff --git a/common/xbps-src/libexec/xbps-src-docheck.sh b/common/xbps-src/libexec/xbps-src-docheck.sh
index 1cb9f6ab13aa..1e82c1a3739f 100755
--- a/common/xbps-src/libexec/xbps-src-docheck.sh
+++ b/common/xbps-src/libexec/xbps-src-docheck.sh
@@ -43,6 +43,12 @@ if [ "$make_check" = extended -a "$XBPS_CHECK_PKGS" != full ]; then
     exit 0
 fi
 
+if [ "$make_check" = ci-skip ] && [ "$XBPS_BUILD_ENVIRONMENT" = void-packages-ci ]; then
+    msg_warn \
+        "${pkgname}-${version}_${revision}: skipping here because of make_check=ci-skip. Tests should be run locally.\n"
+    exit 0
+fi
+
 for f in $XBPS_COMMONDIR/environment/check/*.sh; do
     source_file "$f"
 done
diff --git a/etc/defaults.conf b/etc/defaults.conf
index 133449a150d6..6147954a18af 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -136,6 +136,12 @@ XBPS_SUCMD="sudo /bin/sh -c"
 #
 #XBPS_USE_BUILD_MTIME=yes
 
+# [OPTIONAL]
+# Enable continuous integration specific mode of operation. Currently this
+# disables do_check for some packages.
+#
+#XBPS_BUILD_ENVIRONMENT=void-packages-ci
+
 # [OPTIONAL]
 # When using the 'ethereal' chroot-style this switch must be activated, it is
 # meant as safeguard against users casually destroying their systems
diff --git a/xbps-src b/xbps-src
index 9d88873ab2c5..c3cd7e5db10b 100755
--- a/xbps-src
+++ b/xbps-src
@@ -635,7 +635,7 @@ export XBPS_SHUTILSDIR XBPS_CROSSPFDIR XBPS_TRIGGERSDIR \
     XBPS_DESTDIR XBPS_MACHINE XBPS_TEMP_MASTERDIR XBPS_BINPKG_EXISTS \
     XBPS_LIBEXECDIR XBPS_DISTDIR XBPS_DISTFILES_MIRROR XBPS_ALLOW_RESTRICTED \
     XBPS_USE_GIT_COMMIT_DATE XBPS_PKG_COMPTYPE XBPS_REPO_COMPTYPE \
-    XBPS_BUILDHELPERDIR XBPS_USE_BUILD_MTIME
+    XBPS_BUILDHELPERDIR XBPS_USE_BUILD_MTIME XBPS_BUILD_ENVIRONMENT
 
 for i in REPOSITORY DESTDIR BUILDDIR SRCDISTDIR; do
     eval val="\$XBPS_$i"

From e95764b1bd2915b21be7c61390efc4d11deb1e14 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Tue, 20 Apr 2021 00:05:50 +0200
Subject: [PATCH 2/9] elogind: enable tests locally

---
 srcpkgs/elogind/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/elogind/template b/srcpkgs/elogind/template
index d4bfe499bc55..a481be29d920 100644
--- a/srcpkgs/elogind/template
+++ b/srcpkgs/elogind/template
@@ -20,7 +20,7 @@ distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
 checksum=dd2fcf22a89a078cad22e633d2f14a4cc9f4a9c8bae25c0e39fc4aec3e273bc9
 conf_files="/etc/elogind/*.conf"
 # tests fail differently due to containerization and kernel features
-make_check=extended
+make_check=ci-skip
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	configure_args+=" -Dutmp=false"

From d9dcdbebaf3e41d066a19a5d2c0fb3a69ebda43c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Tue, 20 Apr 2021 00:05:50 +0200
Subject: [PATCH 3/9] fish-shell: enable tests locally

---
 srcpkgs/fish-shell/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/fish-shell/template b/srcpkgs/fish-shell/template
index 35ce6f0967ea..c7d3076af03a 100644
--- a/srcpkgs/fish-shell/template
+++ b/srcpkgs/fish-shell/template
@@ -16,7 +16,7 @@ distfiles="https://github.com/fish-shell/fish-shell/releases/download/${version}
 checksum=5944da1a8893d11b0828a4fd9136ee174549daffb3d0adfdd8917856fe6b4009
 register_shell="/bin/fish /usr/bin/fish"
 # tests don't work as root
-make_check=extended
+make_check=ci-skip
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"

From 83f34ee0aca6eccdd3806f46b9806aaa2be40680 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Tue, 20 Apr 2021 00:05:50 +0200
Subject: [PATCH 4/9] flac: enable tests locally

---
 srcpkgs/flac/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/flac/template b/srcpkgs/flac/template
index bc126d52029c..8166b9f00655 100644
--- a/srcpkgs/flac/template
+++ b/srcpkgs/flac/template
@@ -15,7 +15,7 @@ distfiles="https://downloads.xiph.org/releases/flac/flac-${version}.tar.xz"
 checksum=213e82bd716c9de6db2f98bcadbc4c24c7e2efe8c75939a1a84e28539c4e1748
 patch_args="-Np1"
 # the tests fail when run as root and as such break in the CI containers
-make_check=extended
+make_check=ci-skip
 
 # TODO: make into options
 case "$XBPS_TARGET_MACHINE" in

From 26bf780288b868c7cd9cccc0382aae65723621fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Tue, 20 Apr 2021 00:05:50 +0200
Subject: [PATCH 5/9] igt-gpu-tools: enable tests locally

---
 srcpkgs/igt-gpu-tools/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/igt-gpu-tools/template b/srcpkgs/igt-gpu-tools/template
index 2588c2ddff5c..3b222ecd18d8 100644
--- a/srcpkgs/igt-gpu-tools/template
+++ b/srcpkgs/igt-gpu-tools/template
@@ -16,7 +16,7 @@ homepage="https://gitlab.freedesktop.org/drm/igt-gpu-tools"
 distfiles="${XORG_SITE}/app/${pkgname}-${version}.tar.xz"
 checksum=40454d8f0484ea2477862007398a08eef78a6c252c4defce1c934548593fdd11
 # tests don't behave in containers
-make_check=extended
+make_check=ci-skip
 
 lib32disabled=yes
 archs="i686* x86_64*"

From a8384e2667d5774a59aa6ea9e2c4c53df09159c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Tue, 20 Apr 2021 00:05:49 +0200
Subject: [PATCH 6/9] inetutils: enable tests locally

---
 srcpkgs/inetutils/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/inetutils/template b/srcpkgs/inetutils/template
index 7918a4641a87..ced4ac1166cd 100644
--- a/srcpkgs/inetutils/template
+++ b/srcpkgs/inetutils/template
@@ -20,8 +20,8 @@ subpackages="inetutils-dnsdomainname inetutils-ftp inetutils-hostname
 
 CFLAGS="-fcommon"
 
-# tests can't run in CI
-make_check=extended
+# hostname test can't run in CI
+make_check=ci-skip
 
 case "$XBPS_TARGET_MACHINE" in
 *-musl)

From 7642320cd13bbe3cc0cee55ffea09be364de5f33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Tue, 20 Apr 2021 00:05:50 +0200
Subject: [PATCH 7/9] libgusb: enable tests locally

---
 srcpkgs/libgusb/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libgusb/template b/srcpkgs/libgusb/template
index e26b6ccf96d3..a7cc76a8c8b1 100644
--- a/srcpkgs/libgusb/template
+++ b/srcpkgs/libgusb/template
@@ -17,7 +17,7 @@ changelog="https://raw.githubusercontent.com/hughsie/libgusb/master/NEWS"
 distfiles="http://people.freedesktop.org/~hughsient/releases/${pkgname}-${version}.tar.xz"
 checksum=13277948a2ee06861234938089aea21bce6ad862f14c81a2efa85340ed701efd
 # requires access to USB devices, not available on CI
-make_check=extended
+make_check=ci-skip
 
 build_options="gir vala"
 build_options_default="gir vala"

From 68132916059c5f37fd1a494a9aa4b60716f0302a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Tue, 20 Apr 2021 00:05:50 +0200
Subject: [PATCH 8/9] openvpn: enable tests locally

---
 srcpkgs/openvpn/template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/openvpn/template b/srcpkgs/openvpn/template
index 31a9679a33f1..d521cf4c4061 100644
--- a/srcpkgs/openvpn/template
+++ b/srcpkgs/openvpn/template
@@ -21,8 +21,7 @@ desc_option_mbedtls="Build with mbedtls support"
 desc_option_pkcs11="Enable support for PKCS#11"
 vopt_conflict mbedtls pkcs11
 
-# tests can't run in CI
-make_check=extended
+make_check=ci-skip
 
 post_install() {
 	vmkdir usr/share/examples/${pkgname}

From e40cb499454d8d3262bdb037131dfd16bba16623 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Tue, 20 Apr 2021 00:05:50 +0200
Subject: [PATCH 9/9] postgresql: enable tests locally

---
 srcpkgs/postgresql/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/postgresql/template b/srcpkgs/postgresql/template
index 25f7e62bd8da..fcbf3e2a67c4 100644
--- a/srcpkgs/postgresql/template
+++ b/srcpkgs/postgresql/template
@@ -21,7 +21,7 @@ changelog="https://www.postgresql.org/docs/current/release-${version//./-}.html"
 distfiles="https://ftp.postgresql.org/pub/source/v${version}/${pkgname}-${version}.tar.bz2"
 checksum=930feaef28885c97ec40c26ab6221903751eeb625de92b22602706d7d47d1634
 # initdb fails on github actions, works locally with xbps-uunshare
-make_check=extended
+make_check=ci-skip
 
 conf_files="
 	/etc/default/${pkgname}

  parent reply	other threads:[~2021-04-24 16:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19 22:15 [PR PATCH] " Chocimier
2021-04-20  3:39 ` [PR REVIEW] " ericonr
2021-04-20  3:39 ` ericonr
2021-04-20  3:39 ` ericonr
2021-04-20  3:39 ` ericonr
2021-04-24 16:37 ` Chocimier [this message]
2021-04-24 16:41 ` [PR REVIEW] " Chocimier
2021-04-24 17:15 ` ericonr
2021-04-26 16:48 ` [PR PATCH] [Updated] " Chocimier
2021-04-26 16:49 ` [PR PATCH] [Merged]: " Chocimier

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=20210424163714.WFUbzqkjjk2B8yvJjWC0p7EMkV0w2tqoBTIum2Wrn_g@z \
    --to=chocimier@users.noreply.github.com \
    --cc=ml@inbox.vuxu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).