From e86d38b55adc0836e1666b53207ae11281318bda Mon Sep 17 00:00:00 2001 From: Andrew Kroh Date: Fri, 5 May 2017 16:26:38 -0400 Subject: [PATCH 1/3] Using single quotes around Windows paths The thrift test config used double quotes around Windows path separators and this was interpreted incorrectly in YAML parsing. --- packetbeat/tests/system/config/packetbeat.yml.j2 | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packetbeat/tests/system/config/packetbeat.yml.j2 b/packetbeat/tests/system/config/packetbeat.yml.j2 index ef56907d3f3..06299ada154 100644 --- a/packetbeat/tests/system/config/packetbeat.yml.j2 +++ b/packetbeat/tests/system/config/packetbeat.yml.j2 @@ -112,12 +112,10 @@ packetbeat.protocols: ports: [{{ thrift_ports|default([9090])|join(", ") }}] transport_type: "{{ thrift_transport_type|default('socket') }}" {% if thrift_idl_files %} - idl_files: [ - {%- for file in thrift_idl_files -%} - "{{ beat.working_dir + '/' + file }}" - {%- if not loop.last %}, {% endif -%} - {%- endfor -%} - ] + idl_files: + {%- for file in thrift_idl_files %} + - '{{ beat.working_dir + '/' + file }}' + {%- endfor -%} {%- endif %} {% if thrift_send_request %} send_request: true{%- endif %} {% if thrift_send_response %} send_response: true{%- endif %} From 077d5081c2d424e9c50a65ba08f280890c52127d Mon Sep 17 00:00:00 2001 From: Andrew Kroh Date: Fri, 5 May 2017 16:37:14 -0400 Subject: [PATCH 2/3] Use logp.Beta or logp.Experimental in metricsets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And in system tests, centralize the logic for asserting that there are no ERR or WARN in logs. Filter out errors about “The service process could not connect to the service controller” that occur when testing on Jenkins where Jenkins itself is running as a service. This confuses the Beat because it thinks that it is running as service, but it’s not. --- .../module/ceph/cluster_disk/cluster_disk.go | 3 +- .../ceph/cluster_health/cluster_health.go | 3 +- .../ceph/monitor_health/monitor_health.go | 2 +- metricbeat/module/ceph/pool_disk/pool_disk.go | 3 +- metricbeat/module/couchbase/bucket/bucket.go | 2 +- .../module/couchbase/cluster/cluster.go | 2 +- metricbeat/module/couchbase/node/node.go | 2 +- .../module/docker/container/container.go | 2 +- metricbeat/module/docker/cpu/cpu.go | 2 +- metricbeat/module/docker/diskio/diskio.go | 2 +- .../module/docker/healthcheck/healthcheck.go | 2 +- metricbeat/module/docker/image/image.go | 4 +- metricbeat/module/docker/info/info.go | 2 +- metricbeat/module/docker/memory/memory.go | 2 +- metricbeat/module/docker/network/network.go | 2 +- metricbeat/module/golang/expvar/expvar.go | 4 +- metricbeat/module/golang/heap/heap.go | 4 +- metricbeat/module/http/json/json.go | 3 +- metricbeat/module/jolokia/jmx/jmx.go | 3 +- .../kafka/consumergroup/consumergroup.go | 2 +- .../module/kafka/partition/partition.go | 2 +- metricbeat/module/memcached/stats/stats.go | 4 +- metricbeat/module/mongodb/dbstats/dbstats.go | 2 +- metricbeat/module/php_fpm/pool/pool.go | 3 +- .../module/prometheus/collector/collector.go | 2 +- metricbeat/module/prometheus/stats/stats.go | 2 +- .../module/vsphere/datastore/datastore.go | 2 +- metricbeat/module/vsphere/host/host.go | 4 +- .../vsphere/virtualmachine/virtualmachine.go | 4 +- metricbeat/module/windows/perfmon/perfmon.go | 2 +- metricbeat/tests/system/metricbeat.py | 12 ++++ metricbeat/tests/system/test_apache.py | 5 +- metricbeat/tests/system/test_base.py | 5 +- metricbeat/tests/system/test_couchbase.py | 3 + metricbeat/tests/system/test_docker.py | 40 +++----------- metricbeat/tests/system/test_dropwizard.py | 1 + metricbeat/tests/system/test_elasticsearch.py | 2 + metricbeat/tests/system/test_golang.py | 9 +-- metricbeat/tests/system/test_haproxy.py | 10 +--- metricbeat/tests/system/test_http.py | 5 +- metricbeat/tests/system/test_jolokia.py | 1 + metricbeat/tests/system/test_kibana.py | 1 + metricbeat/tests/system/test_memcached.py | 1 + metricbeat/tests/system/test_mongodb.py | 5 +- metricbeat/tests/system/test_mysql.py | 5 +- metricbeat/tests/system/test_phpfpm.py | 5 +- metricbeat/tests/system/test_prometheus.py | 5 +- metricbeat/tests/system/test_redis.py | 15 +---- metricbeat/tests/system/test_system.py | 55 ++++--------------- metricbeat/tests/system/test_zookeeper.py | 5 +- 50 files changed, 85 insertions(+), 183 deletions(-) diff --git a/metricbeat/module/ceph/cluster_disk/cluster_disk.go b/metricbeat/module/ceph/cluster_disk/cluster_disk.go index daae302e70a..a562174b22c 100644 --- a/metricbeat/module/ceph/cluster_disk/cluster_disk.go +++ b/metricbeat/module/ceph/cluster_disk/cluster_disk.go @@ -32,7 +32,7 @@ type MetricSet struct { } func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("EXPERIMENTAL: The ceph cluster_disk metricset is experimental") + logp.Experimental("The ceph cluster_disk metricset is experimental") http := helper.NewHTTP(base) http.SetHeader("Accept", "application/json") @@ -44,7 +44,6 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { } func (m *MetricSet) Fetch() (common.MapStr, error) { - content, err := m.HTTP.FetchContent() if err != nil { diff --git a/metricbeat/module/ceph/cluster_health/cluster_health.go b/metricbeat/module/ceph/cluster_health/cluster_health.go index 07622b2c4dd..c209be2b045 100644 --- a/metricbeat/module/ceph/cluster_health/cluster_health.go +++ b/metricbeat/module/ceph/cluster_health/cluster_health.go @@ -32,7 +32,7 @@ type MetricSet struct { } func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The ceph cluster_health metricset is beta") + logp.Beta("The ceph cluster_health metricset is beta") http := helper.NewHTTP(base) http.SetHeader("Accept", "application/json") @@ -44,7 +44,6 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { } func (m *MetricSet) Fetch() (common.MapStr, error) { - content, err := m.HTTP.FetchContent() if err != nil { return nil, err diff --git a/metricbeat/module/ceph/monitor_health/monitor_health.go b/metricbeat/module/ceph/monitor_health/monitor_health.go index 79956e6f5f8..a16909cdb88 100644 --- a/metricbeat/module/ceph/monitor_health/monitor_health.go +++ b/metricbeat/module/ceph/monitor_health/monitor_health.go @@ -32,7 +32,7 @@ type MetricSet struct { } func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The ceph monitor_health metricset is beta") + logp.Beta("The ceph monitor_health metricset is beta") http := helper.NewHTTP(base) http.SetHeader("Accept", "application/json") diff --git a/metricbeat/module/ceph/pool_disk/pool_disk.go b/metricbeat/module/ceph/pool_disk/pool_disk.go index 2c24a42f112..9686b222e5c 100644 --- a/metricbeat/module/ceph/pool_disk/pool_disk.go +++ b/metricbeat/module/ceph/pool_disk/pool_disk.go @@ -32,7 +32,7 @@ type MetricSet struct { } func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("EXPERIMENTAL: The ceph pool_disk metricset is experimental") + logp.Experimental("The ceph pool_disk metricset is experimental") http := helper.NewHTTP(base) http.SetHeader("Accept", "application/json") @@ -44,7 +44,6 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { } func (m *MetricSet) Fetch() ([]common.MapStr, error) { - content, err := m.HTTP.FetchContent() if err != nil { diff --git a/metricbeat/module/couchbase/bucket/bucket.go b/metricbeat/module/couchbase/bucket/bucket.go index ed7c127ffe0..74e7608e929 100644 --- a/metricbeat/module/couchbase/bucket/bucket.go +++ b/metricbeat/module/couchbase/bucket/bucket.go @@ -36,7 +36,7 @@ type MetricSet struct { // New create a new instance of the MetricSet func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The couchbase bucket metricset is beta") + logp.Beta("The couchbase bucket metricset is beta") return &MetricSet{ BaseMetricSet: base, diff --git a/metricbeat/module/couchbase/cluster/cluster.go b/metricbeat/module/couchbase/cluster/cluster.go index db80e98d0f3..e6372b4cf50 100644 --- a/metricbeat/module/couchbase/cluster/cluster.go +++ b/metricbeat/module/couchbase/cluster/cluster.go @@ -36,7 +36,7 @@ type MetricSet struct { // New create a new instance of the MetricSet func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The couchbase cluster metricset is beta") + logp.Beta("The couchbase cluster metricset is beta") return &MetricSet{ BaseMetricSet: base, diff --git a/metricbeat/module/couchbase/node/node.go b/metricbeat/module/couchbase/node/node.go index eb6ae3590ce..201044d5f5d 100644 --- a/metricbeat/module/couchbase/node/node.go +++ b/metricbeat/module/couchbase/node/node.go @@ -36,7 +36,7 @@ type MetricSet struct { // New create a new instance of the MetricSet func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The couchbase node metricset is beta") + logp.Beta("The couchbase node metricset is beta") return &MetricSet{ BaseMetricSet: base, diff --git a/metricbeat/module/docker/container/container.go b/metricbeat/module/docker/container/container.go index 2ad0cfb9e40..5084fc1a5dd 100644 --- a/metricbeat/module/docker/container/container.go +++ b/metricbeat/module/docker/container/container.go @@ -22,7 +22,7 @@ type MetricSet struct { // New creates a new instance of the docker container MetricSet. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The docker container metricset is beta") + logp.Beta("The docker container metricset is beta") config := docker.Config{} if err := base.Module().UnpackConfig(&config); err != nil { diff --git a/metricbeat/module/docker/cpu/cpu.go b/metricbeat/module/docker/cpu/cpu.go index 48eca5c0f16..69e4351e2d1 100644 --- a/metricbeat/module/docker/cpu/cpu.go +++ b/metricbeat/module/docker/cpu/cpu.go @@ -23,7 +23,7 @@ type MetricSet struct { // New creates a new instance of the docker cpu MetricSet. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The docker cpu metricset is beta") + logp.Beta("The docker cpu metricset is beta") config := docker.Config{} if err := base.Module().UnpackConfig(&config); err != nil { diff --git a/metricbeat/module/docker/diskio/diskio.go b/metricbeat/module/docker/diskio/diskio.go index dc0a423764a..3c7e8647e4e 100644 --- a/metricbeat/module/docker/diskio/diskio.go +++ b/metricbeat/module/docker/diskio/diskio.go @@ -23,7 +23,7 @@ type MetricSet struct { // New create a new instance of the docker diskio MetricSet. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The docker diskio metricset is beta") + logp.Beta("The docker diskio metricset is beta") config := docker.Config{} if err := base.Module().UnpackConfig(&config); err != nil { diff --git a/metricbeat/module/docker/healthcheck/healthcheck.go b/metricbeat/module/docker/healthcheck/healthcheck.go index f3624b7202e..3d8754ef451 100644 --- a/metricbeat/module/docker/healthcheck/healthcheck.go +++ b/metricbeat/module/docker/healthcheck/healthcheck.go @@ -22,7 +22,7 @@ type MetricSet struct { // New creates a new instance of the docker healthcheck MetricSet. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The docker healthcheck metricset is beta") + logp.Beta("The docker healthcheck metricset is beta") config := docker.Config{} if err := base.Module().UnpackConfig(&config); err != nil { diff --git a/metricbeat/module/docker/image/image.go b/metricbeat/module/docker/image/image.go index 59caf643c1d..326216213b4 100644 --- a/metricbeat/module/docker/image/image.go +++ b/metricbeat/module/docker/image/image.go @@ -30,8 +30,7 @@ type MetricSet struct { // Part of new is also setting up the configuration by processing additional // configuration entries if needed. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - - logp.Warn("BETA: The docker info metricset is beta") + logp.Beta("The docker info metricset is beta") config := docker.Config{} if err := base.Module().UnpackConfig(&config); err != nil { @@ -53,7 +52,6 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { // It returns the event which is then forward to the output. In case of an error, a // descriptive error must be returned. func (m *MetricSet) Fetch() ([]common.MapStr, error) { - images, err := m.dockerClient.ListImages(dc.ListImagesOptions{}) if err != nil { return nil, err diff --git a/metricbeat/module/docker/info/info.go b/metricbeat/module/docker/info/info.go index f12b77115b4..b3094b44928 100644 --- a/metricbeat/module/docker/info/info.go +++ b/metricbeat/module/docker/info/info.go @@ -22,7 +22,7 @@ type MetricSet struct { // New create a new instance of the docker info MetricSet. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The docker info metricset is beta") + logp.Beta("The docker info metricset is beta") config := docker.Config{} if err := base.Module().UnpackConfig(&config); err != nil { diff --git a/metricbeat/module/docker/memory/memory.go b/metricbeat/module/docker/memory/memory.go index f21fd1d1d93..ee21c66ca4d 100644 --- a/metricbeat/module/docker/memory/memory.go +++ b/metricbeat/module/docker/memory/memory.go @@ -23,7 +23,7 @@ type MetricSet struct { // New creates a new instance of the docker memory MetricSet. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The docker memory metricset is beta") + logp.Beta("The docker memory metricset is beta") config := docker.Config{} if err := base.Module().UnpackConfig(&config); err != nil { diff --git a/metricbeat/module/docker/network/network.go b/metricbeat/module/docker/network/network.go index 7c3517b170c..a24fc2d218b 100644 --- a/metricbeat/module/docker/network/network.go +++ b/metricbeat/module/docker/network/network.go @@ -23,7 +23,7 @@ type MetricSet struct { // New creates a new instance of the docker network MetricSet. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The docker network metricset is beta") + logp.Beta("The docker network metricset is beta") config := docker.Config{} if err := base.Module().UnpackConfig(&config); err != nil { diff --git a/metricbeat/module/golang/expvar/expvar.go b/metricbeat/module/golang/expvar/expvar.go index 39000a265df..c4f19d7cce9 100644 --- a/metricbeat/module/golang/expvar/expvar.go +++ b/metricbeat/module/golang/expvar/expvar.go @@ -44,8 +44,7 @@ type MetricSet struct { // Part of new is also setting up the configuration by processing additional // configuration entries if needed. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - - logp.Warn("EXPERIMENTAL: The golang expvar metricset is experimental") + logp.Experimental("The golang expvar metricset is experimental") config := struct { Namespace string `config:"expvar.namespace" validate:"required"` @@ -66,7 +65,6 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { // It returns the event which is then forward to the output. In case of an error, a // descriptive error must be returned. func (m *MetricSet) Fetch() (common.MapStr, error) { - json, err := m.http.FetchJSON() if err != nil { diff --git a/metricbeat/module/golang/heap/heap.go b/metricbeat/module/golang/heap/heap.go index 140fa4f4b71..8454b3a893c 100644 --- a/metricbeat/module/golang/heap/heap.go +++ b/metricbeat/module/golang/heap/heap.go @@ -47,8 +47,7 @@ type MetricSet struct { // Part of new is also setting up the configuration by processing additional // configuration entries if needed. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - - logp.Warn("EXPERIMENTAL: The golang heap metricset is experimental") + logp.Experimental("The golang heap metricset is experimental") return &MetricSet{ BaseMetricSet: base, @@ -60,7 +59,6 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { // It returns the event which is then forward to the output. In case of an error, a // descriptive error must be returned. func (m *MetricSet) Fetch() (common.MapStr, error) { - data, err := m.http.FetchContent() if err != nil { return nil, err diff --git a/metricbeat/module/http/json/json.go b/metricbeat/module/http/json/json.go index 26cd995cbbe..8ec9b257fdb 100644 --- a/metricbeat/module/http/json/json.go +++ b/metricbeat/module/http/json/json.go @@ -55,8 +55,7 @@ type MetricSet struct { // Part of new is also setting up the configuration by processing additional // configuration entries if needed. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - - logp.Warn("The http json metricset is in beta.") + logp.Beta("The http json metricset is in beta.") config := struct { Namespace string `config:"namespace" validate:"required"` diff --git a/metricbeat/module/jolokia/jmx/jmx.go b/metricbeat/module/jolokia/jmx/jmx.go index b2b1de38bad..d6525cbf6f8 100644 --- a/metricbeat/module/jolokia/jmx/jmx.go +++ b/metricbeat/module/jolokia/jmx/jmx.go @@ -46,7 +46,7 @@ type MetricSet struct { // New create a new instance of the MetricSet func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The jolokia jmx metricset is beta") + logp.Beta("The jolokia jmx metricset is beta") // Additional configuration options config := struct { @@ -78,7 +78,6 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { // Fetch methods implements the data gathering and data conversion to the right format func (m *MetricSet) Fetch() (common.MapStr, error) { - body, err := m.http.FetchContent() if err != nil { return nil, err diff --git a/metricbeat/module/kafka/consumergroup/consumergroup.go b/metricbeat/module/kafka/consumergroup/consumergroup.go index 21da39e31d4..3a2d66d0a34 100644 --- a/metricbeat/module/kafka/consumergroup/consumergroup.go +++ b/metricbeat/module/kafka/consumergroup/consumergroup.go @@ -36,7 +36,7 @@ var debugf = logp.MakeDebug("kafka") // New creates a new instance of the MetricSet. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The kafka consumergroup metricset is beta") + logp.Beta("The kafka consumergroup metricset is beta") config := defaultConfig if err := base.Module().UnpackConfig(&config); err != nil { diff --git a/metricbeat/module/kafka/partition/partition.go b/metricbeat/module/kafka/partition/partition.go index ebccfa46ef4..4dfc172d502 100644 --- a/metricbeat/module/kafka/partition/partition.go +++ b/metricbeat/module/kafka/partition/partition.go @@ -37,7 +37,7 @@ var debugf = logp.MakeDebug("kafka") // New creates a new instance of the partition MetricSet. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The kafka partition metricset is beta") + logp.Beta("The kafka partition metricset is beta") config := defaultConfig if err := base.Module().UnpackConfig(&config); err != nil { diff --git a/metricbeat/module/memcached/stats/stats.go b/metricbeat/module/memcached/stats/stats.go index 54a06a57df4..b0fc4b3d6a2 100644 --- a/metricbeat/module/memcached/stats/stats.go +++ b/metricbeat/module/memcached/stats/stats.go @@ -21,8 +21,7 @@ type MetricSet struct { } func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - - logp.Warn("BETA: The memcached stats metricset is beta") + logp.Beta("The memcached stats metricset is beta") return &MetricSet{ BaseMetricSet: base, @@ -30,7 +29,6 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { } func (m *MetricSet) Fetch() (common.MapStr, error) { - conn, err := net.DialTimeout("tcp", m.Host(), m.Module().Config().Timeout) if err != nil { return nil, err diff --git a/metricbeat/module/mongodb/dbstats/dbstats.go b/metricbeat/module/mongodb/dbstats/dbstats.go index 629c20aed59..19f34a52ecf 100644 --- a/metricbeat/module/mongodb/dbstats/dbstats.go +++ b/metricbeat/module/mongodb/dbstats/dbstats.go @@ -34,7 +34,7 @@ type MetricSet struct { // Part of new is also setting up the configuration by processing additional // configuration entries if needed. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("EXPERIMENTAL: The %v %v metricset is experimental", base.Module().Name(), base.Name()) + logp.Experimental("The %v %v metricset is experimental", base.Module().Name(), base.Name()) dialInfo, err := mgo.ParseURL(base.HostData().URI) if err != nil { diff --git a/metricbeat/module/php_fpm/pool/pool.go b/metricbeat/module/php_fpm/pool/pool.go index 7caca883795..6c99771c639 100644 --- a/metricbeat/module/php_fpm/pool/pool.go +++ b/metricbeat/module/php_fpm/pool/pool.go @@ -39,7 +39,8 @@ type MetricSet struct { // New create a new instance of the MetricSet func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The php-fpm pool metricset is beta") + logp.Beta("The php_fpm pool metricset is beta") + return &MetricSet{ base, helper.NewHTTP(base), diff --git a/metricbeat/module/prometheus/collector/collector.go b/metricbeat/module/prometheus/collector/collector.go index 77915b3caae..7241ba67fbd 100644 --- a/metricbeat/module/prometheus/collector/collector.go +++ b/metricbeat/module/prometheus/collector/collector.go @@ -37,7 +37,7 @@ type MetricSet struct { } func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The prometheus collector metricset is beta") + logp.Beta("The prometheus collector metricset is beta") config := struct { Namespace string `config:"namespace" validate:"required"` diff --git a/metricbeat/module/prometheus/stats/stats.go b/metricbeat/module/prometheus/stats/stats.go index 7864aa0f74b..5b89a096717 100644 --- a/metricbeat/module/prometheus/stats/stats.go +++ b/metricbeat/module/prometheus/stats/stats.go @@ -34,7 +34,7 @@ type MetricSet struct { } func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The prometheus stats metricset is beta") + logp.Beta("The prometheus stats metricset is beta") return &MetricSet{ BaseMetricSet: base, diff --git a/metricbeat/module/vsphere/datastore/datastore.go b/metricbeat/module/vsphere/datastore/datastore.go index 4166ca840c0..519045979d1 100644 --- a/metricbeat/module/vsphere/datastore/datastore.go +++ b/metricbeat/module/vsphere/datastore/datastore.go @@ -29,7 +29,7 @@ type MetricSet struct { } func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("EXPERIMENTAL: The vsphere datastore metricset is experimental") + logp.Experimental("The vsphere datastore metricset is experimental") config := struct { Username string `config:"username"` diff --git a/metricbeat/module/vsphere/host/host.go b/metricbeat/module/vsphere/host/host.go index 4eb029a8c9b..f0f2f067d74 100644 --- a/metricbeat/module/vsphere/host/host.go +++ b/metricbeat/module/vsphere/host/host.go @@ -29,8 +29,7 @@ type MetricSet struct { } func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - - logp.Warn("EXPERIMENTAL: The vsphere host metricset is experimental") + logp.Experimental("The vsphere host metricset is experimental") config := struct { Username string `config:"username"` @@ -61,7 +60,6 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { } func (m *MetricSet) Fetch() ([]common.MapStr, error) { - f := find.NewFinder(m.Client, true) if f == nil { return nil, errors.New("Finder undefined for vsphere.") diff --git a/metricbeat/module/vsphere/virtualmachine/virtualmachine.go b/metricbeat/module/vsphere/virtualmachine/virtualmachine.go index fce05bfa234..d335be7ba3f 100644 --- a/metricbeat/module/vsphere/virtualmachine/virtualmachine.go +++ b/metricbeat/module/vsphere/virtualmachine/virtualmachine.go @@ -30,8 +30,7 @@ type MetricSet struct { } func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - - logp.Warn("EXPERIMENTAL: The vsphere virtualmachine metricset is experimental") + logp.Experimental("The vsphere virtualmachine metricset is experimental") config := struct { Username string `config:"username"` @@ -62,7 +61,6 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { } func (m *MetricSet) Fetch() ([]common.MapStr, error) { - f := find.NewFinder(m.Client, true) if f == nil { return nil, errors.New("Finder undefined for vsphere.") diff --git a/metricbeat/module/windows/perfmon/perfmon.go b/metricbeat/module/windows/perfmon/perfmon.go index b310496ddb5..d3f2c309160 100644 --- a/metricbeat/module/windows/perfmon/perfmon.go +++ b/metricbeat/module/windows/perfmon/perfmon.go @@ -31,7 +31,7 @@ type MetricSet struct { // New create a new instance of the MetricSet. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { - logp.Warn("BETA: The perfmon metricset is beta") + logp.Beta("The perfmon metricset is beta") config := struct { CounterConfig []CounterConfig `config:"perfmon.counters" validate:"required"` diff --git a/metricbeat/tests/system/metricbeat.py b/metricbeat/tests/system/metricbeat.py index dc87b721104..1fe3f8183af 100644 --- a/metricbeat/tests/system/metricbeat.py +++ b/metricbeat/tests/system/metricbeat.py @@ -52,3 +52,15 @@ def de_dot(self, existing_fields): fields[key] = self.de_dot(fields[key]) return fields + + def assert_no_logged_warnings(self): + """ + Assert that the log file contains no ERR or WARN lines. + """ + log = self.get_log() + log = log.replace("WARN EXPERIMENTAL", "") + log = log.replace("WARN BETA", "") + # Jenkins runs as a Windows service and when Jenkins executes theses + # tests the Beat is confused since it thinks it is running as a service. + log = log.replace("ERR Error: The service process could not connect to the service controller.", "") + self.assertNotRegexpMatches(log, "ERR|WARN") diff --git a/metricbeat/tests/system/test_apache.py b/metricbeat/tests/system/test_apache.py index 281182b9d11..77d2f47f7b8 100644 --- a/metricbeat/tests/system/test_apache.py +++ b/metricbeat/tests/system/test_apache.py @@ -44,10 +44,7 @@ def test_output(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertEqual(len(output), 1) diff --git a/metricbeat/tests/system/test_base.py b/metricbeat/tests/system/test_base.py index 2f3d92ce909..2c1db2f41ef 100644 --- a/metricbeat/tests/system/test_base.py +++ b/metricbeat/tests/system/test_base.py @@ -19,10 +19,7 @@ def test_start_stop(self): proc = self.start_beat() self.wait_until(lambda: self.log_contains("start running")) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() # Ensure all Beater stages are used. assert self.log_contains("Setup Beat: metricbeat") diff --git a/metricbeat/tests/system/test_couchbase.py b/metricbeat/tests/system/test_couchbase.py index 1809fa6c86d..8fb209f95bb 100644 --- a/metricbeat/tests/system/test_couchbase.py +++ b/metricbeat/tests/system/test_couchbase.py @@ -19,6 +19,7 @@ def test_bucket(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=20) proc.check_kill_and_wait() + self.assert_no_logged_warnings() output = self.read_output_json() self.assertTrue(len(output) >= 1) @@ -41,6 +42,7 @@ def test_cluster(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=20) proc.check_kill_and_wait() + self.assert_no_logged_warnings() output = self.read_output_json() self.assertTrue(len(output) >= 1) @@ -63,6 +65,7 @@ def test_node(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=20) proc.check_kill_and_wait() + self.assert_no_logged_warnings() output = self.read_output_json() self.assertTrue(len(output) >= 1) diff --git a/metricbeat/tests/system/test_docker.py b/metricbeat/tests/system/test_docker.py index b515f03eb68..5cac25dada2 100644 --- a/metricbeat/tests/system/test_docker.py +++ b/metricbeat/tests/system/test_docker.py @@ -21,10 +21,7 @@ def test_container_fields(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=20) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log.replace("WARN BETA", ""), "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() evt = output[0] @@ -47,10 +44,7 @@ def test_cpu_fields(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=30) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log.replace("WARN BETA", ""), "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() evt = output[0] @@ -77,10 +71,7 @@ def test_diskio_fields(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=30) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log.replace("WARN BETA", ""), "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() evt = output[0] @@ -104,10 +95,7 @@ def test_info_fields(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=30) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log.replace("WARN BETA", ""), "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() evt = output[0] @@ -129,10 +117,7 @@ def test_memory_fields(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=30) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log.replace("WARN BETA", ""), "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() evt = output[0] @@ -155,10 +140,7 @@ def test_network_fields(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=30) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log.replace("WARN BETA", ""), "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() evt = output[0] @@ -181,10 +163,7 @@ def test_health_fields(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=20) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log.replace("WARN BETA", ""), "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() evt = output[0] @@ -207,10 +186,7 @@ def test_image_fields(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=20) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log.replace("WARN BETA", ""), "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() evt = output[0] diff --git a/metricbeat/tests/system/test_dropwizard.py b/metricbeat/tests/system/test_dropwizard.py index 4c202daea8a..0fd8b1132df 100644 --- a/metricbeat/tests/system/test_dropwizard.py +++ b/metricbeat/tests/system/test_dropwizard.py @@ -22,6 +22,7 @@ def test_dropwizard(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=10) proc.check_kill_and_wait() + self.assert_no_logged_warnings() output = self.read_output_json() self.assertTrue(len(output) >= 1) diff --git a/metricbeat/tests/system/test_elasticsearch.py b/metricbeat/tests/system/test_elasticsearch.py index dae25a1c310..32ea7705769 100644 --- a/metricbeat/tests/system/test_elasticsearch.py +++ b/metricbeat/tests/system/test_elasticsearch.py @@ -19,6 +19,7 @@ def test_node(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=20) proc.check_kill_and_wait() + self.assert_no_logged_warnings() output = self.read_output_json() self.assertTrue(len(output) >= 1) @@ -41,6 +42,7 @@ def test_node_stats(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=20) proc.check_kill_and_wait() + self.assert_no_logged_warnings() output = self.read_output_json() self.assertTrue(len(output) >= 1) diff --git a/metricbeat/tests/system/test_golang.py b/metricbeat/tests/system/test_golang.py index 916ff447d07..19ddf8c9db4 100644 --- a/metricbeat/tests/system/test_golang.py +++ b/metricbeat/tests/system/test_golang.py @@ -32,14 +32,7 @@ def test_stats(self): self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches( - log.replace( - "WARN EXPERIMENTAL", - ""), - "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() evt = output[0] diff --git a/metricbeat/tests/system/test_haproxy.py b/metricbeat/tests/system/test_haproxy.py index 558a1f9a060..7fa4b4207ec 100644 --- a/metricbeat/tests/system/test_haproxy.py +++ b/metricbeat/tests/system/test_haproxy.py @@ -22,10 +22,7 @@ def test_info(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertEqual(len(output), 1) @@ -49,10 +46,7 @@ def test_stat(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertGreater(len(output), 0) diff --git a/metricbeat/tests/system/test_http.py b/metricbeat/tests/system/test_http.py index 8c2a3a33894..562869b84b8 100644 --- a/metricbeat/tests/system/test_http.py +++ b/metricbeat/tests/system/test_http.py @@ -23,10 +23,7 @@ def test_json(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log.replace("WARN The http json metricset is in beta.", ""), "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertEqual(len(output), 1) diff --git a/metricbeat/tests/system/test_jolokia.py b/metricbeat/tests/system/test_jolokia.py index 6c37b46f25a..18a19d84901 100644 --- a/metricbeat/tests/system/test_jolokia.py +++ b/metricbeat/tests/system/test_jolokia.py @@ -31,6 +31,7 @@ def test_jmx(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=20) proc.check_kill_and_wait() + self.assert_no_logged_warnings() output = self.read_output_json() self.assertTrue(len(output) >= 1) diff --git a/metricbeat/tests/system/test_kibana.py b/metricbeat/tests/system/test_kibana.py index e112680f7ac..326a73072dc 100644 --- a/metricbeat/tests/system/test_kibana.py +++ b/metricbeat/tests/system/test_kibana.py @@ -19,6 +19,7 @@ def test_status(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=20) proc.check_kill_and_wait() + self.assert_no_logged_warnings() output = self.read_output_json() self.assertTrue(len(output) >= 1) diff --git a/metricbeat/tests/system/test_memcached.py b/metricbeat/tests/system/test_memcached.py index b8bbacb97f5..1a1c7c733b4 100644 --- a/metricbeat/tests/system/test_memcached.py +++ b/metricbeat/tests/system/test_memcached.py @@ -19,6 +19,7 @@ def test_stats(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0, max_timeout=20) proc.check_kill_and_wait() + self.assert_no_logged_warnings() output = self.read_output_json() self.assertTrue(len(output) >= 1) diff --git a/metricbeat/tests/system/test_mongodb.py b/metricbeat/tests/system/test_mongodb.py index 3cf1dd76c12..9497346cd6c 100644 --- a/metricbeat/tests/system/test_mongodb.py +++ b/metricbeat/tests/system/test_mongodb.py @@ -23,10 +23,7 @@ def test_status(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertEqual(len(output), 1) diff --git a/metricbeat/tests/system/test_mysql.py b/metricbeat/tests/system/test_mysql.py index b2631463cd6..e7271f43e14 100644 --- a/metricbeat/tests/system/test_mysql.py +++ b/metricbeat/tests/system/test_mysql.py @@ -26,10 +26,7 @@ def test_status(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertEqual(len(output), 1) diff --git a/metricbeat/tests/system/test_phpfpm.py b/metricbeat/tests/system/test_phpfpm.py index 96c29ec5ebc..475a8c3ec90 100644 --- a/metricbeat/tests/system/test_phpfpm.py +++ b/metricbeat/tests/system/test_phpfpm.py @@ -21,10 +21,7 @@ def test_info(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log.replace("WARN BETA", ""), "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertEqual(len(output), 1) diff --git a/metricbeat/tests/system/test_prometheus.py b/metricbeat/tests/system/test_prometheus.py index f00407fba4c..4e9eae4d263 100644 --- a/metricbeat/tests/system/test_prometheus.py +++ b/metricbeat/tests/system/test_prometheus.py @@ -21,10 +21,7 @@ def test_stats(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log.replace("WARN BETA", ""), "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertEqual(len(output), 1) diff --git a/metricbeat/tests/system/test_redis.py b/metricbeat/tests/system/test_redis.py index 21438252a01..913c29f2b35 100644 --- a/metricbeat/tests/system/test_redis.py +++ b/metricbeat/tests/system/test_redis.py @@ -35,10 +35,7 @@ def test_info(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertEqual(len(output), 1) @@ -71,10 +68,7 @@ def test_keysace(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertEqual(len(output), 1) @@ -104,10 +98,7 @@ def test_filters(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertEqual(len(output), 1) diff --git a/metricbeat/tests/system/test_system.py b/metricbeat/tests/system/test_system.py index c9d11ab43df..527d3ec6a97 100644 --- a/metricbeat/tests/system/test_system.py +++ b/metricbeat/tests/system/test_system.py @@ -57,10 +57,7 @@ def test_cpu(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertEqual(len(output), 1) @@ -86,10 +83,7 @@ def test_cpu_ticks_option(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertGreater(len(output), 0) @@ -112,10 +106,7 @@ def test_core(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertGreater(len(output), 0) @@ -141,10 +132,7 @@ def test_core_with_cpu_ticks(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertGreater(len(output), 0) @@ -167,10 +155,7 @@ def test_load(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertEqual(len(output), 1) @@ -193,10 +178,7 @@ def test_diskio(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertGreater(len(output), 0) @@ -219,10 +201,7 @@ def test_filesystem(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertGreater(len(output), 0) @@ -245,10 +224,7 @@ def test_fsstat(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertEqual(len(output), 1) @@ -271,10 +247,7 @@ def test_memory(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertEqual(len(output), 1) @@ -308,10 +281,7 @@ def test_network(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertGreater(len(output), 0) @@ -343,10 +313,7 @@ def test_process(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertGreater(len(output), 0) diff --git a/metricbeat/tests/system/test_zookeeper.py b/metricbeat/tests/system/test_zookeeper.py index 7975a1eda39..0dd3a4c191b 100644 --- a/metricbeat/tests/system/test_zookeeper.py +++ b/metricbeat/tests/system/test_zookeeper.py @@ -29,10 +29,7 @@ def test_output(self): proc = self.start_beat() self.wait_until(lambda: self.output_lines() > 0) proc.check_kill_and_wait() - - # Ensure no errors or warnings exist in the log. - log = self.get_log() - self.assertNotRegexpMatches(log, "ERR|WARN") + self.assert_no_logged_warnings() output = self.read_output_json() self.assertEqual(len(output), 1) From ab84099b9baec9ebb8a187093b54b3a860a560b2 Mon Sep 17 00:00:00 2001 From: Andrew Kroh Date: Fri, 5 May 2017 17:13:14 -0400 Subject: [PATCH 3/3] Rename TestBadCondition to TestConditions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This test doesn’t actually test any bad conditions. Plus there is another test in the same directory with the name TestBadCondition. --- libbeat/processors/condition_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libbeat/processors/condition_test.go b/libbeat/processors/condition_test.go index a643c489a84..5e92d96d7c9 100644 --- a/libbeat/processors/condition_test.go +++ b/libbeat/processors/condition_test.go @@ -20,7 +20,7 @@ func (c *countFilter) Run(e common.MapStr) (common.MapStr, error) { func (c *countFilter) String() string { return "count" } -func TestBadCondition(t *testing.T) { +func TestConditions(t *testing.T) { if testing.Verbose() { logp.LogInit(logp.LOG_DEBUG, "", false, true, []string{"*"})