Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make test fails because of go vet #1696

Closed
pires opened this issue Sep 1, 2016 · 4 comments
Closed

make test fails because of go vet #1696

pires opened this issue Sep 1, 2016 · 4 comments

Comments

@pires
Copy link
Contributor

pires commented Sep 1, 2016

I'm in the process of writing an output plug-in and I was going to run my tests but there are issues that are not related to my work. Is this the expected behavior?

I'm building commit 7926825 with go version go1.7 darwin/amd64.

$ make test
go vet ./...
plugins/inputs/couchbase/couchbase_test.go:21: literal copies lock value from bucket: github.com/couchbase/go-couchbase.Bucket
exit status 1
plugins/inputs/mongodb/mongodb_server.go:29: gopkg.in/mgo.v2/bson.DocElem composite literal uses unkeyed fields
plugins/inputs/mongodb/mongodb_server.go:29: gopkg.in/mgo.v2/bson.DocElem composite literal uses unkeyed fields
plugins/inputs/mongodb/mongodb_server.go:34: gopkg.in/mgo.v2/bson.DocElem composite literal uses unkeyed fields
plugins/inputs/mongodb/mongodb_server.go:55: gopkg.in/mgo.v2/bson.DocElem composite literal uses unkeyed fields
exit status 1
make: *** [vet] Error 1
@ewbankkit
Copy link

Also writing an output plugin and get the same errors (same go version).

@ewbankkit
Copy link

go vet passes with go1.6.2 but some unit tests are still failing:

$ go version
go version go1.6.2 darwin/amd64
$ make test-short
go vet ./...
go test -short ./...
ok      github.com/influxdata/telegraf  0.257s
ok      github.com/influxdata/telegraf/agent    0.883s
?       github.com/influxdata/telegraf/cmd/telegraf [no test files]
ok      github.com/influxdata/telegraf/filter   0.531s
--- FAIL: TestCombinedOutputError (0.01s)
        Error Trace:    internal_test.go:96
    Error:      Expected value not to be nil.
    Messages:   An error is expected but got nil. 

--- FAIL: TestRunError (0.01s)
        Error Trace:    internal_test.go:107
    Error:      Expected value not to be nil.
    Messages:   An error is expected but got nil. 

FAIL
FAIL    github.com/influxdata/telegraf/internal 0.500s
ok      github.com/influxdata/telegraf/internal/buffer  0.603s
ok      github.com/influxdata/telegraf/internal/config  0.282s
?       github.com/influxdata/telegraf/internal/config/aws  [no test files]
?       github.com/influxdata/telegraf/internal/errchan [no test files]
ok      github.com/influxdata/telegraf/internal/globpath    0.353s
ok      github.com/influxdata/telegraf/internal/limiter 0.566s
ok      github.com/influxdata/telegraf/internal/models  0.378s
?       github.com/influxdata/telegraf/plugins/inputs   [no test files]
ok      github.com/influxdata/telegraf/plugins/inputs/aerospike 0.399s
?       github.com/influxdata/telegraf/plugins/inputs/all   [no test files]
ok      github.com/influxdata/telegraf/plugins/inputs/apache    0.810s
ok      github.com/influxdata/telegraf/plugins/inputs/bcache    0.901s
ok      github.com/influxdata/telegraf/plugins/inputs/cassandra 0.794s
ok      github.com/influxdata/telegraf/plugins/inputs/ceph  2.140s
?       github.com/influxdata/telegraf/plugins/inputs/cgroup    [no test files]
?       github.com/influxdata/telegraf/plugins/inputs/chrony    [no test files]
ok      github.com/influxdata/telegraf/plugins/inputs/cloudwatch    3.581s
?       github.com/influxdata/telegraf/plugins/inputs/conntrack [no test files]
ok      github.com/influxdata/telegraf/plugins/inputs/consul    3.693s
ok      github.com/influxdata/telegraf/plugins/inputs/couchbase 3.227s
ok      github.com/influxdata/telegraf/plugins/inputs/couchdb   3.730s
ok      github.com/influxdata/telegraf/plugins/inputs/disque    3.768s
ok      github.com/influxdata/telegraf/plugins/inputs/dns_query 2.411s
ok      github.com/influxdata/telegraf/plugins/inputs/docker    0.528s
ok      github.com/influxdata/telegraf/plugins/inputs/dovecot   0.799s
ok      github.com/influxdata/telegraf/plugins/inputs/elasticsearch 0.599s
ok      github.com/influxdata/telegraf/plugins/inputs/exec  0.657s
ok      github.com/influxdata/telegraf/plugins/inputs/filestat  0.683s
ok      github.com/influxdata/telegraf/plugins/inputs/graylog   0.399s
ok      github.com/influxdata/telegraf/plugins/inputs/haproxy   0.614s
?       github.com/influxdata/telegraf/plugins/inputs/hddtemp   [no test files]
ok      github.com/influxdata/telegraf/plugins/inputs/hddtemp/go-hddtemp    0.176s
ok      github.com/influxdata/telegraf/plugins/inputs/http_response 2.331s
ok      github.com/influxdata/telegraf/plugins/inputs/httpjson  1.184s
ok      github.com/influxdata/telegraf/plugins/inputs/influxdb  2.448s
ok      github.com/influxdata/telegraf/plugins/inputs/ipmi_sensor   2.321s
?       github.com/influxdata/telegraf/plugins/inputs/iptables  [no test files]
ok      github.com/influxdata/telegraf/plugins/inputs/jolokia   2.152s
ok      github.com/influxdata/telegraf/plugins/inputs/kafka_consumer    1.945s
ok      github.com/influxdata/telegraf/plugins/inputs/leofs 7.361s
ok      github.com/influxdata/telegraf/plugins/inputs/logparser 3.055s
ok      github.com/influxdata/telegraf/plugins/inputs/logparser/grok    1.343s
ok      github.com/influxdata/telegraf/plugins/inputs/lustre2   1.331s
ok      github.com/influxdata/telegraf/plugins/inputs/mailchimp 2.159s
ok      github.com/influxdata/telegraf/plugins/inputs/memcached 2.210s
ok      github.com/influxdata/telegraf/plugins/inputs/mesos 2.086s
ok      github.com/influxdata/telegraf/plugins/inputs/mongodb   1.881s
ok      github.com/influxdata/telegraf/plugins/inputs/mqtt_consumer 2.027s
ok      github.com/influxdata/telegraf/plugins/inputs/mysql 2.044s
ok      github.com/influxdata/telegraf/plugins/inputs/nats_consumer 1.793s
ok      github.com/influxdata/telegraf/plugins/inputs/net_response  0.511s
ok      github.com/influxdata/telegraf/plugins/inputs/nginx 0.541s
ok      github.com/influxdata/telegraf/plugins/inputs/nsq   0.499s
ok      github.com/influxdata/telegraf/plugins/inputs/nsq_consumer  0.559s
ok      github.com/influxdata/telegraf/plugins/inputs/nstat 0.448s
ok      github.com/influxdata/telegraf/plugins/inputs/ntpq  0.518s
ok      github.com/influxdata/telegraf/plugins/inputs/passenger 0.373s
--- FAIL: TestPhpFpmGeneratesMetrics_Throw_Error_When_Fpm_Status_Is_Not_Responding (0.93s)
        Error Trace:    phpfpm_test.go:210
    Error:      "Unable to get valid stat result from 'http://aninvalidone': <nil>" does not contain "Unable to connect to phpfpm status page 'http://aninvalidone': Get http://aninvalidone: dial tcp: lookup aninvalidone"

FAIL
FAIL    github.com/influxdata/telegraf/plugins/inputs/phpfpm    1.267s
ok      github.com/influxdata/telegraf/plugins/inputs/ping  0.623s
ok      github.com/influxdata/telegraf/plugins/inputs/postgresql    0.737s
ok      github.com/influxdata/telegraf/plugins/inputs/postgresql_extensible 0.701s
ok      github.com/influxdata/telegraf/plugins/inputs/powerdns  0.668s
ok      github.com/influxdata/telegraf/plugins/inputs/procstat  0.446s
ok      github.com/influxdata/telegraf/plugins/inputs/prometheus    0.573s
ok      github.com/influxdata/telegraf/plugins/inputs/puppetagent   0.577s
ok      github.com/influxdata/telegraf/plugins/inputs/rabbitmq  0.389s
ok      github.com/influxdata/telegraf/plugins/inputs/raindrops 0.455s
ok      github.com/influxdata/telegraf/plugins/inputs/redis 0.474s
ok      github.com/influxdata/telegraf/plugins/inputs/rethinkdb 0.428s
ok      github.com/influxdata/telegraf/plugins/inputs/riak  0.614s
?       github.com/influxdata/telegraf/plugins/inputs/sensors   [no test files]
--- FAIL: TestGosnmpWrapper_walk_retry (0.03s)
        Error Trace:    snmp_test.go:373
    Error:      Not equal: 4 (expected)
                    != 3 (actual)

FAIL
FAIL    github.com/influxdata/telegraf/plugins/inputs/snmp  0.876s
?       github.com/influxdata/telegraf/plugins/inputs/snmp_legacy   [no test files]
ok      github.com/influxdata/telegraf/plugins/inputs/sqlserver 0.963s
ok      github.com/influxdata/telegraf/plugins/inputs/statsd    0.444s
?       github.com/influxdata/telegraf/plugins/inputs/sysstat   [no test files]
ok      github.com/influxdata/telegraf/plugins/inputs/system    0.323s
ok      github.com/influxdata/telegraf/plugins/inputs/tail  0.729s
ok      github.com/influxdata/telegraf/plugins/inputs/tcp_listener  3.858s
ok      github.com/influxdata/telegraf/plugins/inputs/trig  0.453s
ok      github.com/influxdata/telegraf/plugins/inputs/twemproxy 0.469s
ok      github.com/influxdata/telegraf/plugins/inputs/udp_listener  4.372s
ok      github.com/influxdata/telegraf/plugins/inputs/varnish   0.590s
ok      github.com/influxdata/telegraf/plugins/inputs/webhooks  0.349s
ok      github.com/influxdata/telegraf/plugins/inputs/webhooks/filestack    0.458s
ok      github.com/influxdata/telegraf/plugins/inputs/webhooks/github   0.262s
ok      github.com/influxdata/telegraf/plugins/inputs/webhooks/mandrill 0.375s
ok      github.com/influxdata/telegraf/plugins/inputs/webhooks/rollbar  0.373s
?       github.com/influxdata/telegraf/plugins/inputs/win_perf_counters [no test files]
?       github.com/influxdata/telegraf/plugins/inputs/zfs   [no test files]
ok      github.com/influxdata/telegraf/plugins/inputs/zookeeper 0.407s
?       github.com/influxdata/telegraf/plugins/outputs  [no test files]
?       github.com/influxdata/telegraf/plugins/outputs/all  [no test files]
ok      github.com/influxdata/telegraf/plugins/outputs/amon 0.412s
ok      github.com/influxdata/telegraf/plugins/outputs/amqp 0.351s
ok      github.com/influxdata/telegraf/plugins/outputs/cloudwatch   0.386s
ok      github.com/influxdata/telegraf/plugins/outputs/datadog  0.409s
ok      github.com/influxdata/telegraf/plugins/outputs/file 0.502s
ok      github.com/influxdata/telegraf/plugins/outputs/graphite 0.518s
ok      github.com/influxdata/telegraf/plugins/outputs/graylog  0.509s
ok      github.com/influxdata/telegraf/plugins/outputs/influxdb 0.450s
ok      github.com/influxdata/telegraf/plugins/outputs/instrumental 0.492s
ok      github.com/influxdata/telegraf/plugins/outputs/kafka    0.246s
ok      github.com/influxdata/telegraf/plugins/outputs/kinesis  0.270s
ok      github.com/influxdata/telegraf/plugins/outputs/librato  0.490s
ok      github.com/influxdata/telegraf/plugins/outputs/mqtt 0.377s
ok      github.com/influxdata/telegraf/plugins/outputs/nsq  0.469s
ok      github.com/influxdata/telegraf/plugins/outputs/opentsdb 0.458s
ok      github.com/influxdata/telegraf/plugins/outputs/prometheus_client    0.265s
ok      github.com/influxdata/telegraf/plugins/outputs/riemann  0.425s
?       github.com/influxdata/telegraf/plugins/parsers  [no test files]
ok      github.com/influxdata/telegraf/plugins/parsers/graphite 0.446s
ok      github.com/influxdata/telegraf/plugins/parsers/influx   0.442s
ok      github.com/influxdata/telegraf/plugins/parsers/json 0.380s
ok      github.com/influxdata/telegraf/plugins/parsers/nagios   0.357s
ok      github.com/influxdata/telegraf/plugins/parsers/value    0.369s
?       github.com/influxdata/telegraf/plugins/serializers  [no test files]
ok      github.com/influxdata/telegraf/plugins/serializers/graphite 0.372s
ok      github.com/influxdata/telegraf/plugins/serializers/influx   0.529s
ok      github.com/influxdata/telegraf/plugins/serializers/json 0.510s
ok      github.com/influxdata/telegraf/testutil 0.410s
make: *** [test-short] Error 1

@sparrc
Copy link
Contributor

sparrc commented Sep 1, 2016

go vet is currently working with 1.6.3, if you want to submit a PR to fix it for 1.7 that would be appreciated.

@sparrc sparrc closed this as completed Sep 1, 2016
@sparrc
Copy link
Contributor

sparrc commented Sep 1, 2016

@ewbankkit I can't really debug your testing environment for you. Unit tests are not expected to fail and are currently passing on my computer and our CI system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants