* [PR PATCH] [RFC] build-styles/go.sh: run go test -v ${go_project:-go_import_path} in do_check
@ 2021-12-12 20:19 bobertlo
2021-12-13 3:00 ` [PR PATCH] [Updated] " bobertlo
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: bobertlo @ 2021-12-12 20:19 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 802 bytes --]
There is a new 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: 751 bytes --]
From cc18d30f9bfd164be3604a6e7a129082f03b2acd 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 | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/common/build-style/go.sh b/common/build-style/go.sh
index d18116ee9633..659e968e344a 100644
--- a/common/build-style/go.sh
+++ b/common/build-style/go.sh
@@ -2,6 +2,11 @@
# This helper is for templates for Go packages.
#
+do_check() {
+ go_package=${go_package:-$go_import_path}
+ go test -v ${go_package}
+}
+
do_configure() {
# $go_import_path must be set, or we can't link $PWD into $GOSRCPATH
# nor build from modules
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PR PATCH] [Updated] [RFC] build-styles/go.sh: run go test -v ${go_project:-go_import_path} in do_check
2021-12-12 20:19 [PR PATCH] [RFC] build-styles/go.sh: run go test -v ${go_project:-go_import_path} in do_check bobertlo
@ 2021-12-13 3:00 ` bobertlo
2022-01-29 0:12 ` bobertlo
2022-01-29 0:12 ` [PR PATCH] [Closed]: " bobertlo
2 siblings, 0 replies; 4+ messages in thread
From: bobertlo @ 2021-12-13 3:00 UTC (permalink / raw)
To: ml
[-- 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC] build-styles/go.sh: run go test -v ${go_project:-go_import_path} in do_check
2021-12-12 20:19 [PR PATCH] [RFC] build-styles/go.sh: run go test -v ${go_project:-go_import_path} in do_check bobertlo
2021-12-13 3:00 ` [PR PATCH] [Updated] " bobertlo
@ 2022-01-29 0:12 ` bobertlo
2022-01-29 0:12 ` [PR PATCH] [Closed]: " bobertlo
2 siblings, 0 replies; 4+ messages in thread
From: bobertlo @ 2022-01-29 0:12 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 334 bytes --]
New comment by bobertlo on void-packages repository
https://github.com/void-linux/void-packages/pull/34496#issuecomment-1024762192
Comment:
I thought a majority of packages were rebuilding fine with this. I don't think I have any answer to this good enough to suggest inclusion in the buildstyle at this time so I am closing this..
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PR PATCH] [Closed]: [RFC] build-styles/go.sh: run go test -v ${go_project:-go_import_path} in do_check
2021-12-12 20:19 [PR PATCH] [RFC] build-styles/go.sh: run go test -v ${go_project:-go_import_path} in do_check bobertlo
2021-12-13 3:00 ` [PR PATCH] [Updated] " bobertlo
2022-01-29 0:12 ` bobertlo
@ 2022-01-29 0:12 ` bobertlo
2 siblings, 0 replies; 4+ messages in thread
From: bobertlo @ 2022-01-29 0:12 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 840 bytes --]
There's a closed pull request on the void-packages repository
[RFC] build-styles/go.sh: run go test -v ${go_project:-go_import_path} in do_check
https://github.com/void-linux/void-packages/pull/34496
Description:
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.
EDIT: My script was setup wrong and some packages did fail. I am testing with only running tests on packages that have a `go.mod` and the pass rate is very high. I will see how this goes.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-01-29 0:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-12 20:19 [PR PATCH] [RFC] build-styles/go.sh: run go test -v ${go_project:-go_import_path} in do_check bobertlo
2021-12-13 3:00 ` [PR PATCH] [Updated] " bobertlo
2022-01-29 0:12 ` bobertlo
2022-01-29 0:12 ` [PR PATCH] [Closed]: " bobertlo
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).