prometheus / procfs

procfs provides functions to retrieve system, kernel and process metrics from the pseudo-filesystem proc.
Apache License 2.0
766 stars 315 forks source link

tests fail when used with go modules #108

Open hdonnay opened 6 years ago

hdonnay commented 6 years ago

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.

grobie commented 6 years ago

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.

hdonnay commented 6 years ago

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.