Github messages for voidlinux
 help / color / mirror / Atom feed
* Re: [PR PATCH] [Updated] [RFC] enable tests in CI
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
  2020-12-02 18:07 ` [PR PATCH] [Updated] [RFC] enable tests in CI ericonr
@ 2020-12-02 18:14 ` ericonr
  2020-12-02 18:20 ` ericonr
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-02 18:14 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From 9fad2c20a36d05efa30e3bebfb62cd7b5fc2696c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:48:53 -0300
Subject: [PATCH 1/3] [temporary] test make's test suite.

---
 srcpkgs/make/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/make/template b/srcpkgs/make/template
index 0aebcbc70be..eecf8233b05 100644
--- a/srcpkgs/make/template
+++ b/srcpkgs/make/template
@@ -1,4 +1,5 @@
 # Template file for 'make'
+# time to test
 pkgname=make
 version=4.3
 revision=3

From 7c06a588b3820738322e4206df9250deb4224aac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 2/3] .github/workflows: run tests on CI for native builds.

Also fix "list contents" step by adding a fetch-xtools step.
---
 .github/workflows/build.yaml | 18 ++++++++++--------
 common/travis/build.sh       |  6 +++++-
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 33186037f8d..6fd7047fe3c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -73,9 +74,10 @@ jobs:
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
+      - run: common/travis/fetch-xtools.sh
       - name: Show files
         run: |
           (
diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..2f16bd740dc 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,6 +6,10 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
+if [ "$3" = 1 ]; then
+	test="-Q"
+fi
+
 PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
 
 NPROCS=1
@@ -16,7 +20,7 @@ fi
 export FTP_RETRIES=10
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From 8939cf7dc4b035037aa0a996e03f1eacdade3ab6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 3/3] common/travis/fetch-xtools: make it work inside void
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..9dfc940c6b5 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+gunzip < "$FILE" | $TAR x -C /tmp/bin --strip-components=1 || exit 1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
  2020-12-02 18:07 ` [PR PATCH] [Updated] [RFC] enable tests in CI ericonr
  2020-12-02 18:14 ` ericonr
@ 2020-12-02 18:20 ` ericonr
  2020-12-02 18:32 ` ericonr
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-02 18:20 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From 9fad2c20a36d05efa30e3bebfb62cd7b5fc2696c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:48:53 -0300
Subject: [PATCH 1/3] [temporary] test make's test suite.

---
 srcpkgs/make/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/make/template b/srcpkgs/make/template
index 0aebcbc70be..eecf8233b05 100644
--- a/srcpkgs/make/template
+++ b/srcpkgs/make/template
@@ -1,4 +1,5 @@
 # Template file for 'make'
+# time to test
 pkgname=make
 version=4.3
 revision=3

From 7c06a588b3820738322e4206df9250deb4224aac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 2/3] .github/workflows: run tests on CI for native builds.

Also fix "list contents" step by adding a fetch-xtools step.
---
 .github/workflows/build.yaml | 18 ++++++++++--------
 common/travis/build.sh       |  6 +++++-
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 33186037f8d..6fd7047fe3c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -73,9 +74,10 @@ jobs:
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
+      - run: common/travis/fetch-xtools.sh
       - name: Show files
         run: |
           (
diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..2f16bd740dc 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,6 +6,10 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
+if [ "$3" = 1 ]; then
+	test="-Q"
+fi
+
 PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
 
 NPROCS=1
@@ -16,7 +20,7 @@ fi
 export FTP_RETRIES=10
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From 00f3bc39341d0d75f1ee95425509287582ace014 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 3/3] common/travis/fetch-xtools: make it work inside void
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..0dd9e6c532c 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (2 preceding siblings ...)
  2020-12-02 18:20 ` ericonr
@ 2020-12-02 18:32 ` ericonr
  2020-12-02 18:38 ` ericonr
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-02 18:32 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From 9fad2c20a36d05efa30e3bebfb62cd7b5fc2696c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:48:53 -0300
Subject: [PATCH 1/6] [temporary] test make's test suite.

---
 srcpkgs/make/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/make/template b/srcpkgs/make/template
index 0aebcbc70be..eecf8233b05 100644
--- a/srcpkgs/make/template
+++ b/srcpkgs/make/template
@@ -1,4 +1,5 @@
 # Template file for 'make'
+# time to test
 pkgname=make
 version=4.3
 revision=3

From 7c06a588b3820738322e4206df9250deb4224aac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 2/6] .github/workflows: run tests on CI for native builds.

Also fix "list contents" step by adding a fetch-xtools step.
---
 .github/workflows/build.yaml | 18 ++++++++++--------
 common/travis/build.sh       |  6 +++++-
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 33186037f8d..6fd7047fe3c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -73,9 +74,10 @@ jobs:
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
+      - run: common/travis/fetch-xtools.sh
       - name: Show files
         run: |
           (
diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..2f16bd740dc 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,6 +6,10 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
+if [ "$3" = 1 ]; then
+	test="-Q"
+fi
+
 PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
 
 NPROCS=1
@@ -16,7 +20,7 @@ fi
 export FTP_RETRIES=10
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From 00f3bc39341d0d75f1ee95425509287582ace014 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 3/6] common/travis/fetch-xtools: make it work inside void
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..0dd9e6c532c 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1

From 83a798bbd46f641d768fb9b0b112e7a484e8399a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:30:48 -0300
Subject: [PATCH 4/6] common/travis/build.sh: don't clean masterdir for native
 builds.

This allows tests to be run in a separate step without rebuilding
everything.
---
 common/travis/build.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/travis/build.sh b/common/travis/build.sh
index 2f16bd740dc..483bcf54755 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,8 +6,9 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
+# keep builddir so tests can be run without rebuilding everything
 if [ "$3" = 1 ]; then
-	test="-Q"
+	test="-C"
 fi
 
 PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))

From a1521920e1f950aaedb6a654f721b2a2a2e50d15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:31:32 -0300
Subject: [PATCH 5/6] common/travis/test.sh: create file.

---
 common/travis/test.sh | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100755 common/travis/test.sh

diff --git a/common/travis/test.sh b/common/travis/test.sh
new file mode 100755
index 00000000000..7df82fde236
--- /dev/null
+++ b/common/travis/test.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# test.sh
+
+if [ "$1" != 1 ]; then
+	exit 0
+fi
+
+PKGS=$(cat /tmp/templates)
+
+NPROCS=1
+if [ -r /proc/cpuinfo ]; then
+        NPROCS=$(grep ^proc /proc/cpuinfo|wc -l)
+fi
+
+export FTP_RETRIES=10
+
+for pkg in ${PKGS}; do
+	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir -Q check "$pkg"
+	[ $? -eq 1 ] && exit 1
+done
+
+exit 0

From 35dca23493b8ef0a4ebe3abd8504ad42d12b35cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:31:57 -0300
Subject: [PATCH 6/6] .github/workflows/build.yaml: run tests in a separate
 step.

---
 .github/workflows/build.yaml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 6fd7047fe3c..79d4368d77c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -77,6 +77,14 @@ jobs:
           "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
+      - name: Check packages
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/test.sh" "$TEST"
+          )
+
       - run: common/travis/fetch-xtools.sh
       - name: Show files
         run: |

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (3 preceding siblings ...)
  2020-12-02 18:32 ` ericonr
@ 2020-12-02 18:38 ` ericonr
  2020-12-02 18:44 ` ericonr
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-02 18:38 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From a8994ec765acb9573f7ee4304b74afa459204a38 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 1/5] common/travis/fetch-xtools: make it work inside
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..0dd9e6c532c 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1

From 3e85bfc84073c0a452f64b7d430f8b3e21122cd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:30:48 -0300
Subject: [PATCH 2/5] common/travis/build.sh: don't clean masterdir for native
 builds.

This allows tests to be run in a separate step without rebuilding
everything.
---
 common/travis/build.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..483bcf54755 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,6 +6,11 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
+# keep builddir so tests can be run without rebuilding everything
+if [ "$3" = 1 ]; then
+	test="-C"
+fi
+
 PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
 
 NPROCS=1
@@ -16,7 +21,7 @@ fi
 export FTP_RETRIES=10
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From a7ff86328e2271b1886b4bc061c46e42f6625055 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:31:32 -0300
Subject: [PATCH 3/5] common/travis/test.sh: create file.

---
 common/travis/test.sh | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100755 common/travis/test.sh

diff --git a/common/travis/test.sh b/common/travis/test.sh
new file mode 100755
index 00000000000..571747c0755
--- /dev/null
+++ b/common/travis/test.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# test.sh
+
+if [ "$1" != 1 ]; then
+	echo "Skipping tests..."
+	exit 0
+fi
+
+PKGS=$(cat /tmp/templates)
+
+NPROCS=1
+if [ -r /proc/cpuinfo ]; then
+        NPROCS=$(grep ^proc /proc/cpuinfo|wc -l)
+fi
+
+export FTP_RETRIES=10
+
+for pkg in ${PKGS}; do
+	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir -Q check "$pkg"
+	[ $? -eq 1 ] && exit 1
+done
+
+exit 0

From 1ce15d710e9d11547424582daadcc235fa61f1ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 4/5] .github/workflows: run tests on CI for native builds.

Also fix "list contents" step by adding a fetch-xtools step.
---
 .github/workflows/build.yaml | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 33186037f8d..79d4368d77c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -73,9 +74,18 @@ jobs:
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
+      - name: Check packages
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/test.sh" "$TEST"
+          )
+
+      - run: common/travis/fetch-xtools.sh
       - name: Show files
         run: |
           (

From ee981114c9ad746e32f39f35dc4901a974f4e74b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:48:53 -0300
Subject: [PATCH 5/5] [temporary] test make's test suite.

---
 srcpkgs/make/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/make/template b/srcpkgs/make/template
index 0aebcbc70be..eecf8233b05 100644
--- a/srcpkgs/make/template
+++ b/srcpkgs/make/template
@@ -1,4 +1,5 @@
 # Template file for 'make'
+# time to test
 pkgname=make
 version=4.3
 revision=3

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (4 preceding siblings ...)
  2020-12-02 18:38 ` ericonr
@ 2020-12-02 18:44 ` ericonr
  2020-12-07 22:19 ` ericonr
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-02 18:44 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From a8994ec765acb9573f7ee4304b74afa459204a38 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 1/5] common/travis/fetch-xtools: make it work inside
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..0dd9e6c532c 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1

From d8163bace0b4283ae42268d7b78cab807c6ec9e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:30:48 -0300
Subject: [PATCH 2/5] common/travis/build.sh: don't clean masterdir for native
 builds.

This allows tests to be run in a separate step without rebuilding
everything.

Also use nproc(1) directly.
---
 common/travis/build.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..6530afd906d 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,17 +6,17 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
-PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
-
-NPROCS=1
-if [ -r /proc/cpuinfo ]; then
-        NPROCS=$(grep ^proc /proc/cpuinfo|wc -l)
+# keep builddir so tests can be run without rebuilding everything
+if [ "$3" = 1 ]; then
+	test="-C"
 fi
 
+PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
+
 export FTP_RETRIES=10
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From d8efee0211e1db2d8879f1ade9d00409656fe6cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:31:32 -0300
Subject: [PATCH 3/5] common/travis/test.sh: create file.

---
 common/travis/test.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100755 common/travis/test.sh

diff --git a/common/travis/test.sh b/common/travis/test.sh
new file mode 100755
index 00000000000..a50d4274b26
--- /dev/null
+++ b/common/travis/test.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# test.sh
+
+if [ "$1" != 1 ]; then
+	echo "Skipping tests..."
+	exit 0
+fi
+
+PKGS=$(cat /tmp/templates)
+
+export FTP_RETRIES=10
+
+for pkg in ${PKGS}; do
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir -Q check "$pkg"
+	[ $? -eq 1 ] && exit 1
+done
+
+exit 0

From 2037ab7b938301e3ae589a930e4e2b8b3293859e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 4/5] .github/workflows: run tests on CI for native builds.

Also fix "list contents" step by adding a fetch-xtools step.
---
 .github/workflows/build.yaml | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 33186037f8d..79d4368d77c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -73,9 +74,18 @@ jobs:
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
+      - name: Check packages
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/test.sh" "$TEST"
+          )
+
+      - run: common/travis/fetch-xtools.sh
       - name: Show files
         run: |
           (

From 4624dd6b7cdbfdc4af7f2f41311726cd3bf219f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:48:53 -0300
Subject: [PATCH 5/5] [temporary] test make's test suite.

---
 srcpkgs/make/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/make/template b/srcpkgs/make/template
index 0aebcbc70be..eecf8233b05 100644
--- a/srcpkgs/make/template
+++ b/srcpkgs/make/template
@@ -1,4 +1,5 @@
 # Template file for 'make'
+# time to test
 pkgname=make
 version=4.3
 revision=3

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (5 preceding siblings ...)
  2020-12-02 18:44 ` ericonr
@ 2020-12-07 22:19 ` ericonr
  2020-12-07 23:23 ` ericonr
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-07 22:19 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From fce40c956d23c5c863c180feec97d1e7984a4145 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 1/4] common/travis/fetch-xtools: make it work inside
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..0dd9e6c532c 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1

From 006555341877f7bd60e339be8ada7c1bb1706cb2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:30:48 -0300
Subject: [PATCH 2/4] common/travis/build.sh: don't clean masterdir for native
 builds.

This allows tests to be run in a separate step without rebuilding
everything.

Also use nproc(1) directly.
---
 common/travis/build.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..6530afd906d 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,17 +6,17 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
-PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
-
-NPROCS=1
-if [ -r /proc/cpuinfo ]; then
-        NPROCS=$(grep ^proc /proc/cpuinfo|wc -l)
+# keep builddir so tests can be run without rebuilding everything
+if [ "$3" = 1 ]; then
+	test="-C"
 fi
 
+PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
+
 export FTP_RETRIES=10
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From 001a87c32d16367234b4e588d0e1a5a62a520d2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:31:32 -0300
Subject: [PATCH 3/4] common/travis/test.sh: create file.

---
 common/travis/test.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100755 common/travis/test.sh

diff --git a/common/travis/test.sh b/common/travis/test.sh
new file mode 100755
index 00000000000..a50d4274b26
--- /dev/null
+++ b/common/travis/test.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# test.sh
+
+if [ "$1" != 1 ]; then
+	echo "Skipping tests..."
+	exit 0
+fi
+
+PKGS=$(cat /tmp/templates)
+
+export FTP_RETRIES=10
+
+for pkg in ${PKGS}; do
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir -Q check "$pkg"
+	[ $? -eq 1 ] && exit 1
+done
+
+exit 0

From 501b14129f4bfdabe52bb4dcaed2d43f5dad35a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 4/4] .github/workflows: run tests on CI for native builds.

Also fix "list contents" step by adding a fetch-xtools step.
---
 .github/workflows/build.yaml | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 33186037f8d..79d4368d77c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -73,9 +74,18 @@ jobs:
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
+      - name: Check packages
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/test.sh" "$TEST"
+          )
+
+      - run: common/travis/fetch-xtools.sh
       - name: Show files
         run: |
           (

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (6 preceding siblings ...)
  2020-12-07 22:19 ` ericonr
@ 2020-12-07 23:23 ` ericonr
  2020-12-07 23:24 ` [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full ericonr
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-07 23:23 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From ab6e8628f1c39cc3a9eeac6765dbd9de2aa993f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:42 -0300
Subject: [PATCH 1/6] xbps-src: add -K option for running the full testsuite.

Some packages have rather long test suites, with an option for a shorter
one. With this option, one can choose between shorter tests (-Q) or the
complete longer ones (-K).

This also allows CI to run only the shorter testsuites.

Make the appropriate changes to etc/default.conf and Manual.md as well.
---
 Manual.md         | 3 +++
 etc/defaults.conf | 2 ++
 xbps-src          | 1 +
 3 files changed, 6 insertions(+)

diff --git a/Manual.md b/Manual.md
index 7647f957129..4b0d678a757 100644
--- a/Manual.md
+++ b/Manual.md
@@ -364,6 +364,9 @@ rather than additional binary package names.
 
 - `CROSS_BUILD` Set if `xbps-src` is cross compiling a package.
 
+- `XBPS_CHECK_PKGS` Set if `xbps-src` is going to run tests for a package.
+Longer testsuites should only be run in `do_check()` if it is set to `full`.
+
 - `DESTDIR` Full path to the fake destdir used by the source pkg, set to
 `<masterdir>/destdir/${sourcepkg}-${version}`.
 
diff --git a/etc/defaults.conf b/etc/defaults.conf
index 6e297903fbd..88286deaa6f 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -71,8 +71,10 @@ XBPS_SUCMD="sudo /bin/sh -c"
 
 # [OPTIONAL]
 # Enable running the (optional) do_check() function of a package.
+# When set to 'full', will enable further testing for some packages.
 #
 #XBPS_CHECK_PKGS=yes
+#XBPS_CHECK_PKGS=full
 
 # [OPTIONAL]
 # Enable building -dbg subpackages with debugging symbols. Please note
diff --git a/xbps-src b/xbps-src
index 08da501f219..bb06305d4ac 100755
--- a/xbps-src
+++ b/xbps-src
@@ -382,6 +382,7 @@ while getopts "$XBPS_OPTSTRING" opt; do
         p) XBPS_ARG_PRINT_VARIABLES="$OPTARG"; XBPS_OPTIONS+=" -p $OPTARG";;
         q) XBPS_ARG_QUIET=1; XBPS_OPTIONS+=" -q";;
         Q) XBPS_ARG_CHECK_PKGS=1; XBPS_OPTIONS+=" -Q";;
+        K) XBPS_ARG_CHECK_PKGS=full; XBPS_OPTIONS+=" -K";;
         r) XBPS_ARG_ALT_REPOSITORY="$OPTARG"; XBPS_OPTIONS+=" -r $OPTARG";;
         t) XBPS_ARG_TEMP_MASTERDIR=1; XBPS_OPTIONS+=" -t -C";;
         V) echo "xbps-src-$XBPS_SRC_VERSION $(xbps-uhelper -V)" && exit 0;;

From 2724fb51cf6143345cd01591c4e18ac7f567111d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 2/6] common/travis/fetch-xtools: make it work inside
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..0dd9e6c532c 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1

From d4bde101ade0a35729b72bde56a26ba48aaa19f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:30:48 -0300
Subject: [PATCH 3/6] common/travis/build.sh: don't clean masterdir for native
 builds.

This allows tests to be run in a separate step without rebuilding
everything.

Also use nproc(1) directly.
---
 common/travis/build.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..6530afd906d 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,17 +6,17 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
-PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
-
-NPROCS=1
-if [ -r /proc/cpuinfo ]; then
-        NPROCS=$(grep ^proc /proc/cpuinfo|wc -l)
+# keep builddir so tests can be run without rebuilding everything
+if [ "$3" = 1 ]; then
+	test="-C"
 fi
 
+PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
+
 export FTP_RETRIES=10
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From 1bea016bb0cbc6b07ced8dcb25bc04485295e078 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:31:32 -0300
Subject: [PATCH 4/6] common/travis/test.sh: create file.

---
 common/travis/test.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100755 common/travis/test.sh

diff --git a/common/travis/test.sh b/common/travis/test.sh
new file mode 100755
index 00000000000..a50d4274b26
--- /dev/null
+++ b/common/travis/test.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# test.sh
+
+if [ "$1" != 1 ]; then
+	echo "Skipping tests..."
+	exit 0
+fi
+
+PKGS=$(cat /tmp/templates)
+
+export FTP_RETRIES=10
+
+for pkg in ${PKGS}; do
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir -Q check "$pkg"
+	[ $? -eq 1 ] && exit 1
+done
+
+exit 0

From 8d2dc1b3fe2229f7336a93648e9d74b49e4774f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 5/6] .github/workflows: run tests on CI for native builds.

Also fix "list contents" step by adding a fetch-xtools step.
---
 .github/workflows/build.yaml | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 33186037f8d..79d4368d77c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -73,9 +74,18 @@ jobs:
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
+      - name: Check packages
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/test.sh" "$TEST"
+          )
+
+      - run: common/travis/fetch-xtools.sh
       - name: Show files
         run: |
           (

From 947ab58b287f604a4e8aabee6c2c7ab60d2aa59d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:12 -0300
Subject: [PATCH 6/6] libaom: split tests by duration.

---
 srcpkgs/libaom/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/libaom/template b/srcpkgs/libaom/template
index 93f1983edfc..0ed1adefeb6 100644
--- a/srcpkgs/libaom/template
+++ b/srcpkgs/libaom/template
@@ -35,8 +35,11 @@ pre_check() {
 
 do_check() {
 	cd build
-	make runtests ${makejobs}
 	../test/examples.sh --bin-path examples
+
+	if [ "$XBPS_CHECK_PKGS" = full ]; then
+		make runtests ${makejobs}
+	fi
 }
 
 post_install() {

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (7 preceding siblings ...)
  2020-12-07 23:23 ` ericonr
@ 2020-12-07 23:24 ` ericonr
  2020-12-07 23:27 ` [PR PATCH] [Updated] " ericonr
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-07 23:24 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/26773#issuecomment-740242604

Comment:
@void-linux/pkg-committers please take a look :) 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (8 preceding siblings ...)
  2020-12-07 23:24 ` [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full ericonr
@ 2020-12-07 23:27 ` ericonr
  2020-12-07 23:29 ` ericonr
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-07 23:27 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From 74832371a935211df5188c02eac8c4c55c9f4059 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:42 -0300
Subject: [PATCH 1/6] xbps-src: add -K option for running the full testsuite.

Some packages have rather long test suites, with an option for a shorter
one. With this option, one can choose between shorter tests (-Q) or the
complete longer ones (-K).

This also allows CI to run only the shorter testsuites.

Make the appropriate changes to etc/default.conf and Manual.md as well.
---
 Manual.md         | 3 +++
 etc/defaults.conf | 2 ++
 xbps-src          | 3 +++
 3 files changed, 8 insertions(+)

diff --git a/Manual.md b/Manual.md
index 7647f957129..4b0d678a757 100644
--- a/Manual.md
+++ b/Manual.md
@@ -364,6 +364,9 @@ rather than additional binary package names.
 
 - `CROSS_BUILD` Set if `xbps-src` is cross compiling a package.
 
+- `XBPS_CHECK_PKGS` Set if `xbps-src` is going to run tests for a package.
+Longer testsuites should only be run in `do_check()` if it is set to `full`.
+
 - `DESTDIR` Full path to the fake destdir used by the source pkg, set to
 `<masterdir>/destdir/${sourcepkg}-${version}`.
 
diff --git a/etc/defaults.conf b/etc/defaults.conf
index 6e297903fbd..88286deaa6f 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -71,8 +71,10 @@ XBPS_SUCMD="sudo /bin/sh -c"
 
 # [OPTIONAL]
 # Enable running the (optional) do_check() function of a package.
+# When set to 'full', will enable further testing for some packages.
 #
 #XBPS_CHECK_PKGS=yes
+#XBPS_CHECK_PKGS=full
 
 # [OPTIONAL]
 # Enable building -dbg subpackages with debugging symbols. Please note
diff --git a/xbps-src b/xbps-src
index 08da501f219..c1a145495bb 100755
--- a/xbps-src
+++ b/xbps-src
@@ -205,6 +205,8 @@ $(print_cross_targets)
 
 -Q  Enable running the check stage.
 
+-K  Enable running the check stage with longer tests.
+
 -q  Suppress informational output of xbps-src (build output is still printed).
 
 -r  <repo>
@@ -382,6 +384,7 @@ while getopts "$XBPS_OPTSTRING" opt; do
         p) XBPS_ARG_PRINT_VARIABLES="$OPTARG"; XBPS_OPTIONS+=" -p $OPTARG";;
         q) XBPS_ARG_QUIET=1; XBPS_OPTIONS+=" -q";;
         Q) XBPS_ARG_CHECK_PKGS=1; XBPS_OPTIONS+=" -Q";;
+        K) XBPS_ARG_CHECK_PKGS=full; XBPS_OPTIONS+=" -K";;
         r) XBPS_ARG_ALT_REPOSITORY="$OPTARG"; XBPS_OPTIONS+=" -r $OPTARG";;
         t) XBPS_ARG_TEMP_MASTERDIR=1; XBPS_OPTIONS+=" -t -C";;
         V) echo "xbps-src-$XBPS_SRC_VERSION $(xbps-uhelper -V)" && exit 0;;

From ef5e8ee12163aaecc68da0df6f8542a47c15d720 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 2/6] common/travis/fetch-xtools: make it work inside
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..0dd9e6c532c 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1

From bc5f3abcb49fd1460de49d857fc10a0564d24e40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:30:48 -0300
Subject: [PATCH 3/6] common/travis/build.sh: don't clean masterdir for native
 builds.

This allows tests to be run in a separate step without rebuilding
everything.

Also use nproc(1) directly.
---
 common/travis/build.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..6530afd906d 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,17 +6,17 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
-PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
-
-NPROCS=1
-if [ -r /proc/cpuinfo ]; then
-        NPROCS=$(grep ^proc /proc/cpuinfo|wc -l)
+# keep builddir so tests can be run without rebuilding everything
+if [ "$3" = 1 ]; then
+	test="-C"
 fi
 
+PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
+
 export FTP_RETRIES=10
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From 09315e86db6712639c4d8db52b291ad39f5e9847 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:31:32 -0300
Subject: [PATCH 4/6] common/travis/test.sh: create file.

---
 common/travis/test.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100755 common/travis/test.sh

diff --git a/common/travis/test.sh b/common/travis/test.sh
new file mode 100755
index 00000000000..a50d4274b26
--- /dev/null
+++ b/common/travis/test.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# test.sh
+
+if [ "$1" != 1 ]; then
+	echo "Skipping tests..."
+	exit 0
+fi
+
+PKGS=$(cat /tmp/templates)
+
+export FTP_RETRIES=10
+
+for pkg in ${PKGS}; do
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir -Q check "$pkg"
+	[ $? -eq 1 ] && exit 1
+done
+
+exit 0

From f896d545873d82456326029862cb1be171248683 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 5/6] .github/workflows: run tests on CI for native builds.

Also fix "list contents" step by adding a fetch-xtools step.
---
 .github/workflows/build.yaml | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 33186037f8d..79d4368d77c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -73,9 +74,18 @@ jobs:
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
+      - name: Check packages
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/test.sh" "$TEST"
+          )
+
+      - run: common/travis/fetch-xtools.sh
       - name: Show files
         run: |
           (

From 544266577468da33971bbe1d03a7f6b49a972a49 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:12 -0300
Subject: [PATCH 6/6] libaom: split tests by duration.

---
 srcpkgs/libaom/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/libaom/template b/srcpkgs/libaom/template
index 93f1983edfc..0ed1adefeb6 100644
--- a/srcpkgs/libaom/template
+++ b/srcpkgs/libaom/template
@@ -35,8 +35,11 @@ pre_check() {
 
 do_check() {
 	cd build
-	make runtests ${makejobs}
 	../test/examples.sh --bin-path examples
+
+	if [ "$XBPS_CHECK_PKGS" = full ]; then
+		make runtests ${makejobs}
+	fi
 }
 
 post_install() {

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (9 preceding siblings ...)
  2020-12-07 23:27 ` [PR PATCH] [Updated] " ericonr
@ 2020-12-07 23:29 ` ericonr
  2020-12-07 23:30 ` ericonr
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-07 23:29 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From 9b3ceeb49234471f91a8c2d62e6652884c6d2990 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:42 -0300
Subject: [PATCH 1/6] xbps-src: add -K option for running the full testsuite.

Some packages have rather long test suites, with an option for a shorter
one. With this option, one can choose between shorter tests (-Q) or the
complete longer ones (-K).

This also allows CI to run only the shorter testsuites.

Make the appropriate changes to etc/default.conf and Manual.md as well.
---
 Manual.md         | 3 +++
 etc/defaults.conf | 2 ++
 xbps-src          | 5 ++++-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Manual.md b/Manual.md
index 7647f957129..4b0d678a757 100644
--- a/Manual.md
+++ b/Manual.md
@@ -364,6 +364,9 @@ rather than additional binary package names.
 
 - `CROSS_BUILD` Set if `xbps-src` is cross compiling a package.
 
+- `XBPS_CHECK_PKGS` Set if `xbps-src` is going to run tests for a package.
+Longer testsuites should only be run in `do_check()` if it is set to `full`.
+
 - `DESTDIR` Full path to the fake destdir used by the source pkg, set to
 `<masterdir>/destdir/${sourcepkg}-${version}`.
 
diff --git a/etc/defaults.conf b/etc/defaults.conf
index 6e297903fbd..88286deaa6f 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -71,8 +71,10 @@ XBPS_SUCMD="sudo /bin/sh -c"
 
 # [OPTIONAL]
 # Enable running the (optional) do_check() function of a package.
+# When set to 'full', will enable further testing for some packages.
 #
 #XBPS_CHECK_PKGS=yes
+#XBPS_CHECK_PKGS=full
 
 # [OPTIONAL]
 # Enable building -dbg subpackages with debugging symbols. Please note
diff --git a/xbps-src b/xbps-src
index 08da501f219..1e76360a150 100755
--- a/xbps-src
+++ b/xbps-src
@@ -205,6 +205,8 @@ $(print_cross_targets)
 
 -Q  Enable running the check stage.
 
+-K  Enable running the check stage with longer tests.
+
 -q  Suppress informational output of xbps-src (build output is still printed).
 
 -r  <repo>
@@ -382,6 +384,7 @@ while getopts "$XBPS_OPTSTRING" opt; do
         p) XBPS_ARG_PRINT_VARIABLES="$OPTARG"; XBPS_OPTIONS+=" -p $OPTARG";;
         q) XBPS_ARG_QUIET=1; XBPS_OPTIONS+=" -q";;
         Q) XBPS_ARG_CHECK_PKGS=1; XBPS_OPTIONS+=" -Q";;
+        K) XBPS_ARG_CHECK_PKGS=full; XBPS_OPTIONS+=" -K";;
         r) XBPS_ARG_ALT_REPOSITORY="$OPTARG"; XBPS_OPTIONS+=" -r $OPTARG";;
         t) XBPS_ARG_TEMP_MASTERDIR=1; XBPS_OPTIONS+=" -t -C";;
         V) echo "xbps-src-$XBPS_SRC_VERSION $(xbps-uhelper -V)" && exit 0;;
@@ -459,7 +462,7 @@ fi
 [ -n "$XBPS_ARG_TEMP_MASTERDIR" ] && XBPS_TEMP_MASTERDIR=1
 [ -n "$XBPS_ARG_BINPKG_EXISTS" ] && XBPS_BINPKG_EXISTS=1
 [ -n "$XBPS_ARG_USE_GIT_REVS" ] && XBPS_USE_GIT_REVS=1
-[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS=1
+[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS="$XBPS_ARG_CHECK_PKGS"
 [ -n "$XBPS_ARG_DEBUG_PKGS" ] && XBPS_DEBUG_PKGS=1
 [ -n "$XBPS_ARG_SKIP_DEPS" ] && XBPS_SKIP_DEPS=1
 [ -n "$XBPS_ARG_KEEP_ALL" ] && XBPS_KEEP_ALL=1

From 771cc76d7bb02166e8abbf09b5ffb0099e5e58d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 2/6] common/travis/fetch-xtools: make it work inside
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..0dd9e6c532c 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1

From dec6c1a091400b1947b5779c94cf9de5164e97d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:30:48 -0300
Subject: [PATCH 3/6] common/travis/build.sh: don't clean masterdir for native
 builds.

This allows tests to be run in a separate step without rebuilding
everything.

Also use nproc(1) directly.
---
 common/travis/build.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..6530afd906d 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,17 +6,17 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
-PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
-
-NPROCS=1
-if [ -r /proc/cpuinfo ]; then
-        NPROCS=$(grep ^proc /proc/cpuinfo|wc -l)
+# keep builddir so tests can be run without rebuilding everything
+if [ "$3" = 1 ]; then
+	test="-C"
 fi
 
+PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
+
 export FTP_RETRIES=10
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From cf63e3ca8cb832b91bdf8933b478f6fcb06cb677 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:31:32 -0300
Subject: [PATCH 4/6] common/travis/test.sh: create file.

---
 common/travis/test.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100755 common/travis/test.sh

diff --git a/common/travis/test.sh b/common/travis/test.sh
new file mode 100755
index 00000000000..a50d4274b26
--- /dev/null
+++ b/common/travis/test.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# test.sh
+
+if [ "$1" != 1 ]; then
+	echo "Skipping tests..."
+	exit 0
+fi
+
+PKGS=$(cat /tmp/templates)
+
+export FTP_RETRIES=10
+
+for pkg in ${PKGS}; do
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir -Q check "$pkg"
+	[ $? -eq 1 ] && exit 1
+done
+
+exit 0

From 0579a62877f4a787f88c5c9231bdc255af96afcc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 5/6] .github/workflows: run tests on CI for native builds.

Also fix "list contents" step by adding a fetch-xtools step.
---
 .github/workflows/build.yaml | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 33186037f8d..79d4368d77c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -73,9 +74,18 @@ jobs:
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
+      - name: Check packages
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/test.sh" "$TEST"
+          )
+
+      - run: common/travis/fetch-xtools.sh
       - name: Show files
         run: |
           (

From 9a3a50cfcb475ff24fcd521e7fb5fd46e2cd5356 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:12 -0300
Subject: [PATCH 6/6] libaom: split tests by duration.

---
 srcpkgs/libaom/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/libaom/template b/srcpkgs/libaom/template
index 93f1983edfc..0ed1adefeb6 100644
--- a/srcpkgs/libaom/template
+++ b/srcpkgs/libaom/template
@@ -35,8 +35,11 @@ pre_check() {
 
 do_check() {
 	cd build
-	make runtests ${makejobs}
 	../test/examples.sh --bin-path examples
+
+	if [ "$XBPS_CHECK_PKGS" = full ]; then
+		make runtests ${makejobs}
+	fi
 }
 
 post_install() {

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (10 preceding siblings ...)
  2020-12-07 23:29 ` ericonr
@ 2020-12-07 23:30 ` ericonr
  2020-12-08 15:27 ` ericonr
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-07 23:30 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From 4202603412f730c07f84f425d7440b2cfe0693ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:42 -0300
Subject: [PATCH 1/6] xbps-src: add -K option for running the full testsuite.

Some packages have rather long test suites, with an option for a shorter
one. With this option, one can choose between shorter tests (-Q) or the
complete longer ones (-K).

This also allows CI to run only the shorter testsuites.

Make the appropriate changes to etc/default.conf and Manual.md as well.
---
 Manual.md         | 3 +++
 etc/defaults.conf | 2 ++
 xbps-src          | 5 ++++-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Manual.md b/Manual.md
index 7647f957129..4b0d678a757 100644
--- a/Manual.md
+++ b/Manual.md
@@ -364,6 +364,9 @@ rather than additional binary package names.
 
 - `CROSS_BUILD` Set if `xbps-src` is cross compiling a package.
 
+- `XBPS_CHECK_PKGS` Set if `xbps-src` is going to run tests for a package.
+Longer testsuites should only be run in `do_check()` if it is set to `full`.
+
 - `DESTDIR` Full path to the fake destdir used by the source pkg, set to
 `<masterdir>/destdir/${sourcepkg}-${version}`.
 
diff --git a/etc/defaults.conf b/etc/defaults.conf
index 6e297903fbd..88286deaa6f 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -71,8 +71,10 @@ XBPS_SUCMD="sudo /bin/sh -c"
 
 # [OPTIONAL]
 # Enable running the (optional) do_check() function of a package.
+# When set to 'full', will enable further testing for some packages.
 #
 #XBPS_CHECK_PKGS=yes
+#XBPS_CHECK_PKGS=full
 
 # [OPTIONAL]
 # Enable building -dbg subpackages with debugging symbols. Please note
diff --git a/xbps-src b/xbps-src
index 08da501f219..c06d067c060 100755
--- a/xbps-src
+++ b/xbps-src
@@ -205,6 +205,8 @@ $(print_cross_targets)
 
 -Q  Enable running the check stage.
 
+-K  Enable running the check stage with longer tests.
+
 -q  Suppress informational output of xbps-src (build output is still printed).
 
 -r  <repo>
@@ -382,6 +384,7 @@ while getopts "$XBPS_OPTSTRING" opt; do
         p) XBPS_ARG_PRINT_VARIABLES="$OPTARG"; XBPS_OPTIONS+=" -p $OPTARG";;
         q) XBPS_ARG_QUIET=1; XBPS_OPTIONS+=" -q";;
         Q) XBPS_ARG_CHECK_PKGS=1; XBPS_OPTIONS+=" -Q";;
+        K) XBPS_ARG_CHECK_PKGS=full; XBPS_OPTIONS+=" -K";;
         r) XBPS_ARG_ALT_REPOSITORY="$OPTARG"; XBPS_OPTIONS+=" -r $OPTARG";;
         t) XBPS_ARG_TEMP_MASTERDIR=1; XBPS_OPTIONS+=" -t -C";;
         V) echo "xbps-src-$XBPS_SRC_VERSION $(xbps-uhelper -V)" && exit 0;;
@@ -459,7 +462,6 @@ fi
 [ -n "$XBPS_ARG_TEMP_MASTERDIR" ] && XBPS_TEMP_MASTERDIR=1
 [ -n "$XBPS_ARG_BINPKG_EXISTS" ] && XBPS_BINPKG_EXISTS=1
 [ -n "$XBPS_ARG_USE_GIT_REVS" ] && XBPS_USE_GIT_REVS=1
-[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS=1
 [ -n "$XBPS_ARG_DEBUG_PKGS" ] && XBPS_DEBUG_PKGS=1
 [ -n "$XBPS_ARG_SKIP_DEPS" ] && XBPS_SKIP_DEPS=1
 [ -n "$XBPS_ARG_KEEP_ALL" ] && XBPS_KEEP_ALL=1
@@ -467,6 +469,7 @@ fi
 [ -n "$XBPS_ARG_PRINT_VARIABLES" ] && XBPS_PRINT_VARIABLES="$XBPS_ARG_PRINT_VARIABLES"
 [ -n "$XBPS_ARG_ALT_REPOSITORY" ] && XBPS_ALT_REPOSITORY="$XBPS_ARG_ALT_REPOSITORY"
 [ -n "$XBPS_ARG_CROSS_BUILD" ] && XBPS_CROSS_BUILD="$XBPS_ARG_CROSS_BUILD"
+[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS="$XBPS_ARG_CHECK_PKGS"
 [ -n "$XBPS_ARG_MAKEJOBS" ] && XBPS_MAKEJOBS="$XBPS_ARG_MAKEJOBS"
 
 export XBPS_BUILD_ONLY_ONE_PKG XBPS_SKIP_REMOTEREPOS XBPS_BUILD_FORCEMODE \

From fb9da31e5f45d949869a504c5a53f4f842aec25b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 2/6] common/travis/fetch-xtools: make it work inside
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..0dd9e6c532c 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1

From 139095cc12475cd6953fe2c41bf26fc36845b7c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:30:48 -0300
Subject: [PATCH 3/6] common/travis/build.sh: don't clean masterdir for native
 builds.

This allows tests to be run in a separate step without rebuilding
everything.

Also use nproc(1) directly.
---
 common/travis/build.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..6530afd906d 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,17 +6,17 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
-PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
-
-NPROCS=1
-if [ -r /proc/cpuinfo ]; then
-        NPROCS=$(grep ^proc /proc/cpuinfo|wc -l)
+# keep builddir so tests can be run without rebuilding everything
+if [ "$3" = 1 ]; then
+	test="-C"
 fi
 
+PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
+
 export FTP_RETRIES=10
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From 58afb42045b8427c29b4a01e53e8268d541a4d6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:31:32 -0300
Subject: [PATCH 4/6] common/travis/test.sh: create file.

---
 common/travis/test.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100755 common/travis/test.sh

diff --git a/common/travis/test.sh b/common/travis/test.sh
new file mode 100755
index 00000000000..a50d4274b26
--- /dev/null
+++ b/common/travis/test.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# test.sh
+
+if [ "$1" != 1 ]; then
+	echo "Skipping tests..."
+	exit 0
+fi
+
+PKGS=$(cat /tmp/templates)
+
+export FTP_RETRIES=10
+
+for pkg in ${PKGS}; do
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir -Q check "$pkg"
+	[ $? -eq 1 ] && exit 1
+done
+
+exit 0

From f60586f4d35a13060f79f803ebc96294c2438eff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 5/6] .github/workflows: run tests on CI for native builds.

Also fix "list contents" step by adding a fetch-xtools step.
---
 .github/workflows/build.yaml | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 33186037f8d..79d4368d77c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -73,9 +74,18 @@ jobs:
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
+      - name: Check packages
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/test.sh" "$TEST"
+          )
+
+      - run: common/travis/fetch-xtools.sh
       - name: Show files
         run: |
           (

From ec9d47fe67353cd5dedf4bfcdcade343c7bab56a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:12 -0300
Subject: [PATCH 6/6] libaom: split tests by duration.

---
 srcpkgs/libaom/template | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/libaom/template b/srcpkgs/libaom/template
index 93f1983edfc..0ed1adefeb6 100644
--- a/srcpkgs/libaom/template
+++ b/srcpkgs/libaom/template
@@ -35,8 +35,11 @@ pre_check() {
 
 do_check() {
 	cd build
-	make runtests ${makejobs}
 	../test/examples.sh --bin-path examples
+
+	if [ "$XBPS_CHECK_PKGS" = full ]; then
+		make runtests ${makejobs}
+	fi
 }
 
 post_install() {

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (11 preceding siblings ...)
  2020-12-07 23:30 ` ericonr
@ 2020-12-08 15:27 ` ericonr
  2020-12-08 15:37 ` ericonr
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-08 15:27 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From 4202603412f730c07f84f425d7440b2cfe0693ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:42 -0300
Subject: [PATCH 1/6] xbps-src: add -K option for running the full testsuite.

Some packages have rather long test suites, with an option for a shorter
one. With this option, one can choose between shorter tests (-Q) or the
complete longer ones (-K).

This also allows CI to run only the shorter testsuites.

Make the appropriate changes to etc/default.conf and Manual.md as well.
---
 Manual.md         | 3 +++
 etc/defaults.conf | 2 ++
 xbps-src          | 5 ++++-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Manual.md b/Manual.md
index 7647f957129..4b0d678a757 100644
--- a/Manual.md
+++ b/Manual.md
@@ -364,6 +364,9 @@ rather than additional binary package names.
 
 - `CROSS_BUILD` Set if `xbps-src` is cross compiling a package.
 
+- `XBPS_CHECK_PKGS` Set if `xbps-src` is going to run tests for a package.
+Longer testsuites should only be run in `do_check()` if it is set to `full`.
+
 - `DESTDIR` Full path to the fake destdir used by the source pkg, set to
 `<masterdir>/destdir/${sourcepkg}-${version}`.
 
diff --git a/etc/defaults.conf b/etc/defaults.conf
index 6e297903fbd..88286deaa6f 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -71,8 +71,10 @@ XBPS_SUCMD="sudo /bin/sh -c"
 
 # [OPTIONAL]
 # Enable running the (optional) do_check() function of a package.
+# When set to 'full', will enable further testing for some packages.
 #
 #XBPS_CHECK_PKGS=yes
+#XBPS_CHECK_PKGS=full
 
 # [OPTIONAL]
 # Enable building -dbg subpackages with debugging symbols. Please note
diff --git a/xbps-src b/xbps-src
index 08da501f219..c06d067c060 100755
--- a/xbps-src
+++ b/xbps-src
@@ -205,6 +205,8 @@ $(print_cross_targets)
 
 -Q  Enable running the check stage.
 
+-K  Enable running the check stage with longer tests.
+
 -q  Suppress informational output of xbps-src (build output is still printed).
 
 -r  <repo>
@@ -382,6 +384,7 @@ while getopts "$XBPS_OPTSTRING" opt; do
         p) XBPS_ARG_PRINT_VARIABLES="$OPTARG"; XBPS_OPTIONS+=" -p $OPTARG";;
         q) XBPS_ARG_QUIET=1; XBPS_OPTIONS+=" -q";;
         Q) XBPS_ARG_CHECK_PKGS=1; XBPS_OPTIONS+=" -Q";;
+        K) XBPS_ARG_CHECK_PKGS=full; XBPS_OPTIONS+=" -K";;
         r) XBPS_ARG_ALT_REPOSITORY="$OPTARG"; XBPS_OPTIONS+=" -r $OPTARG";;
         t) XBPS_ARG_TEMP_MASTERDIR=1; XBPS_OPTIONS+=" -t -C";;
         V) echo "xbps-src-$XBPS_SRC_VERSION $(xbps-uhelper -V)" && exit 0;;
@@ -459,7 +462,6 @@ fi
 [ -n "$XBPS_ARG_TEMP_MASTERDIR" ] && XBPS_TEMP_MASTERDIR=1
 [ -n "$XBPS_ARG_BINPKG_EXISTS" ] && XBPS_BINPKG_EXISTS=1
 [ -n "$XBPS_ARG_USE_GIT_REVS" ] && XBPS_USE_GIT_REVS=1
-[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS=1
 [ -n "$XBPS_ARG_DEBUG_PKGS" ] && XBPS_DEBUG_PKGS=1
 [ -n "$XBPS_ARG_SKIP_DEPS" ] && XBPS_SKIP_DEPS=1
 [ -n "$XBPS_ARG_KEEP_ALL" ] && XBPS_KEEP_ALL=1
@@ -467,6 +469,7 @@ fi
 [ -n "$XBPS_ARG_PRINT_VARIABLES" ] && XBPS_PRINT_VARIABLES="$XBPS_ARG_PRINT_VARIABLES"
 [ -n "$XBPS_ARG_ALT_REPOSITORY" ] && XBPS_ALT_REPOSITORY="$XBPS_ARG_ALT_REPOSITORY"
 [ -n "$XBPS_ARG_CROSS_BUILD" ] && XBPS_CROSS_BUILD="$XBPS_ARG_CROSS_BUILD"
+[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS="$XBPS_ARG_CHECK_PKGS"
 [ -n "$XBPS_ARG_MAKEJOBS" ] && XBPS_MAKEJOBS="$XBPS_ARG_MAKEJOBS"
 
 export XBPS_BUILD_ONLY_ONE_PKG XBPS_SKIP_REMOTEREPOS XBPS_BUILD_FORCEMODE \

From fb9da31e5f45d949869a504c5a53f4f842aec25b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 2/6] common/travis/fetch-xtools: make it work inside
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..0dd9e6c532c 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1

From 139095cc12475cd6953fe2c41bf26fc36845b7c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:30:48 -0300
Subject: [PATCH 3/6] common/travis/build.sh: don't clean masterdir for native
 builds.

This allows tests to be run in a separate step without rebuilding
everything.

Also use nproc(1) directly.
---
 common/travis/build.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..6530afd906d 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,17 +6,17 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
-PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
-
-NPROCS=1
-if [ -r /proc/cpuinfo ]; then
-        NPROCS=$(grep ^proc /proc/cpuinfo|wc -l)
+# keep builddir so tests can be run without rebuilding everything
+if [ "$3" = 1 ]; then
+	test="-C"
 fi
 
+PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
+
 export FTP_RETRIES=10
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From 58afb42045b8427c29b4a01e53e8268d541a4d6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:31:32 -0300
Subject: [PATCH 4/6] common/travis/test.sh: create file.

---
 common/travis/test.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100755 common/travis/test.sh

diff --git a/common/travis/test.sh b/common/travis/test.sh
new file mode 100755
index 00000000000..a50d4274b26
--- /dev/null
+++ b/common/travis/test.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# test.sh
+
+if [ "$1" != 1 ]; then
+	echo "Skipping tests..."
+	exit 0
+fi
+
+PKGS=$(cat /tmp/templates)
+
+export FTP_RETRIES=10
+
+for pkg in ${PKGS}; do
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir -Q check "$pkg"
+	[ $? -eq 1 ] && exit 1
+done
+
+exit 0

From f60586f4d35a13060f79f803ebc96294c2438eff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 5/6] .github/workflows: run tests on CI for native builds.

Also fix "list contents" step by adding a fetch-xtools step.
---
 .github/workflows/build.yaml | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 33186037f8d..79d4368d77c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -73,9 +74,18 @@ jobs:
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
+      - name: Check packages
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/test.sh" "$TEST"
+          )
+
+      - run: common/travis/fetch-xtools.sh
       - name: Show files
         run: |
           (

From 68d568fef335aa5d480a36d85c87de7983f29deb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:12 -0300
Subject: [PATCH 6/6] libaom: split tests by duration.

---
 srcpkgs/libaom/template | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/libaom/template b/srcpkgs/libaom/template
index 93f1983edfc..335450e07a2 100644
--- a/srcpkgs/libaom/template
+++ b/srcpkgs/libaom/template
@@ -28,6 +28,12 @@ if [ -z "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DENABLE_TESTS=OFF"
 fi
 
+post_patch() {
+	# test suite assumes that git being available means it's
+	# in a git repository
+	vsed -e "s/git --version/false/" -i test/tools_common.sh
+}
+
 pre_check() {
 	mkdir -p /host/libaom-test-data
 	export LIBAOM_TEST_DATA_PATH=/host/libaom-test-data
@@ -35,8 +41,11 @@ pre_check() {
 
 do_check() {
 	cd build
-	make runtests ${makejobs}
 	../test/examples.sh --bin-path examples
+
+	if [ "$XBPS_CHECK_PKGS" = full ]; then
+		make runtests ${makejobs}
+	fi
 }
 
 post_install() {

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (12 preceding siblings ...)
  2020-12-08 15:27 ` ericonr
@ 2020-12-08 15:37 ` ericonr
  2020-12-08 17:35 ` Chocimier
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-08 15:37 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From 4202603412f730c07f84f425d7440b2cfe0693ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:42 -0300
Subject: [PATCH 1/6] xbps-src: add -K option for running the full testsuite.

Some packages have rather long test suites, with an option for a shorter
one. With this option, one can choose between shorter tests (-Q) or the
complete longer ones (-K).

This also allows CI to run only the shorter testsuites.

Make the appropriate changes to etc/default.conf and Manual.md as well.
---
 Manual.md         | 3 +++
 etc/defaults.conf | 2 ++
 xbps-src          | 5 ++++-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Manual.md b/Manual.md
index 7647f957129..4b0d678a757 100644
--- a/Manual.md
+++ b/Manual.md
@@ -364,6 +364,9 @@ rather than additional binary package names.
 
 - `CROSS_BUILD` Set if `xbps-src` is cross compiling a package.
 
+- `XBPS_CHECK_PKGS` Set if `xbps-src` is going to run tests for a package.
+Longer testsuites should only be run in `do_check()` if it is set to `full`.
+
 - `DESTDIR` Full path to the fake destdir used by the source pkg, set to
 `<masterdir>/destdir/${sourcepkg}-${version}`.
 
diff --git a/etc/defaults.conf b/etc/defaults.conf
index 6e297903fbd..88286deaa6f 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -71,8 +71,10 @@ XBPS_SUCMD="sudo /bin/sh -c"
 
 # [OPTIONAL]
 # Enable running the (optional) do_check() function of a package.
+# When set to 'full', will enable further testing for some packages.
 #
 #XBPS_CHECK_PKGS=yes
+#XBPS_CHECK_PKGS=full
 
 # [OPTIONAL]
 # Enable building -dbg subpackages with debugging symbols. Please note
diff --git a/xbps-src b/xbps-src
index 08da501f219..c06d067c060 100755
--- a/xbps-src
+++ b/xbps-src
@@ -205,6 +205,8 @@ $(print_cross_targets)
 
 -Q  Enable running the check stage.
 
+-K  Enable running the check stage with longer tests.
+
 -q  Suppress informational output of xbps-src (build output is still printed).
 
 -r  <repo>
@@ -382,6 +384,7 @@ while getopts "$XBPS_OPTSTRING" opt; do
         p) XBPS_ARG_PRINT_VARIABLES="$OPTARG"; XBPS_OPTIONS+=" -p $OPTARG";;
         q) XBPS_ARG_QUIET=1; XBPS_OPTIONS+=" -q";;
         Q) XBPS_ARG_CHECK_PKGS=1; XBPS_OPTIONS+=" -Q";;
+        K) XBPS_ARG_CHECK_PKGS=full; XBPS_OPTIONS+=" -K";;
         r) XBPS_ARG_ALT_REPOSITORY="$OPTARG"; XBPS_OPTIONS+=" -r $OPTARG";;
         t) XBPS_ARG_TEMP_MASTERDIR=1; XBPS_OPTIONS+=" -t -C";;
         V) echo "xbps-src-$XBPS_SRC_VERSION $(xbps-uhelper -V)" && exit 0;;
@@ -459,7 +462,6 @@ fi
 [ -n "$XBPS_ARG_TEMP_MASTERDIR" ] && XBPS_TEMP_MASTERDIR=1
 [ -n "$XBPS_ARG_BINPKG_EXISTS" ] && XBPS_BINPKG_EXISTS=1
 [ -n "$XBPS_ARG_USE_GIT_REVS" ] && XBPS_USE_GIT_REVS=1
-[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS=1
 [ -n "$XBPS_ARG_DEBUG_PKGS" ] && XBPS_DEBUG_PKGS=1
 [ -n "$XBPS_ARG_SKIP_DEPS" ] && XBPS_SKIP_DEPS=1
 [ -n "$XBPS_ARG_KEEP_ALL" ] && XBPS_KEEP_ALL=1
@@ -467,6 +469,7 @@ fi
 [ -n "$XBPS_ARG_PRINT_VARIABLES" ] && XBPS_PRINT_VARIABLES="$XBPS_ARG_PRINT_VARIABLES"
 [ -n "$XBPS_ARG_ALT_REPOSITORY" ] && XBPS_ALT_REPOSITORY="$XBPS_ARG_ALT_REPOSITORY"
 [ -n "$XBPS_ARG_CROSS_BUILD" ] && XBPS_CROSS_BUILD="$XBPS_ARG_CROSS_BUILD"
+[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS="$XBPS_ARG_CHECK_PKGS"
 [ -n "$XBPS_ARG_MAKEJOBS" ] && XBPS_MAKEJOBS="$XBPS_ARG_MAKEJOBS"
 
 export XBPS_BUILD_ONLY_ONE_PKG XBPS_SKIP_REMOTEREPOS XBPS_BUILD_FORCEMODE \

From fb9da31e5f45d949869a504c5a53f4f842aec25b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 2/6] common/travis/fetch-xtools: make it work inside
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..0dd9e6c532c 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1

From 139095cc12475cd6953fe2c41bf26fc36845b7c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:30:48 -0300
Subject: [PATCH 3/6] common/travis/build.sh: don't clean masterdir for native
 builds.

This allows tests to be run in a separate step without rebuilding
everything.

Also use nproc(1) directly.
---
 common/travis/build.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..6530afd906d 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,17 +6,17 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
-PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
-
-NPROCS=1
-if [ -r /proc/cpuinfo ]; then
-        NPROCS=$(grep ^proc /proc/cpuinfo|wc -l)
+# keep builddir so tests can be run without rebuilding everything
+if [ "$3" = 1 ]; then
+	test="-C"
 fi
 
+PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
+
 export FTP_RETRIES=10
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From 58afb42045b8427c29b4a01e53e8268d541a4d6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:31:32 -0300
Subject: [PATCH 4/6] common/travis/test.sh: create file.

---
 common/travis/test.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100755 common/travis/test.sh

diff --git a/common/travis/test.sh b/common/travis/test.sh
new file mode 100755
index 00000000000..a50d4274b26
--- /dev/null
+++ b/common/travis/test.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# test.sh
+
+if [ "$1" != 1 ]; then
+	echo "Skipping tests..."
+	exit 0
+fi
+
+PKGS=$(cat /tmp/templates)
+
+export FTP_RETRIES=10
+
+for pkg in ${PKGS}; do
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir -Q check "$pkg"
+	[ $? -eq 1 ] && exit 1
+done
+
+exit 0

From f60586f4d35a13060f79f803ebc96294c2438eff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 5/6] .github/workflows: run tests on CI for native builds.

Also fix "list contents" step by adding a fetch-xtools step.
---
 .github/workflows/build.yaml | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 33186037f8d..79d4368d77c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -73,9 +74,18 @@ jobs:
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
+      - name: Check packages
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/test.sh" "$TEST"
+          )
+
+      - run: common/travis/fetch-xtools.sh
       - name: Show files
         run: |
           (

From a8143337b1c7ff94e6d6a817d622e887d22db75f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:12 -0300
Subject: [PATCH 6/6] libaom: split tests by duration.

---
 srcpkgs/libaom/template | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/libaom/template b/srcpkgs/libaom/template
index 93f1983edfc..a8a9b5d869e 100644
--- a/srcpkgs/libaom/template
+++ b/srcpkgs/libaom/template
@@ -1,6 +1,6 @@
 # Template file for 'libaom'
 pkgname=libaom
-version=2.0.0
+version=2.0.1
 revision=1
 create_wrksrc=yes
 build_style=cmake
@@ -12,7 +12,7 @@ license="BSD-2-Clause"
 homepage="https://aomedia.org/"
 changelog="https://aomedia.googlesource.com/aom/+/master/CHANGELOG"
 distfiles="https://aomedia.googlesource.com/aom/+archive/v${version}.tar.gz"
-checksum=@4e8a74ed7e05d5534ab0b72735fa670ce1a1e757bc4a777f07fdabf8629fced1
+checksum=@b89acd3304531a9f6c99eba13e1de66605893ff8d08abc8c6e0586481a90033a
 
 # aom segfaults with default musl stack size
 LDFLAGS="-Wl,-z,stack-size=2097152"
@@ -28,15 +28,25 @@ if [ -z "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DENABLE_TESTS=OFF"
 fi
 
+post_patch() {
+	# test suite assumes that git being available means it's
+	# in a git repository
+	vsed -e "s/git --version/false/" -i test/tools_common.sh
+}
+
 pre_check() {
-	mkdir -p /host/libaom-test-data
 	export LIBAOM_TEST_DATA_PATH=/host/libaom-test-data
+	mkdir -p $LIBAOM_TEST_DATA_PATH
 }
 
 do_check() {
 	cd build
-	make runtests ${makejobs}
+	make testdata ${makejobs}
 	../test/examples.sh --bin-path examples
+
+	if [ "$XBPS_CHECK_PKGS" = full ]; then
+		make runtests ${makejobs}
+	fi
 }
 
 post_install() {

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (13 preceding siblings ...)
  2020-12-08 15:37 ` ericonr
@ 2020-12-08 17:35 ` Chocimier
  2020-12-08 18:19 ` ericonr
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: Chocimier @ 2020-12-08 17:35 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/26773#issuecomment-740786669

Comment:
Not cleaning masterdir will break build of packages that use same source from different templates, like `avahi-discover` - `avahi`. Not sure should it just fail if any test fail or add mode where xbps proceeds to install, but return special exit code that is tracked then to mark job as failed.

With 3 arguments to build.sh, they can be given names, like `arch=$1` ...

FTP_RETRIES was way to fetch from ftp in travis network, it has no use now. Could you remove from build.sh while touching that?

Would be also nice to change XBPS_{,ARG_}CHECK_PKGS=1 to yes since value matters now.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (14 preceding siblings ...)
  2020-12-08 17:35 ` Chocimier
@ 2020-12-08 18:19 ` ericonr
  2020-12-12  6:54 ` [PR PATCH] [Updated] " ericonr
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-08 18:19 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/26773#issuecomment-740816864

Comment:
> Not cleaning masterdir will break build of packages that use same source from different templates, like avahi-discover - avahi. Not sure should it just fail if any test fail or add mode where xbps proceeds to install, but return special exit code that is tracked then to mark job as failed.

Argh, that's rather unfortunate.

I have also noticed an issue where any template that checks for `XBPS_CHECK_PKGS` and adds stuff to `configure_args` will fail the check phase... That might be why `libaom` itself is failing, actually.

I tried splitting check into a separate phase because @leahneukirchen requested it, and the output does look nicer, but doing everything in a single step by running `./xbps-src pkg -Q $pkg` should avoid all of these issues.

> FTP_RETRIES was way to fetch from ftp in travis network, it has no use now. Could you remove from build.sh while touching that?

Sure.

> Would be also nice to change XBPS_{,ARG_}CHECK_PKGS=1 to yes since value matters now.

Good point.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (15 preceding siblings ...)
  2020-12-08 18:19 ` ericonr
@ 2020-12-12  6:54 ` ericonr
  2020-12-14  2:20 ` ericonr
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-12  6:54 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From 059dd3205986ad4c107b1ad262ea7f37f9f625bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:42 -0300
Subject: [PATCH 1/5] xbps-src: add -K option for running the full testsuite.

Some packages have rather long test suites, with an option for a shorter
one. With this option, one can choose between shorter tests (-Q) or the
complete longer ones (-K).

This also allows CI to run only the shorter testsuites.

Make the appropriate changes to etc/default.conf and Manual.md as well.
---
 Manual.md         | 3 +++
 etc/defaults.conf | 2 ++
 xbps-src          | 5 ++++-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Manual.md b/Manual.md
index 0a3c759f59b..aa7a196d4f4 100644
--- a/Manual.md
+++ b/Manual.md
@@ -364,6 +364,9 @@ rather than additional binary package names.
 
 - `CROSS_BUILD` Set if `xbps-src` is cross compiling a package.
 
+- `XBPS_CHECK_PKGS` Set if `xbps-src` is going to run tests for a package.
+Longer testsuites should only be run in `do_check()` if it is set to `full`.
+
 - `DESTDIR` Full path to the fake destdir used by the source pkg, set to
 `<masterdir>/destdir/${sourcepkg}-${version}`.
 
diff --git a/etc/defaults.conf b/etc/defaults.conf
index 6e297903fbd..88286deaa6f 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -71,8 +71,10 @@ XBPS_SUCMD="sudo /bin/sh -c"
 
 # [OPTIONAL]
 # Enable running the (optional) do_check() function of a package.
+# When set to 'full', will enable further testing for some packages.
 #
 #XBPS_CHECK_PKGS=yes
+#XBPS_CHECK_PKGS=full
 
 # [OPTIONAL]
 # Enable building -dbg subpackages with debugging symbols. Please note
diff --git a/xbps-src b/xbps-src
index 08da501f219..c06d067c060 100755
--- a/xbps-src
+++ b/xbps-src
@@ -205,6 +205,8 @@ $(print_cross_targets)
 
 -Q  Enable running the check stage.
 
+-K  Enable running the check stage with longer tests.
+
 -q  Suppress informational output of xbps-src (build output is still printed).
 
 -r  <repo>
@@ -382,6 +384,7 @@ while getopts "$XBPS_OPTSTRING" opt; do
         p) XBPS_ARG_PRINT_VARIABLES="$OPTARG"; XBPS_OPTIONS+=" -p $OPTARG";;
         q) XBPS_ARG_QUIET=1; XBPS_OPTIONS+=" -q";;
         Q) XBPS_ARG_CHECK_PKGS=1; XBPS_OPTIONS+=" -Q";;
+        K) XBPS_ARG_CHECK_PKGS=full; XBPS_OPTIONS+=" -K";;
         r) XBPS_ARG_ALT_REPOSITORY="$OPTARG"; XBPS_OPTIONS+=" -r $OPTARG";;
         t) XBPS_ARG_TEMP_MASTERDIR=1; XBPS_OPTIONS+=" -t -C";;
         V) echo "xbps-src-$XBPS_SRC_VERSION $(xbps-uhelper -V)" && exit 0;;
@@ -459,7 +462,6 @@ fi
 [ -n "$XBPS_ARG_TEMP_MASTERDIR" ] && XBPS_TEMP_MASTERDIR=1
 [ -n "$XBPS_ARG_BINPKG_EXISTS" ] && XBPS_BINPKG_EXISTS=1
 [ -n "$XBPS_ARG_USE_GIT_REVS" ] && XBPS_USE_GIT_REVS=1
-[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS=1
 [ -n "$XBPS_ARG_DEBUG_PKGS" ] && XBPS_DEBUG_PKGS=1
 [ -n "$XBPS_ARG_SKIP_DEPS" ] && XBPS_SKIP_DEPS=1
 [ -n "$XBPS_ARG_KEEP_ALL" ] && XBPS_KEEP_ALL=1
@@ -467,6 +469,7 @@ fi
 [ -n "$XBPS_ARG_PRINT_VARIABLES" ] && XBPS_PRINT_VARIABLES="$XBPS_ARG_PRINT_VARIABLES"
 [ -n "$XBPS_ARG_ALT_REPOSITORY" ] && XBPS_ALT_REPOSITORY="$XBPS_ARG_ALT_REPOSITORY"
 [ -n "$XBPS_ARG_CROSS_BUILD" ] && XBPS_CROSS_BUILD="$XBPS_ARG_CROSS_BUILD"
+[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS="$XBPS_ARG_CHECK_PKGS"
 [ -n "$XBPS_ARG_MAKEJOBS" ] && XBPS_MAKEJOBS="$XBPS_ARG_MAKEJOBS"
 
 export XBPS_BUILD_ONLY_ONE_PKG XBPS_SKIP_REMOTEREPOS XBPS_BUILD_FORCEMODE \

From 24c52aa27e75fee5ddbb57e408f60281140a9f45 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 2/5] common/travis/fetch-xtools: make it work inside
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..0dd9e6c532c 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1

From 7a435d8a4d0740fbdf4e30a8be606b5ef78d9ff7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:30:48 -0300
Subject: [PATCH 3/5] common/travis/build.sh: add argument for running tests.

Also use nproc(1) directly.
---
 common/travis/build.sh | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..b33d95ff694 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,17 +6,16 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
-PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
-
-NPROCS=1
-if [ -r /proc/cpuinfo ]; then
-        NPROCS=$(grep ^proc /proc/cpuinfo|wc -l)
+if [ "$3" = 1 ]; then
+	test="-Q"
 fi
 
+PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
+
 export FTP_RETRIES=10
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From 35e39a951481d9639bff1d4a3f1dc27e09cf34a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 4/5] .github/workflows: run tests on CI for native builds.

Also fix "list contents" step by adding a fetch-xtools step.
---
 .github/workflows/build.yaml | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 33186037f8d..587060103f7 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -68,14 +69,15 @@ jobs:
       - run: common/travis/fetch_upstream.sh
       - run: common/travis/changed_templates.sh
 
-      - name: Build packages
+      - name: Build and check packages
         run: |
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
+      - run: common/travis/fetch-xtools.sh
       - name: Show files
         run: |
           (

From 0d4ce46a6649657343e4e3b04fa32ca7ce141452 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:12 -0300
Subject: [PATCH 5/5] libaom: split tests by duration.

---
 srcpkgs/libaom/template | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/libaom/template b/srcpkgs/libaom/template
index 93f1983edfc..a8a9b5d869e 100644
--- a/srcpkgs/libaom/template
+++ b/srcpkgs/libaom/template
@@ -1,6 +1,6 @@
 # Template file for 'libaom'
 pkgname=libaom
-version=2.0.0
+version=2.0.1
 revision=1
 create_wrksrc=yes
 build_style=cmake
@@ -12,7 +12,7 @@ license="BSD-2-Clause"
 homepage="https://aomedia.org/"
 changelog="https://aomedia.googlesource.com/aom/+/master/CHANGELOG"
 distfiles="https://aomedia.googlesource.com/aom/+archive/v${version}.tar.gz"
-checksum=@4e8a74ed7e05d5534ab0b72735fa670ce1a1e757bc4a777f07fdabf8629fced1
+checksum=@b89acd3304531a9f6c99eba13e1de66605893ff8d08abc8c6e0586481a90033a
 
 # aom segfaults with default musl stack size
 LDFLAGS="-Wl,-z,stack-size=2097152"
@@ -28,15 +28,25 @@ if [ -z "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DENABLE_TESTS=OFF"
 fi
 
+post_patch() {
+	# test suite assumes that git being available means it's
+	# in a git repository
+	vsed -e "s/git --version/false/" -i test/tools_common.sh
+}
+
 pre_check() {
-	mkdir -p /host/libaom-test-data
 	export LIBAOM_TEST_DATA_PATH=/host/libaom-test-data
+	mkdir -p $LIBAOM_TEST_DATA_PATH
 }
 
 do_check() {
 	cd build
-	make runtests ${makejobs}
+	make testdata ${makejobs}
 	../test/examples.sh --bin-path examples
+
+	if [ "$XBPS_CHECK_PKGS" = full ]; then
+		make runtests ${makejobs}
+	fi
 }
 
 post_install() {

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (16 preceding siblings ...)
  2020-12-12  6:54 ` [PR PATCH] [Updated] " ericonr
@ 2020-12-14  2:20 ` ericonr
  2020-12-14  2:22 ` [PR REVIEW] " sgn
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-14  2:20 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From 7551f96a4b8f2339d41a3f7589c0d6649041aab3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:42 -0300
Subject: [PATCH 1/5] xbps-src: add -K option for running the full testsuite.

Some packages have rather long test suites, with an option for a shorter
one. With this option, one can choose between shorter tests (-Q) or the
complete longer ones (-K).

This also allows CI to run only the shorter testsuites.

Make the appropriate changes to etc/default.conf and Manual.md as well.
---
 Manual.md         | 3 +++
 etc/defaults.conf | 2 ++
 xbps-src          | 7 +++++--
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Manual.md b/Manual.md
index 0a3c759f59b..aa7a196d4f4 100644
--- a/Manual.md
+++ b/Manual.md
@@ -364,6 +364,9 @@ rather than additional binary package names.
 
 - `CROSS_BUILD` Set if `xbps-src` is cross compiling a package.
 
+- `XBPS_CHECK_PKGS` Set if `xbps-src` is going to run tests for a package.
+Longer testsuites should only be run in `do_check()` if it is set to `full`.
+
 - `DESTDIR` Full path to the fake destdir used by the source pkg, set to
 `<masterdir>/destdir/${sourcepkg}-${version}`.
 
diff --git a/etc/defaults.conf b/etc/defaults.conf
index 6e297903fbd..88286deaa6f 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -71,8 +71,10 @@ XBPS_SUCMD="sudo /bin/sh -c"
 
 # [OPTIONAL]
 # Enable running the (optional) do_check() function of a package.
+# When set to 'full', will enable further testing for some packages.
 #
 #XBPS_CHECK_PKGS=yes
+#XBPS_CHECK_PKGS=full
 
 # [OPTIONAL]
 # Enable building -dbg subpackages with debugging symbols. Please note
diff --git a/xbps-src b/xbps-src
index 08da501f219..54016874010 100755
--- a/xbps-src
+++ b/xbps-src
@@ -205,6 +205,8 @@ $(print_cross_targets)
 
 -Q  Enable running the check stage.
 
+-K  Enable running the check stage with longer tests.
+
 -q  Suppress informational output of xbps-src (build output is still printed).
 
 -r  <repo>
@@ -381,7 +383,8 @@ while getopts "$XBPS_OPTSTRING" opt; do
         o) XBPS_ARG_PKG_OPTIONS="$OPTARG"; XBPS_OPTIONS+=" -o $OPTARG";;
         p) XBPS_ARG_PRINT_VARIABLES="$OPTARG"; XBPS_OPTIONS+=" -p $OPTARG";;
         q) XBPS_ARG_QUIET=1; XBPS_OPTIONS+=" -q";;
-        Q) XBPS_ARG_CHECK_PKGS=1; XBPS_OPTIONS+=" -Q";;
+        Q) XBPS_ARG_CHECK_PKGS=yes; XBPS_OPTIONS+=" -Q";;
+        K) XBPS_ARG_CHECK_PKGS=full; XBPS_OPTIONS+=" -K";;
         r) XBPS_ARG_ALT_REPOSITORY="$OPTARG"; XBPS_OPTIONS+=" -r $OPTARG";;
         t) XBPS_ARG_TEMP_MASTERDIR=1; XBPS_OPTIONS+=" -t -C";;
         V) echo "xbps-src-$XBPS_SRC_VERSION $(xbps-uhelper -V)" && exit 0;;
@@ -459,7 +462,6 @@ fi
 [ -n "$XBPS_ARG_TEMP_MASTERDIR" ] && XBPS_TEMP_MASTERDIR=1
 [ -n "$XBPS_ARG_BINPKG_EXISTS" ] && XBPS_BINPKG_EXISTS=1
 [ -n "$XBPS_ARG_USE_GIT_REVS" ] && XBPS_USE_GIT_REVS=1
-[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS=1
 [ -n "$XBPS_ARG_DEBUG_PKGS" ] && XBPS_DEBUG_PKGS=1
 [ -n "$XBPS_ARG_SKIP_DEPS" ] && XBPS_SKIP_DEPS=1
 [ -n "$XBPS_ARG_KEEP_ALL" ] && XBPS_KEEP_ALL=1
@@ -467,6 +469,7 @@ fi
 [ -n "$XBPS_ARG_PRINT_VARIABLES" ] && XBPS_PRINT_VARIABLES="$XBPS_ARG_PRINT_VARIABLES"
 [ -n "$XBPS_ARG_ALT_REPOSITORY" ] && XBPS_ALT_REPOSITORY="$XBPS_ARG_ALT_REPOSITORY"
 [ -n "$XBPS_ARG_CROSS_BUILD" ] && XBPS_CROSS_BUILD="$XBPS_ARG_CROSS_BUILD"
+[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS="$XBPS_ARG_CHECK_PKGS"
 [ -n "$XBPS_ARG_MAKEJOBS" ] && XBPS_MAKEJOBS="$XBPS_ARG_MAKEJOBS"
 
 export XBPS_BUILD_ONLY_ONE_PKG XBPS_SKIP_REMOTEREPOS XBPS_BUILD_FORCEMODE \

From 1e9acc22f1a6ea4be8ea272f41b82c75d6def913 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 2/5] common/travis/fetch-xtools: make it work inside
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..0dd9e6c532c 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1

From 84aad24bd89a4ffb13d323aad942eba726b8e9e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:30:48 -0300
Subject: [PATCH 3/5] common/travis/build.sh: add argument for running tests.

Also use nproc(1) directly and remove FTP_RETRIES.
---
 common/travis/build.sh | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..f5cf9cffc06 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,17 +6,14 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
-PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
-
-NPROCS=1
-if [ -r /proc/cpuinfo ]; then
-        NPROCS=$(grep ^proc /proc/cpuinfo|wc -l)
+if [ "$3" = 1 ]; then
+	test="-Q"
 fi
 
-export FTP_RETRIES=10
+PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From 401e76b844ac2e91fa975fbbabcb65ac61933664 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 4/5] .github/workflows: run tests on CI for native builds.

Also fix "list contents" step by adding a fetch-xtools step.
---
 .github/workflows/build.yaml | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 8535d3b24b1..fa0137554d4 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -68,14 +69,15 @@ jobs:
       - run: common/travis/fetch_upstream.sh
       - run: common/travis/changed_templates.sh
 
-      - name: Build packages
+      - name: Build and check packages
         run: |
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
+      - run: common/travis/fetch-xtools.sh
       - name: Show files
         run: |
           (

From 5db5634ad3c1ba87e909c46e45bb3fd4e036130c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:12 -0300
Subject: [PATCH 5/5] libaom: split tests by duration.

---
 srcpkgs/libaom/template | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/libaom/template b/srcpkgs/libaom/template
index 93f1983edfc..a8a9b5d869e 100644
--- a/srcpkgs/libaom/template
+++ b/srcpkgs/libaom/template
@@ -1,6 +1,6 @@
 # Template file for 'libaom'
 pkgname=libaom
-version=2.0.0
+version=2.0.1
 revision=1
 create_wrksrc=yes
 build_style=cmake
@@ -12,7 +12,7 @@ license="BSD-2-Clause"
 homepage="https://aomedia.org/"
 changelog="https://aomedia.googlesource.com/aom/+/master/CHANGELOG"
 distfiles="https://aomedia.googlesource.com/aom/+archive/v${version}.tar.gz"
-checksum=@4e8a74ed7e05d5534ab0b72735fa670ce1a1e757bc4a777f07fdabf8629fced1
+checksum=@b89acd3304531a9f6c99eba13e1de66605893ff8d08abc8c6e0586481a90033a
 
 # aom segfaults with default musl stack size
 LDFLAGS="-Wl,-z,stack-size=2097152"
@@ -28,15 +28,25 @@ if [ -z "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DENABLE_TESTS=OFF"
 fi
 
+post_patch() {
+	# test suite assumes that git being available means it's
+	# in a git repository
+	vsed -e "s/git --version/false/" -i test/tools_common.sh
+}
+
 pre_check() {
-	mkdir -p /host/libaom-test-data
 	export LIBAOM_TEST_DATA_PATH=/host/libaom-test-data
+	mkdir -p $LIBAOM_TEST_DATA_PATH
 }
 
 do_check() {
 	cd build
-	make runtests ${makejobs}
+	make testdata ${makejobs}
 	../test/examples.sh --bin-path examples
+
+	if [ "$XBPS_CHECK_PKGS" = full ]; then
+		make runtests ${makejobs}
+	fi
 }
 
 post_install() {

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR REVIEW] [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (17 preceding siblings ...)
  2020-12-14  2:20 ` ericonr
@ 2020-12-14  2:22 ` sgn
  2020-12-14  2:25 ` ericonr
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: sgn @ 2020-12-14  2:22 UTC (permalink / raw)
  To: ml

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

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/26773#discussion_r542068570

Comment:
For GNU `tar`, we can use old `--wildcards "xtools-master/x*"`, for `bsdtar`, we can use `"xtools-master/x*"` as the pattern (aka final argument).

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR REVIEW] [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (18 preceding siblings ...)
  2020-12-14  2:22 ` [PR REVIEW] " sgn
@ 2020-12-14  2:25 ` ericonr
  2020-12-14  2:36 ` [PR PATCH] [Updated] " ericonr
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-14  2:25 UTC (permalink / raw)
  To: ml

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

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/26773#discussion_r542069487

Comment:
I decided to completely omit the wildcards, because the only extra files aren't executable nor have important names, so they wouldn't influence anything...

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (19 preceding siblings ...)
  2020-12-14  2:25 ` ericonr
@ 2020-12-14  2:36 ` ericonr
  2020-12-14  2:49 ` ericonr
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-14  2:36 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From 7551f96a4b8f2339d41a3f7589c0d6649041aab3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:42 -0300
Subject: [PATCH 1/5] xbps-src: add -K option for running the full testsuite.

Some packages have rather long test suites, with an option for a shorter
one. With this option, one can choose between shorter tests (-Q) or the
complete longer ones (-K).

This also allows CI to run only the shorter testsuites.

Make the appropriate changes to etc/default.conf and Manual.md as well.
---
 Manual.md         | 3 +++
 etc/defaults.conf | 2 ++
 xbps-src          | 7 +++++--
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Manual.md b/Manual.md
index 0a3c759f59b..aa7a196d4f4 100644
--- a/Manual.md
+++ b/Manual.md
@@ -364,6 +364,9 @@ rather than additional binary package names.
 
 - `CROSS_BUILD` Set if `xbps-src` is cross compiling a package.
 
+- `XBPS_CHECK_PKGS` Set if `xbps-src` is going to run tests for a package.
+Longer testsuites should only be run in `do_check()` if it is set to `full`.
+
 - `DESTDIR` Full path to the fake destdir used by the source pkg, set to
 `<masterdir>/destdir/${sourcepkg}-${version}`.
 
diff --git a/etc/defaults.conf b/etc/defaults.conf
index 6e297903fbd..88286deaa6f 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -71,8 +71,10 @@ XBPS_SUCMD="sudo /bin/sh -c"
 
 # [OPTIONAL]
 # Enable running the (optional) do_check() function of a package.
+# When set to 'full', will enable further testing for some packages.
 #
 #XBPS_CHECK_PKGS=yes
+#XBPS_CHECK_PKGS=full
 
 # [OPTIONAL]
 # Enable building -dbg subpackages with debugging symbols. Please note
diff --git a/xbps-src b/xbps-src
index 08da501f219..54016874010 100755
--- a/xbps-src
+++ b/xbps-src
@@ -205,6 +205,8 @@ $(print_cross_targets)
 
 -Q  Enable running the check stage.
 
+-K  Enable running the check stage with longer tests.
+
 -q  Suppress informational output of xbps-src (build output is still printed).
 
 -r  <repo>
@@ -381,7 +383,8 @@ while getopts "$XBPS_OPTSTRING" opt; do
         o) XBPS_ARG_PKG_OPTIONS="$OPTARG"; XBPS_OPTIONS+=" -o $OPTARG";;
         p) XBPS_ARG_PRINT_VARIABLES="$OPTARG"; XBPS_OPTIONS+=" -p $OPTARG";;
         q) XBPS_ARG_QUIET=1; XBPS_OPTIONS+=" -q";;
-        Q) XBPS_ARG_CHECK_PKGS=1; XBPS_OPTIONS+=" -Q";;
+        Q) XBPS_ARG_CHECK_PKGS=yes; XBPS_OPTIONS+=" -Q";;
+        K) XBPS_ARG_CHECK_PKGS=full; XBPS_OPTIONS+=" -K";;
         r) XBPS_ARG_ALT_REPOSITORY="$OPTARG"; XBPS_OPTIONS+=" -r $OPTARG";;
         t) XBPS_ARG_TEMP_MASTERDIR=1; XBPS_OPTIONS+=" -t -C";;
         V) echo "xbps-src-$XBPS_SRC_VERSION $(xbps-uhelper -V)" && exit 0;;
@@ -459,7 +462,6 @@ fi
 [ -n "$XBPS_ARG_TEMP_MASTERDIR" ] && XBPS_TEMP_MASTERDIR=1
 [ -n "$XBPS_ARG_BINPKG_EXISTS" ] && XBPS_BINPKG_EXISTS=1
 [ -n "$XBPS_ARG_USE_GIT_REVS" ] && XBPS_USE_GIT_REVS=1
-[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS=1
 [ -n "$XBPS_ARG_DEBUG_PKGS" ] && XBPS_DEBUG_PKGS=1
 [ -n "$XBPS_ARG_SKIP_DEPS" ] && XBPS_SKIP_DEPS=1
 [ -n "$XBPS_ARG_KEEP_ALL" ] && XBPS_KEEP_ALL=1
@@ -467,6 +469,7 @@ fi
 [ -n "$XBPS_ARG_PRINT_VARIABLES" ] && XBPS_PRINT_VARIABLES="$XBPS_ARG_PRINT_VARIABLES"
 [ -n "$XBPS_ARG_ALT_REPOSITORY" ] && XBPS_ALT_REPOSITORY="$XBPS_ARG_ALT_REPOSITORY"
 [ -n "$XBPS_ARG_CROSS_BUILD" ] && XBPS_CROSS_BUILD="$XBPS_ARG_CROSS_BUILD"
+[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS="$XBPS_ARG_CHECK_PKGS"
 [ -n "$XBPS_ARG_MAKEJOBS" ] && XBPS_MAKEJOBS="$XBPS_ARG_MAKEJOBS"
 
 export XBPS_BUILD_ONLY_ONE_PKG XBPS_SKIP_REMOTEREPOS XBPS_BUILD_FORCEMODE \

From 1e9acc22f1a6ea4be8ea272f41b82c75d6def913 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 2/5] common/travis/fetch-xtools: make it work inside
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..0dd9e6c532c 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1

From 84aad24bd89a4ffb13d323aad942eba726b8e9e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:30:48 -0300
Subject: [PATCH 3/5] common/travis/build.sh: add argument for running tests.

Also use nproc(1) directly and remove FTP_RETRIES.
---
 common/travis/build.sh | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..f5cf9cffc06 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,17 +6,14 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
-PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
-
-NPROCS=1
-if [ -r /proc/cpuinfo ]; then
-        NPROCS=$(grep ^proc /proc/cpuinfo|wc -l)
+if [ "$3" = 1 ]; then
+	test="-Q"
 fi
 
-export FTP_RETRIES=10
+PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From 7dcc2e0472cadc4f07d1380ffef7fba85bdc3d07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 4/5] .github/workflows: run tests on CI for native builds.

Also:
- fix "list contents" step by adding a fetch-xtools step.
- remove git from masterdir to not interfere with builds (thanks @sgn)
---
 .github/workflows/build.yaml | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 8535d3b24b1..d1dff5afc7c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -56,24 +57,27 @@ jobs:
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
           # Install git
-          xbps-install -y git xtools
+          xbps-install -y git
 
       - uses: actions/checkout@v1
         with:
           fetch-depth: 200
+      - name: Remove git after checkout to not interfere with build
+        run: xbps-remove -R git
       - name: Create hostrepo
         run: ln -s "$(pwd)" /hostrepo
       - run: common/travis/set_mirror.sh
       - run: common/travis/prepare.sh
       - run: common/travis/fetch_upstream.sh
       - run: common/travis/changed_templates.sh
+      - run: common/travis/fetch-xtools.sh
 
-      - name: Build packages
+      - name: Build and check packages
         run: |
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
       - name: Show files

From 25eaf0d0b6e207115a2b6d8d6f0a80aeea80e4ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:12 -0300
Subject: [PATCH 5/5] libaom: split tests by duration.

---
 srcpkgs/libaom/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/libaom/template b/srcpkgs/libaom/template
index 93f1983edfc..657301c7309 100644
--- a/srcpkgs/libaom/template
+++ b/srcpkgs/libaom/template
@@ -1,6 +1,6 @@
 # Template file for 'libaom'
 pkgname=libaom
-version=2.0.0
+version=2.0.1
 revision=1
 create_wrksrc=yes
 build_style=cmake
@@ -12,7 +12,7 @@ license="BSD-2-Clause"
 homepage="https://aomedia.org/"
 changelog="https://aomedia.googlesource.com/aom/+/master/CHANGELOG"
 distfiles="https://aomedia.googlesource.com/aom/+archive/v${version}.tar.gz"
-checksum=@4e8a74ed7e05d5534ab0b72735fa670ce1a1e757bc4a777f07fdabf8629fced1
+checksum=@b89acd3304531a9f6c99eba13e1de66605893ff8d08abc8c6e0586481a90033a
 
 # aom segfaults with default musl stack size
 LDFLAGS="-Wl,-z,stack-size=2097152"
@@ -29,14 +29,18 @@ if [ -z "$XBPS_CHECK_PKGS" ]; then
 fi
 
 pre_check() {
-	mkdir -p /host/libaom-test-data
 	export LIBAOM_TEST_DATA_PATH=/host/libaom-test-data
+	mkdir -p $LIBAOM_TEST_DATA_PATH
 }
 
 do_check() {
 	cd build
-	make runtests ${makejobs}
+	make testdata ${makejobs}
 	../test/examples.sh --bin-path examples
+
+	if [ "$XBPS_CHECK_PKGS" = full ]; then
+		make runtests ${makejobs}
+	fi
 }
 
 post_install() {

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (20 preceding siblings ...)
  2020-12-14  2:36 ` [PR PATCH] [Updated] " ericonr
@ 2020-12-14  2:49 ` ericonr
  2020-12-14  2:51 ` ericonr
  2020-12-14  3:18 ` [PR PATCH] [Merged]: " ericonr
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-14  2:49 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From 7551f96a4b8f2339d41a3f7589c0d6649041aab3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:42 -0300
Subject: [PATCH 1/5] xbps-src: add -K option for running the full testsuite.

Some packages have rather long test suites, with an option for a shorter
one. With this option, one can choose between shorter tests (-Q) or the
complete longer ones (-K).

This also allows CI to run only the shorter testsuites.

Make the appropriate changes to etc/default.conf and Manual.md as well.
---
 Manual.md         | 3 +++
 etc/defaults.conf | 2 ++
 xbps-src          | 7 +++++--
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Manual.md b/Manual.md
index 0a3c759f59b..aa7a196d4f4 100644
--- a/Manual.md
+++ b/Manual.md
@@ -364,6 +364,9 @@ rather than additional binary package names.
 
 - `CROSS_BUILD` Set if `xbps-src` is cross compiling a package.
 
+- `XBPS_CHECK_PKGS` Set if `xbps-src` is going to run tests for a package.
+Longer testsuites should only be run in `do_check()` if it is set to `full`.
+
 - `DESTDIR` Full path to the fake destdir used by the source pkg, set to
 `<masterdir>/destdir/${sourcepkg}-${version}`.
 
diff --git a/etc/defaults.conf b/etc/defaults.conf
index 6e297903fbd..88286deaa6f 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -71,8 +71,10 @@ XBPS_SUCMD="sudo /bin/sh -c"
 
 # [OPTIONAL]
 # Enable running the (optional) do_check() function of a package.
+# When set to 'full', will enable further testing for some packages.
 #
 #XBPS_CHECK_PKGS=yes
+#XBPS_CHECK_PKGS=full
 
 # [OPTIONAL]
 # Enable building -dbg subpackages with debugging symbols. Please note
diff --git a/xbps-src b/xbps-src
index 08da501f219..54016874010 100755
--- a/xbps-src
+++ b/xbps-src
@@ -205,6 +205,8 @@ $(print_cross_targets)
 
 -Q  Enable running the check stage.
 
+-K  Enable running the check stage with longer tests.
+
 -q  Suppress informational output of xbps-src (build output is still printed).
 
 -r  <repo>
@@ -381,7 +383,8 @@ while getopts "$XBPS_OPTSTRING" opt; do
         o) XBPS_ARG_PKG_OPTIONS="$OPTARG"; XBPS_OPTIONS+=" -o $OPTARG";;
         p) XBPS_ARG_PRINT_VARIABLES="$OPTARG"; XBPS_OPTIONS+=" -p $OPTARG";;
         q) XBPS_ARG_QUIET=1; XBPS_OPTIONS+=" -q";;
-        Q) XBPS_ARG_CHECK_PKGS=1; XBPS_OPTIONS+=" -Q";;
+        Q) XBPS_ARG_CHECK_PKGS=yes; XBPS_OPTIONS+=" -Q";;
+        K) XBPS_ARG_CHECK_PKGS=full; XBPS_OPTIONS+=" -K";;
         r) XBPS_ARG_ALT_REPOSITORY="$OPTARG"; XBPS_OPTIONS+=" -r $OPTARG";;
         t) XBPS_ARG_TEMP_MASTERDIR=1; XBPS_OPTIONS+=" -t -C";;
         V) echo "xbps-src-$XBPS_SRC_VERSION $(xbps-uhelper -V)" && exit 0;;
@@ -459,7 +462,6 @@ fi
 [ -n "$XBPS_ARG_TEMP_MASTERDIR" ] && XBPS_TEMP_MASTERDIR=1
 [ -n "$XBPS_ARG_BINPKG_EXISTS" ] && XBPS_BINPKG_EXISTS=1
 [ -n "$XBPS_ARG_USE_GIT_REVS" ] && XBPS_USE_GIT_REVS=1
-[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS=1
 [ -n "$XBPS_ARG_DEBUG_PKGS" ] && XBPS_DEBUG_PKGS=1
 [ -n "$XBPS_ARG_SKIP_DEPS" ] && XBPS_SKIP_DEPS=1
 [ -n "$XBPS_ARG_KEEP_ALL" ] && XBPS_KEEP_ALL=1
@@ -467,6 +469,7 @@ fi
 [ -n "$XBPS_ARG_PRINT_VARIABLES" ] && XBPS_PRINT_VARIABLES="$XBPS_ARG_PRINT_VARIABLES"
 [ -n "$XBPS_ARG_ALT_REPOSITORY" ] && XBPS_ALT_REPOSITORY="$XBPS_ARG_ALT_REPOSITORY"
 [ -n "$XBPS_ARG_CROSS_BUILD" ] && XBPS_CROSS_BUILD="$XBPS_ARG_CROSS_BUILD"
+[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS="$XBPS_ARG_CHECK_PKGS"
 [ -n "$XBPS_ARG_MAKEJOBS" ] && XBPS_MAKEJOBS="$XBPS_ARG_MAKEJOBS"
 
 export XBPS_BUILD_ONLY_ONE_PKG XBPS_SKIP_REMOTEREPOS XBPS_BUILD_FORCEMODE \

From 1e9acc22f1a6ea4be8ea272f41b82c75d6def913 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 2/5] common/travis/fetch-xtools: make it work inside
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..0dd9e6c532c 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1

From 84aad24bd89a4ffb13d323aad942eba726b8e9e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:30:48 -0300
Subject: [PATCH 3/5] common/travis/build.sh: add argument for running tests.

Also use nproc(1) directly and remove FTP_RETRIES.
---
 common/travis/build.sh | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..f5cf9cffc06 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,17 +6,14 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
-PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
-
-NPROCS=1
-if [ -r /proc/cpuinfo ]; then
-        NPROCS=$(grep ^proc /proc/cpuinfo|wc -l)
+if [ "$3" = 1 ]; then
+	test="-Q"
 fi
 
-export FTP_RETRIES=10
+PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From 6bd6315c05cda13a991e52a2611ed23aa2e09cb5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 4/5] .github/workflows: run tests on CI for native builds.

Also:
- fix "list contents" step by adding a fetch-xtools step.
- remove git from masterdir to not interfere with builds (thanks @sgn)
---
 .github/workflows/build.yaml | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 8535d3b24b1..ddced9e4f56 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -56,24 +57,27 @@ jobs:
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
           # Install git
-          xbps-install -y git xtools
+          xbps-install -y git
 
       - uses: actions/checkout@v1
         with:
           fetch-depth: 200
+      - name: Remove git after checkout to not interfere with build
+        run: xbps-remove -yR git
       - name: Create hostrepo
         run: ln -s "$(pwd)" /hostrepo
       - run: common/travis/set_mirror.sh
       - run: common/travis/prepare.sh
       - run: common/travis/fetch_upstream.sh
       - run: common/travis/changed_templates.sh
+      - run: common/travis/fetch-xtools.sh
 
-      - name: Build packages
+      - name: Build and check packages
         run: |
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
       - name: Show files

From 1c4bb9cdc779fc49ca60c7a1b01e690d34ba3dcf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:12 -0300
Subject: [PATCH 5/5] libaom: split tests by duration.

---
 srcpkgs/libaom/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/libaom/template b/srcpkgs/libaom/template
index 93f1983edfc..657301c7309 100644
--- a/srcpkgs/libaom/template
+++ b/srcpkgs/libaom/template
@@ -1,6 +1,6 @@
 # Template file for 'libaom'
 pkgname=libaom
-version=2.0.0
+version=2.0.1
 revision=1
 create_wrksrc=yes
 build_style=cmake
@@ -12,7 +12,7 @@ license="BSD-2-Clause"
 homepage="https://aomedia.org/"
 changelog="https://aomedia.googlesource.com/aom/+/master/CHANGELOG"
 distfiles="https://aomedia.googlesource.com/aom/+archive/v${version}.tar.gz"
-checksum=@4e8a74ed7e05d5534ab0b72735fa670ce1a1e757bc4a777f07fdabf8629fced1
+checksum=@b89acd3304531a9f6c99eba13e1de66605893ff8d08abc8c6e0586481a90033a
 
 # aom segfaults with default musl stack size
 LDFLAGS="-Wl,-z,stack-size=2097152"
@@ -29,14 +29,18 @@ if [ -z "$XBPS_CHECK_PKGS" ]; then
 fi
 
 pre_check() {
-	mkdir -p /host/libaom-test-data
 	export LIBAOM_TEST_DATA_PATH=/host/libaom-test-data
+	mkdir -p $LIBAOM_TEST_DATA_PATH
 }
 
 do_check() {
 	cd build
-	make runtests ${makejobs}
+	make testdata ${makejobs}
 	../test/examples.sh --bin-path examples
+
+	if [ "$XBPS_CHECK_PKGS" = full ]; then
+		make runtests ${makejobs}
+	fi
 }
 
 post_install() {

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (21 preceding siblings ...)
  2020-12-14  2:49 ` ericonr
@ 2020-12-14  2:51 ` ericonr
  2020-12-14  3:18 ` [PR PATCH] [Merged]: " ericonr
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-14  2:51 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From 7551f96a4b8f2339d41a3f7589c0d6649041aab3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:42 -0300
Subject: [PATCH 1/5] xbps-src: add -K option for running the full testsuite.

Some packages have rather long test suites, with an option for a shorter
one. With this option, one can choose between shorter tests (-Q) or the
complete longer ones (-K).

This also allows CI to run only the shorter testsuites.

Make the appropriate changes to etc/default.conf and Manual.md as well.
---
 Manual.md         | 3 +++
 etc/defaults.conf | 2 ++
 xbps-src          | 7 +++++--
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Manual.md b/Manual.md
index 0a3c759f59b..aa7a196d4f4 100644
--- a/Manual.md
+++ b/Manual.md
@@ -364,6 +364,9 @@ rather than additional binary package names.
 
 - `CROSS_BUILD` Set if `xbps-src` is cross compiling a package.
 
+- `XBPS_CHECK_PKGS` Set if `xbps-src` is going to run tests for a package.
+Longer testsuites should only be run in `do_check()` if it is set to `full`.
+
 - `DESTDIR` Full path to the fake destdir used by the source pkg, set to
 `<masterdir>/destdir/${sourcepkg}-${version}`.
 
diff --git a/etc/defaults.conf b/etc/defaults.conf
index 6e297903fbd..88286deaa6f 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -71,8 +71,10 @@ XBPS_SUCMD="sudo /bin/sh -c"
 
 # [OPTIONAL]
 # Enable running the (optional) do_check() function of a package.
+# When set to 'full', will enable further testing for some packages.
 #
 #XBPS_CHECK_PKGS=yes
+#XBPS_CHECK_PKGS=full
 
 # [OPTIONAL]
 # Enable building -dbg subpackages with debugging symbols. Please note
diff --git a/xbps-src b/xbps-src
index 08da501f219..54016874010 100755
--- a/xbps-src
+++ b/xbps-src
@@ -205,6 +205,8 @@ $(print_cross_targets)
 
 -Q  Enable running the check stage.
 
+-K  Enable running the check stage with longer tests.
+
 -q  Suppress informational output of xbps-src (build output is still printed).
 
 -r  <repo>
@@ -381,7 +383,8 @@ while getopts "$XBPS_OPTSTRING" opt; do
         o) XBPS_ARG_PKG_OPTIONS="$OPTARG"; XBPS_OPTIONS+=" -o $OPTARG";;
         p) XBPS_ARG_PRINT_VARIABLES="$OPTARG"; XBPS_OPTIONS+=" -p $OPTARG";;
         q) XBPS_ARG_QUIET=1; XBPS_OPTIONS+=" -q";;
-        Q) XBPS_ARG_CHECK_PKGS=1; XBPS_OPTIONS+=" -Q";;
+        Q) XBPS_ARG_CHECK_PKGS=yes; XBPS_OPTIONS+=" -Q";;
+        K) XBPS_ARG_CHECK_PKGS=full; XBPS_OPTIONS+=" -K";;
         r) XBPS_ARG_ALT_REPOSITORY="$OPTARG"; XBPS_OPTIONS+=" -r $OPTARG";;
         t) XBPS_ARG_TEMP_MASTERDIR=1; XBPS_OPTIONS+=" -t -C";;
         V) echo "xbps-src-$XBPS_SRC_VERSION $(xbps-uhelper -V)" && exit 0;;
@@ -459,7 +462,6 @@ fi
 [ -n "$XBPS_ARG_TEMP_MASTERDIR" ] && XBPS_TEMP_MASTERDIR=1
 [ -n "$XBPS_ARG_BINPKG_EXISTS" ] && XBPS_BINPKG_EXISTS=1
 [ -n "$XBPS_ARG_USE_GIT_REVS" ] && XBPS_USE_GIT_REVS=1
-[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS=1
 [ -n "$XBPS_ARG_DEBUG_PKGS" ] && XBPS_DEBUG_PKGS=1
 [ -n "$XBPS_ARG_SKIP_DEPS" ] && XBPS_SKIP_DEPS=1
 [ -n "$XBPS_ARG_KEEP_ALL" ] && XBPS_KEEP_ALL=1
@@ -467,6 +469,7 @@ fi
 [ -n "$XBPS_ARG_PRINT_VARIABLES" ] && XBPS_PRINT_VARIABLES="$XBPS_ARG_PRINT_VARIABLES"
 [ -n "$XBPS_ARG_ALT_REPOSITORY" ] && XBPS_ALT_REPOSITORY="$XBPS_ARG_ALT_REPOSITORY"
 [ -n "$XBPS_ARG_CROSS_BUILD" ] && XBPS_CROSS_BUILD="$XBPS_ARG_CROSS_BUILD"
+[ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS="$XBPS_ARG_CHECK_PKGS"
 [ -n "$XBPS_ARG_MAKEJOBS" ] && XBPS_MAKEJOBS="$XBPS_ARG_MAKEJOBS"
 
 export XBPS_BUILD_ONLY_ONE_PKG XBPS_SKIP_REMOTEREPOS XBPS_BUILD_FORCEMODE \

From 1e9acc22f1a6ea4be8ea272f41b82c75d6def913 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 2/5] common/travis/fetch-xtools: make it work inside
 masterdir.

---
 common/travis/fetch-xtools.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..0dd9e6c532c 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,18 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
-	--strip-components=1 || exit 1
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1

From 84aad24bd89a4ffb13d323aad942eba726b8e9e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:30:48 -0300
Subject: [PATCH 3/5] common/travis/build.sh: add argument for running tests.

Also use nproc(1) directly and remove FTP_RETRIES.
---
 common/travis/build.sh | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..f5cf9cffc06 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,17 +6,14 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
-PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
-
-NPROCS=1
-if [ -r /proc/cpuinfo ]; then
-        NPROCS=$(grep ^proc /proc/cpuinfo|wc -l)
+if [ "$3" = 1 ]; then
+	test="-Q"
 fi
 
-export FTP_RETRIES=10
+PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$(nproc) -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From ccf0545319ff51764d785988b36e7080b5e42c6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 4/5] .github/workflows: run tests on CI for native builds.

Also:
- fix "list contents" step by adding a fetch-xtools step.
- remove git from masterdir to not interfere with builds (thanks @sgn)
---
 .github/workflows/build.yaml | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 8535d3b24b1..be2fd7969db 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -56,7 +57,7 @@ jobs:
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
           # Install git
-          xbps-install -y git xtools
+          xbps-install -y git
 
       - uses: actions/checkout@v1
         with:
@@ -67,13 +68,16 @@ jobs:
       - run: common/travis/prepare.sh
       - run: common/travis/fetch_upstream.sh
       - run: common/travis/changed_templates.sh
+      - run: common/travis/fetch-xtools.sh
+      - name: Remove git after checkout to not interfere with build
+        run: xbps-remove -yR git
 
-      - name: Build packages
+      - name: Build and check packages
         run: |
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
       - name: Show files

From d3942ade080dd35e2caee64d5133f6b7cea00b76 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Mon, 7 Dec 2020 20:15:12 -0300
Subject: [PATCH 5/5] libaom: split tests by duration.

---
 srcpkgs/libaom/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/libaom/template b/srcpkgs/libaom/template
index 93f1983edfc..657301c7309 100644
--- a/srcpkgs/libaom/template
+++ b/srcpkgs/libaom/template
@@ -1,6 +1,6 @@
 # Template file for 'libaom'
 pkgname=libaom
-version=2.0.0
+version=2.0.1
 revision=1
 create_wrksrc=yes
 build_style=cmake
@@ -12,7 +12,7 @@ license="BSD-2-Clause"
 homepage="https://aomedia.org/"
 changelog="https://aomedia.googlesource.com/aom/+/master/CHANGELOG"
 distfiles="https://aomedia.googlesource.com/aom/+archive/v${version}.tar.gz"
-checksum=@4e8a74ed7e05d5534ab0b72735fa670ce1a1e757bc4a777f07fdabf8629fced1
+checksum=@b89acd3304531a9f6c99eba13e1de66605893ff8d08abc8c6e0586481a90033a
 
 # aom segfaults with default musl stack size
 LDFLAGS="-Wl,-z,stack-size=2097152"
@@ -29,14 +29,18 @@ if [ -z "$XBPS_CHECK_PKGS" ]; then
 fi
 
 pre_check() {
-	mkdir -p /host/libaom-test-data
 	export LIBAOM_TEST_DATA_PATH=/host/libaom-test-data
+	mkdir -p $LIBAOM_TEST_DATA_PATH
 }
 
 do_check() {
 	cd build
-	make runtests ${makejobs}
+	make testdata ${makejobs}
 	../test/examples.sh --bin-path examples
+
+	if [ "$XBPS_CHECK_PKGS" = full ]; then
+		make runtests ${makejobs}
+	fi
 }
 
 post_install() {

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Merged]: [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
                   ` (22 preceding siblings ...)
  2020-12-14  2:51 ` ericonr
@ 2020-12-14  3:18 ` ericonr
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-14  3:18 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

[RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full
https://github.com/void-linux/void-packages/pull/26773

Description:
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] enable tests in CI
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
@ 2020-12-02 18:07 ` ericonr
  2020-12-02 18:14 ` ericonr
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-02 18:07 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ericonr/void-packages ci
https://github.com/void-linux/void-packages/pull/26773

[RFC] enable tests in CI
This probably needs some work in templates to define a cheap `do_check` and a more expensive `do_all_checks` or whatever.

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

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

From 9fad2c20a36d05efa30e3bebfb62cd7b5fc2696c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:48:53 -0300
Subject: [PATCH 1/3] [temporary] test make's test suite.

---
 srcpkgs/make/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/make/template b/srcpkgs/make/template
index 0aebcbc70be..eecf8233b05 100644
--- a/srcpkgs/make/template
+++ b/srcpkgs/make/template
@@ -1,4 +1,5 @@
 # Template file for 'make'
+# time to test
 pkgname=make
 version=4.3
 revision=3

From 7c06a588b3820738322e4206df9250deb4224aac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sat, 28 Nov 2020 15:47:04 -0300
Subject: [PATCH 2/3] .github/workflows: run tests on CI for native builds.

Also fix "list contents" step by adding a fetch-xtools step.
---
 .github/workflows/build.yaml | 18 ++++++++++--------
 common/travis/build.sh       |  6 +++++-
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 33186037f8d..6fd7047fe3c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -34,19 +34,20 @@ jobs:
         PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         ARCH: '${{ matrix.config.arch }}'
         BOOTSTRAP: '${{ matrix.config.bootstrap }}'
+        TEST: '${{ matrix.config.test }}'
         HOSTREPO: /hostrepo
 
     strategy:
       fail-fast: false
       matrix:
         config:
-          - { arch: x86_64, bootstrap: x86_64 }
-          - { arch: i686, bootstrap: i686 }
-          - { arch: aarch64, bootstrap: x86_64 }
-          - { arch: armv7l, bootstrap: x86_64 }
-          - { arch: x86_64-musl, bootstrap: x86_64-musl }
-          - { arch: armv6l-musl, bootstrap: x86_64-musl }
-          - { arch: aarch64-musl, bootstrap: x86_64-musl }
+          - { arch: x86_64, bootstrap: x86_64, test: 1 }
+          - { arch: i686, bootstrap: i686, test: 1 }
+          - { arch: aarch64, bootstrap: x86_64, test: 0 }
+          - { arch: armv7l, bootstrap: x86_64, test: 0 }
+          - { arch: x86_64-musl, bootstrap: x86_64-musl, test: 1 }
+          - { arch: armv6l-musl, bootstrap: x86_64-musl, test: 0 }
+          - { arch: aarch64-musl, bootstrap: x86_64-musl, test: 0 }
 
     steps:
       - name: Prepare container
@@ -73,9 +74,10 @@ jobs:
           (
           here="$(pwd)"
           cd /
-          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
+          "$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
           )
 
+      - run: common/travis/fetch-xtools.sh
       - name: Show files
         run: |
           (
diff --git a/common/travis/build.sh b/common/travis/build.sh
index 1c45910ea69..2f16bd740dc 100755
--- a/common/travis/build.sh
+++ b/common/travis/build.sh
@@ -6,6 +6,10 @@ if [ "$1" != "$2" ]; then
 	arch="-a $2"
 fi
 
+if [ "$3" = 1 ]; then
+	test="-Q"
+fi
+
 PKGS=$(/hostrepo/xbps-src sort-dependencies $(cat /tmp/templates))
 
 NPROCS=1
@@ -16,7 +20,7 @@ fi
 export FTP_RETRIES=10
 
 for pkg in ${PKGS}; do
-	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch pkg "$pkg"
+	/hostrepo/xbps-src -j$NPROCS -H "$HOME"/hostdir $arch $test pkg "$pkg"
 	[ $? -eq 1 ] && exit 1
 done
 

From 48a7349a269d81e0c0f9fd3cf129142e3f6c5687 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Wed, 2 Dec 2020 15:06:37 -0300
Subject: [PATCH 3/3] common/travis/fetch-xtools: make it work inside void
 masterdir.

---
 common/travis/fetch-xtools.sh | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 7abf44bcc12..870c457f3cc 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -2,9 +2,19 @@
 #
 # fetch-xtools.sh
 
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+FILE="xtools.tar.gz"
+
 mkdir -p /tmp/bin
 
 /bin/echo -e '\x1b[32mInstalling xtools...\x1b[0m'
-wget -q -O - https://github.com/leahneukirchen/xtools/archive/master.tar.gz | \
-	gunzip | tar x -C /tmp/bin --wildcards "xtools-master/x*" \
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	xbps-fetch -o "$FILE" "$URL" || exit 1
+fi
+
+gunzip < "$FILE" | $TAR x -C /tmp/bin --wildcards "xtools-master/x*" \
 	--strip-components=1 || exit 1

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-12-14  3:18 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26773@inbox.vuxu.org>
2020-12-02 18:07 ` [PR PATCH] [Updated] [RFC] enable tests in CI ericonr
2020-12-02 18:14 ` ericonr
2020-12-02 18:20 ` ericonr
2020-12-02 18:32 ` ericonr
2020-12-02 18:38 ` ericonr
2020-12-02 18:44 ` ericonr
2020-12-07 22:19 ` ericonr
2020-12-07 23:23 ` ericonr
2020-12-07 23:24 ` [RFC] enable tests in CI and introduce XBPS_CHECK_PKGS=full ericonr
2020-12-07 23:27 ` [PR PATCH] [Updated] " ericonr
2020-12-07 23:29 ` ericonr
2020-12-07 23:30 ` ericonr
2020-12-08 15:27 ` ericonr
2020-12-08 15:37 ` ericonr
2020-12-08 17:35 ` Chocimier
2020-12-08 18:19 ` ericonr
2020-12-12  6:54 ` [PR PATCH] [Updated] " ericonr
2020-12-14  2:20 ` ericonr
2020-12-14  2:22 ` [PR REVIEW] " sgn
2020-12-14  2:25 ` ericonr
2020-12-14  2:36 ` [PR PATCH] [Updated] " ericonr
2020-12-14  2:49 ` ericonr
2020-12-14  2:51 ` ericonr
2020-12-14  3:18 ` [PR PATCH] [Merged]: " ericonr

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).