diff --git a/CHANGELOG-developer.next.asciidoc b/CHANGELOG-developer.next.asciidoc index b40b45d6af31..6710368a2328 100644 --- a/CHANGELOG-developer.next.asciidoc +++ b/CHANGELOG-developer.next.asciidoc @@ -115,6 +115,7 @@ The list below covers the major changes between 7.0.0-rc2 and main only. - Fix IIS module logging errors in case application pool PDH counter is not found. {pull}42274[42274] - Removed direct dependency on Azure/go-autorest/autorest/adal, which is deprecated. {issue}41463[41463] {pull}42959[42959] - Fixed flaky zookeeper integration tests. {pull}43638[43638] +- Fixed Fileebat GCP Pub/Sub input integration tests. {pull}45150[45150] ==== Added diff --git a/dev-tools/mage/integtest_docker.go b/dev-tools/mage/integtest_docker.go index c1b094984667..c9c16e2193e5 100644 --- a/dev-tools/mage/integtest_docker.go +++ b/dev-tools/mage/integtest_docker.go @@ -191,6 +191,8 @@ func WithGoIntegTestHostEnv(env map[string]string) map[string]string { // images for the next release after a feature freeze, which causes temporary test failures. env["TESTING_FILEBEAT_ALLOW_OLDER"] = "1" + env["PUBSUB_EMULATOR_HOST"] = "localhost:8432" + return env } diff --git a/x-pack/filebeat/input/gcppubsub/_meta/Dockerfile b/testing/environments/docker/googlepubsub/Dockerfile similarity index 100% rename from x-pack/filebeat/input/gcppubsub/_meta/Dockerfile rename to testing/environments/docker/googlepubsub/Dockerfile diff --git a/x-pack/filebeat/input/gcppubsub/_meta/supported-versions.yml b/testing/environments/docker/googlepubsub/supported-versions.yml similarity index 100% rename from x-pack/filebeat/input/gcppubsub/_meta/supported-versions.yml rename to testing/environments/docker/googlepubsub/supported-versions.yml diff --git a/x-pack/agentbeat/docker-compose.yml b/x-pack/agentbeat/docker-compose.yml index b4dbda4d86f6..37eb6dd516c4 100644 --- a/x-pack/agentbeat/docker-compose.yml +++ b/x-pack/agentbeat/docker-compose.yml @@ -20,6 +20,16 @@ services: ports: - 9200:9200 + googlepubsub: + image: docker.elastic.co/integrations-ci/beats-googlepubsub:emulator-${SDK_VERSION:-398.0.0-0}-1 + build: + context: ${ES_BEATS}/testing/environments/docker/googlepubsub + args: + SDK_VERSION: ${SDK_VERSION:-398.0.0-0} + hostname: googlepubsub + ports: + - 8432:8432 + cometd: build: ${ES_BEATS}/testing/environments/docker/cometd hostname: cometd diff --git a/x-pack/filebeat/docker-compose.yml b/x-pack/filebeat/docker-compose.yml index dfb2a061e91b..3638a7e9b25f 100644 --- a/x-pack/filebeat/docker-compose.yml +++ b/x-pack/filebeat/docker-compose.yml @@ -20,6 +20,16 @@ services: ports: - 9200:9200 + googlepubsub: + image: docker.elastic.co/integrations-ci/beats-googlepubsub:emulator-${SDK_VERSION:-398.0.0-0}-1 + build: + context: ${ES_BEATS}/testing/environments/docker/googlepubsub + args: + SDK_VERSION: ${SDK_VERSION:-398.0.0-0} + hostname: googlepubsub + ports: + - 8432:8432 + cometd: build: ${ES_BEATS}/testing/environments/docker/cometd hostname: cometd diff --git a/x-pack/filebeat/input/gcppubsub/docker-compose.yml b/x-pack/filebeat/input/gcppubsub/docker-compose.yml deleted file mode 100644 index 60ce3ebd83f7..000000000000 --- a/x-pack/filebeat/input/gcppubsub/docker-compose.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: '2.3' - -services: - googlepubsub: - image: docker.elastic.co/integrations-ci/beats-googlepubsub:emulator-${SDK_VERSION:-398.0.0-0}-1 - build: - context: ./_meta - args: - SDK_VERSION: ${SDK_VERSION:-398.0.0-0} - ports: - - '127.0.0.1:8432:8432' diff --git a/x-pack/filebeat/input/gcppubsub/pubsub_test.go b/x-pack/filebeat/input/gcppubsub/pubsub_test.go index 7e719d7102db..6e845d3f3d1d 100644 --- a/x-pack/filebeat/input/gcppubsub/pubsub_test.go +++ b/x-pack/filebeat/input/gcppubsub/pubsub_test.go @@ -251,6 +251,8 @@ func runTestWithACKer(t *testing.T, cfg *conf.C, onEvent eventHandler, run func( } //nolint:errcheck // ignore pubsubInput := in.(*pubsubInput) + // Initialize metrics explicitly for tests + pubsubInput.metrics = newInputMetrics("", nil) defer pubsubInput.Stop() run(client, pubsubInput, eventOutlet, t)