Switch to kingpin flags (#639)
* Switch to kingpin flags * Fix logrus vendoring * Fix flags in main tests * Fix vendoring versions
This commit is contained in:
parent
1467d845fb
commit
dfe07eaae8
84 changed files with 9904 additions and 196 deletions
|
|
@ -14,7 +14,6 @@
|
|||
package collector
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
|
@ -24,10 +23,11 @@ import (
|
|||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"gopkg.in/alecthomas/kingpin.v2"
|
||||
)
|
||||
|
||||
func TestIPVSCollector(t *testing.T) {
|
||||
if err := flag.Set("collector.procfs", "fixtures/proc"); err != nil {
|
||||
if _, err := kingpin.CommandLine.Parse([]string{"--collector.procfs", "fixtures/proc"}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
collector, err := newIPVSCollector()
|
||||
|
|
@ -76,7 +76,7 @@ func (c miniCollector) Describe(ch chan<- *prometheus.Desc) {
|
|||
}
|
||||
|
||||
func TestIPVSCollectorResponse(t *testing.T) {
|
||||
if err := flag.Set("collector.procfs", "fixtures/proc"); err != nil {
|
||||
if _, err := kingpin.CommandLine.Parse([]string{"--collector.procfs", "fixtures/proc"}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
collector, err := NewIPVSCollector()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue