procfs icon indicating copy to clipboard operation
procfs copied to clipboard

tests fail when used with go modules

Open hdonnay opened this issue 7 years ago • 2 comments

Both the main procfs package and the xfs package fail on my machine. Here's a reproducer:

#!/bin/sh
set -ex
t=$(mktemp -d)
trap 'rm -r $t' EXIT
cd $t
cat >ex.go <<.
package main

import (
	_ "github.com/prometheus/procfs"
)

func main() {
	println("example")
}
.
go mod init example
go test all

The tests should automatically unpack fixtures.ttar if they need the files.

hdonnay avatar Sep 06 '18 17:09 hdonnay

Happy to review a PR to support go modules, if it's simple. For everything more involved I'd wait until go modules have matured.

grobie avatar Sep 06 '18 18:09 grobie

That's fair. I'll submit something once golang/go#27492 has an answer and there's a supported place/way to create files during tests.

hdonnay avatar Sep 06 '18 18:09 hdonnay