Hi Tomas, Tomas Volf <~@wolfsden.cz> writes:
> 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. I'm not much of a Go person, but your suggestions sound reasonable. They'd have to be tested on the go-team branch to see whether it breaks many things (it probably would, since many more tests would be run). -- Thanks, Maxim