Hi everyone,

When looking into the Go build system, I noticed the default check phase
runs (invoke "go" "test" import-path), which only runs the tests in the
root directory of the source. Running the tests in all subdirectories
would require something like this instead:

--8<---------------cut here---------------start------------->8---
(define* (check #:key tests? import-path #:allow-other-keys)
  "Run the tests for the package named by IMPORT-PATH."
  (when tests?
    (invoke "go" "test" (string-append import-path "/...")))
  #t)
--8<---------------cut here---------------end--------------->8---

For example, if the -v flag is added (which might be a better default?)
to the check phase of go-github-stretchr-testify, it can be seen that
only `TestImports' runs, none of the tests in assert, http, etc.
However, the source code in these subdirectories is still recursively
copied to out during the install phase.

Is this desired behaviour? I assumed it isn't, because it looks like we
are skipping a lot of tests during the check phase. However, I might
also simply be overlooking something here as I am new to packaging
Golang with Guix.

Best wishes,

Troy

Attachment: OpenPGP_0xC67C9181B3893FB0.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to