From 618c4f7e26eb42ac005ee9ce4ec93c92d9173614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mi=20V=C3=A1nyi?= Date: Wed, 15 Jan 2020 16:40:41 +0100 Subject: [PATCH 1/3] new build target: generate pkg file to test the manager --- x-pack/functionbeat/magefile.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/x-pack/functionbeat/magefile.go b/x-pack/functionbeat/magefile.go index 6a10ee93f30..18edabba7dd 100644 --- a/x-pack/functionbeat/magefile.go +++ b/x-pack/functionbeat/magefile.go @@ -8,6 +8,7 @@ package main import ( "fmt" + "os" "path/filepath" "time" @@ -147,6 +148,34 @@ func GoTestUnit() { mg.Deps(unittest.GoUnitTest) } +func BuildPkgForFunctions() error { + mg.Deps(Update, Build) + + err := os.MkdirAll("pkg", 700) + if err != nil { + return err + } + + filesToCopy := map[string]string{ + filepath.Join("provider", "aws", "functionbeat-aws"): filepath.Join("pkg", "functionbeat-aws"), + filepath.Join("provider", "gcp", "pubsub", "pubsub.go"): filepath.Join("pkg", "pubsub", "pubsub.go"), + filepath.Join("provider", "gcp", "storage", "storage.go"): filepath.Join("pkg", "storage", "storage.go"), + filepath.Join("provider", "gcp", "build", "pubsub", "vendor"): filepath.Join("pkg", "pubsub", "vendor"), + filepath.Join("provider", "gcp", "build", "storage", "vendor"): filepath.Join("pkg", "storage", "vendor"), + } + for src, dest := range filesToCopy { + c := &devtools.CopyTask{ + Source: src, + Dest: dest, + } + err = c.Execute() + if err != nil { + return err + } + } + return nil +} + // BuildSystemTestBinary build a binary for testing that is instrumented for // testing and measuring code coverage. The binary is only instrumented for // coverage when TEST_COVERAGE=true (default is false). From 143a3099175a39394740ffea281a9edf78e59364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mi=20V=C3=A1nyi?= Date: Wed, 15 Jan 2020 17:00:12 +0100 Subject: [PATCH 2/3] add comment --- x-pack/functionbeat/magefile.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/functionbeat/magefile.go b/x-pack/functionbeat/magefile.go index 18edabba7dd..ab3432c720a 100644 --- a/x-pack/functionbeat/magefile.go +++ b/x-pack/functionbeat/magefile.go @@ -148,6 +148,8 @@ func GoTestUnit() { mg.Deps(unittest.GoUnitTest) } +// BuildPkgForFunctions creates a folder named pkg and adds functions to it. +// This makes testing the manager more comfortable. func BuildPkgForFunctions() error { mg.Deps(Update, Build) From 5689a5bf344ece2bbf4a8dfa7512e58392a6d7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mi=20V=C3=A1nyi?= Date: Wed, 15 Jan 2020 17:01:17 +0100 Subject: [PATCH 3/3] add changelog entry --- CHANGELOG-developer.next.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG-developer.next.asciidoc b/CHANGELOG-developer.next.asciidoc index db5cf33c5d9..feaa59c5dec 100644 --- a/CHANGELOG-developer.next.asciidoc +++ b/CHANGELOG-developer.next.asciidoc @@ -64,3 +64,4 @@ The list below covers the major changes between 7.0.0-rc2 and master only. - Added a `default_field` option to fields in fields.yml to offer a way to exclude fields from the default_field list. {issue}14262[14262] {pull}14341[14341] - `supported-versions.yml` can be used in metricbeat python system tests to obtain the build args for docker compose builds. {pull}14520[14520] - Fix dropped errors in the tests for the metricbeat Azure module. {pull}13773[13773] +- New mage target for Functionbeat: generate pkg folder to make manager easier. {pull}15580[15880]