Github messages for voidlinux
 help / color / mirror / Atom feed
From: bobertlo <bobertlo@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [RFC] build-styles/go.sh: run go test -v ${go_project:-go_import_path} in do_check
Date: Mon, 13 Dec 2021 04:00:58 +0100	[thread overview]
Message-ID: <20211213030058.W8mbqg447JcWdNBIgzyH7qBpj-rjpiO0swUx0IRQprU@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-34496@inbox.vuxu.org>

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

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

https://github.com/bobertlo/void-packages go-test
https://github.com/void-linux/void-packages/pull/34496

[RFC] build-styles/go.sh: run go test -v ${go_project:-go_import_path} in do_check
There are 313 build_style=go packages, and currently 8 of them have tests defined in the package template.

I have been testing the go packages with this. So far, I have rebuilt 183 packages and there have been no errors and 64 packages have run tests successfully.

Ideally, more tests would be added (because they are a lot more common on internal libraries than command clients) but this is probably the safest default option.

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

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

From d4162b34f865a3ebadad0113c5800b47434ff17f Mon Sep 17 00:00:00 2001
From: Robert Lowry <bobertlo@gmail.com>
Date: Sun, 12 Dec 2021 13:58:29 -0600
Subject: [PATCH] build-styles/go.sh: run go test -v
 ${go_project:-go_import_path}

---
 common/build-style/go.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/common/build-style/go.sh b/common/build-style/go.sh
index d18116ee9633..5db34db9465c 100644
--- a/common/build-style/go.sh
+++ b/common/build-style/go.sh
@@ -2,6 +2,13 @@
 # This helper is for templates for Go packages.
 #
 
+do_check() {
+	go_package=${go_package:-$go_import_path}
+	if [ "${go_mod_mode}" != "off" ] && [ -f go.mod ]; then
+		go test -v ${go_package}
+	fi
+}
+
 do_configure() {
 	# $go_import_path must be set, or we can't link $PWD into $GOSRCPATH
 	# nor build from modules

  reply	other threads:[~2021-12-13  3:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-12 20:19 [PR PATCH] " bobertlo
2021-12-13  3:00 ` bobertlo [this message]
2022-01-29  0:12 ` bobertlo
2022-01-29  0:12 ` [PR PATCH] [Closed]: " bobertlo

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20211213030058.W8mbqg447JcWdNBIgzyH7qBpj-rjpiO0swUx0IRQprU@z \
    --to=bobertlo@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).