On 2024-01-14 22:12:38 +0100, Troy Figiel wrote: > 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. I tend to agree (on both accounts). I am not aware of anything Guix specific here that would prevent it, but maybe someone from golang team will chime in. Have a nice day, Tomas Volf -- There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.