diff --git a/.buildkite/heartbeat/heartbeat-pipeline.yml b/.buildkite/heartbeat/heartbeat-pipeline.yml index 53323f2b0022..1eeba29a60c7 100644 --- a/.buildkite/heartbeat/heartbeat-pipeline.yml +++ b/.buildkite/heartbeat/heartbeat-pipeline.yml @@ -154,7 +154,7 @@ steps: - github_commit_status: context: "heartbeat: Go Integration Tests" - # Heartbeat has no modules + # Heartbeat has no modules yet - label: ":ubuntu: Heartbeat: Python Integration Tests" command: | cd heartbeat diff --git a/.buildkite/x-pack/pipeline.xpack.auditbeat.yml b/.buildkite/x-pack/pipeline.xpack.auditbeat.yml index 4e4ddde7fe25..40ff383bb83e 100644 --- a/.buildkite/x-pack/pipeline.xpack.auditbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.auditbeat.yml @@ -64,8 +64,6 @@ steps: steps: - label: ":ubuntu: x-pack/auditbeat: Build Tests (Module)" key: "mandatory-linux-unit-test" - env: - MAGEFILE_VERBOSE: true command: | cd x-pack/auditbeat mage update build test diff --git a/.buildkite/x-pack/pipeline.xpack.dockerlogbeat.yml b/.buildkite/x-pack/pipeline.xpack.dockerlogbeat.yml index 49f3cda3b957..4ca750e76e8e 100644 --- a/.buildkite/x-pack/pipeline.xpack.dockerlogbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.dockerlogbeat.yml @@ -68,7 +68,7 @@ steps: - github_commit_status: context: "x-pack/dockerlogbeat: Ubuntu x86_64 Unit Tests" - # x-pack/dockerlogbeat has no modules + # x-pack/dockerlogbeat has no modules yet - label: ":ubuntu: x-pack/dockerlogbeat: Go Integration Tests" key: "mandatory-int-test" command: | diff --git a/.buildkite/x-pack/pipeline.xpack.packetbeat.yml b/.buildkite/x-pack/pipeline.xpack.packetbeat.yml index 6b96973d1225..46afa4cc740a 100644 --- a/.buildkite/x-pack/pipeline.xpack.packetbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.packetbeat.yml @@ -227,7 +227,7 @@ steps: - github_commit_status: context: "x-pack/packetbeat: Win 11 Unit Tests" - - label: ":windows: x-pack/packetbeat: Win 2019 Unit Tests" + - label: ":windows: x-pack/packetbeat: Win 2019 Unit Tests (Module)" command: | Set-Location -Path x-pack/packetbeat mage build unitTest @@ -246,7 +246,7 @@ steps: - "x-pack/packetbeat/build/*.json" notify: - github_commit_status: - context: "x-pack/packetbeat: Win 2019 Unit Tests" + context: "x-pack/packetbeat: Win 2019 Unit Tests (Module)" - label: ":windows: x-pack/packetbeat: Win 10 System Tests" key: "extended-win-10-system-tests" diff --git a/dev-tools/mage/module_changeset.go b/dev-tools/mage/module_changeset.go index fc41af1935b4..5eef73ec5d65 100644 --- a/dev-tools/mage/module_changeset.go +++ b/dev-tools/mage/module_changeset.go @@ -29,16 +29,10 @@ import ( func DefineModules() { beatPath := os.Getenv("BEAT_PATH") if beatPath == "" { - fmt.Errorf("argument required: beatPath") - os.Exit(1) + panic(fmt.Errorf("argument required: beatPath")) } var modulePattern string - //if strings.Contains(beatPath, "x-pack") { - // modulePattern = "^x-pack\\/[a-z0-9]+beat\\/module\\/([^\\/]+)\\/.*" - //} else { - // modulePattern = "^[a-z0-9]+beat\\/module\\/([^\\/]+)\\/.*" - //} modulePattern = fmt.Sprintf("^%s\\/module\\/([^\\/]+)\\/.*", beatPath) moduleRegex, err := regexp.Compile(modulePattern) diff --git a/x-pack/auditbeat/auditbeat.reference.yml b/x-pack/auditbeat/auditbeat.reference.yml index ed82005f0ebf..438ae307b80d 100644 --- a/x-pack/auditbeat/auditbeat.reference.yml +++ b/x-pack/auditbeat/auditbeat.reference.yml @@ -174,7 +174,7 @@ auditbeat.modules: # - file.pe.go_imports_names_entropy # - file.pe.go_imports_names_var_entropy # - file.pe.go_stripped - + # The system module collects security related information about a host. # All datasets send both periodic state information (e.g. all currently # running processes) and real-time changes (e.g. when a new process starts @@ -1245,7 +1245,7 @@ output.elasticsearch: # Permissions to use for file creation. The default is 0600. #permissions: 0600 - + # Configure automatic file rotation on every startup. The default is true. #rotate_on_startup: true @@ -1422,7 +1422,7 @@ setup.template.settings: # ======================== Data Stream Lifecycle (DSL) ========================= -# Configure Data Stream Lifecycle to manage data streams while connected to Serverless elasticsearch. +# Configure Data Stream Lifecycle to manage data streams while connected to Serverless elasticsearch. # These settings are mutually exclusive with ILM settings which are not supported in Serverless projects. # Enable DSL support. Valid values are true, or false. @@ -1430,7 +1430,7 @@ setup.template.settings: # Set the lifecycle policy name or pattern. For DSL, this name must match the data stream that the lifecycle is for. # The default data stream pattern is auditbeat-%{[agent.version]}" -# The template string `%{[agent.version]}` will resolve to the current stack version. +# The template string `%{[agent.version]}` will resolve to the current stack version. # The other possible template value is `%{[beat.name]}`. #setup.dsl.data_stream_pattern: "auditbeat-%{[agent.version]}" diff --git a/x-pack/packetbeat/magefile.go b/x-pack/packetbeat/magefile.go index 7e2c70d2f84e..c76d22c33f6d 100644 --- a/x-pack/packetbeat/magefile.go +++ b/x-pack/packetbeat/magefile.go @@ -27,7 +27,7 @@ import ( //mage:import "github.com/elastic/beats/v7/dev-tools/mage/target/common" //mage:import - _ "github.com/elastic/beats/v7/dev-tools/mage/target/unittest" + "github.com/elastic/beats/v7/dev-tools/mage/target/unittest" //mage:import "github.com/elastic/beats/v7/dev-tools/mage/target/test" ) @@ -207,3 +207,12 @@ func getNpcapInstaller() error { fmt.Printf("getting %s from private cache\n", installer) return sh.RunV("gsutil", "cp", "gs://"+ciBucketName+"/private/"+installer, dstPath) } + +// UnitTest executes the unit tests (Go and Python). +func UnitTest() { + if os.Getenv("CI") == "true" { + mg.Deps(devtools.DefineModules) + } + + unittest.UnitTest() +} diff --git a/x-pack/packetbeat/module/amqp/ingest/default.yml b/x-pack/packetbeat/module/amqp/ingest/default.yml index 7b2268f48129..24abb8f42915 100644 --- a/x-pack/packetbeat/module/amqp/ingest/default.yml +++ b/x-pack/packetbeat/module/amqp/ingest/default.yml @@ -53,7 +53,7 @@ on_failure: - append: field: error.message value: |- - Processor "{{ _ingest.on_failure_processor_type }}" with tag "{{ _ingest.on_failure_processor_tag }}" in pipeline "{{ _ingest.on_failure_pipeline }}" failed with message "{{ _ingest.on_failure_message }}" + Processor "{{ _ingest.on_failure_processor_type }}" with tag "{{ _ingest.on_failure_processor_tag }}" in pipeline "{{ _ingest.on_failure_pipeline }}" failed with message "{{ _ingest.on_failure_message }} - DELETEME" - set: field: event.kind value: pipeline_error