From 218d2b5017a14fe7ed4dd88cc4f1daf0d5999e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Mon, 18 Jan 2021 22:10:49 +0100 Subject: [PATCH 1/8] chore: go vet is already called by golangci-lint See https://github.com/dnephin/pre-commit-golang/pull/62#issuecomment-716907097 and https://golangci-lint.run/usage/linters/ --- .pre-commit-config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 04b04d9e80..2c1b32e4f3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,6 @@ repos: hooks: - id: go-fmt - id: go-lint - - id: go-vet - id: no-go-testing - id: golangci-lint From c4990ca5aace24486a1e08bc85ad2d63957b44a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Tue, 19 Jan 2021 08:23:11 +0100 Subject: [PATCH 2/8] chore: bump precommit-golang --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2c1b32e4f3..5de85f385b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: )$ - repo: git://github.com/dnephin/pre-commit-golang - rev: v0.3.4 + rev: v0.3.5 hooks: - id: go-fmt - id: go-lint From 63d5079784f59f1cc62ab3b79f54db2ee647a396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Tue, 19 Jan 2021 08:29:07 +0100 Subject: [PATCH 3/8] chore: run golangci-lint for modified files Enable the fast linter preset and only run it on newly-modified files, and fix problems as they arise, if the linter supports it --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5de85f385b..758c592b3f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,6 +23,7 @@ repos: - id: go-lint - id: no-go-testing - id: golangci-lint + args: ["--fix", "--fast", "--new"] - repo: git@github.com:elastic/apm-pipeline-library rev: current From 5aa38e181e05d3241fdfe78c55dcebd0bf697788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Tue, 19 Jan 2021 08:29:35 +0100 Subject: [PATCH 4/8] chore: fix line endings --- cli/Building.md | 2 +- cli/LICENSE.txt | 2 +- e2e/LICENSE.txt | 2 +- e2e/_suites/metricbeat/configurations/vsphere.yml | 2 +- notice/NOTICE.txt.tmpl | 2 +- notice/rules.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/Building.md b/cli/Building.md index 3bae645116..9e3473701e 100644 --- a/cli/Building.md +++ b/cli/Building.md @@ -7,4 +7,4 @@ The `build-cli.sh` script builds the binary based on a few environment variables $ GOOS=("darwin" "linux" "windows") ./.ci/scripts/build-cli.sh # and/or $ GOARCH=("386" "amd64") ./.ci/scripts/build-cli.sh -``` \ No newline at end of file +``` diff --git a/cli/LICENSE.txt b/cli/LICENSE.txt index f2c80bdf43..52406b601a 100644 --- a/cli/LICENSE.txt +++ b/cli/LICENSE.txt @@ -1,3 +1,3 @@ Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. Licensed under the Elastic License; -you may not use this file except in compliance with the Elastic License. \ No newline at end of file +you may not use this file except in compliance with the Elastic License. diff --git a/e2e/LICENSE.txt b/e2e/LICENSE.txt index f2c80bdf43..52406b601a 100644 --- a/e2e/LICENSE.txt +++ b/e2e/LICENSE.txt @@ -1,3 +1,3 @@ Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. Licensed under the Elastic License; -you may not use this file except in compliance with the Elastic License. \ No newline at end of file +you may not use this file except in compliance with the Elastic License. diff --git a/e2e/_suites/metricbeat/configurations/vsphere.yml b/e2e/_suites/metricbeat/configurations/vsphere.yml index a0b489fbd2..6299cfc407 100644 --- a/e2e/_suites/metricbeat/configurations/vsphere.yml +++ b/e2e/_suites/metricbeat/configurations/vsphere.yml @@ -9,4 +9,4 @@ metricbeat.modules: hosts: ["https://vsphere:443/sdk"] username: "user" password: "pass" - insecure: true \ No newline at end of file + insecure: true diff --git a/notice/NOTICE.txt.tmpl b/notice/NOTICE.txt.tmpl index 02c7db8900..f10274e294 100644 --- a/notice/NOTICE.txt.tmpl +++ b/notice/NOTICE.txt.tmpl @@ -27,4 +27,4 @@ Third party libraries used by the Elastic Beats project: Indirect dependencies {{ template "depInfo" .Indirect }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/notice/rules.json b/notice/rules.json index e201a07f3e..b3729d9373 100644 --- a/notice/rules.json +++ b/notice/rules.json @@ -15,4 +15,4 @@ "EPL-1.0", "GPL-3.0" ] -} \ No newline at end of file +} From e42ab3afc29a79c0d38118e0a0f3378c4716e665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Tue, 19 Jan 2021 08:45:41 +0100 Subject: [PATCH 5/8] chore: expllicitly set filepaths for gherkin files --- .pre-commit-config.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 758c592b3f..c6b06ba224 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,4 +44,7 @@ repos: - id: remove-en-dashes - id: check-jjbb - id: check-gherkin-lint - args: ["--disable", "AvoidOutlineForSingleExample,TooClumsy,TooLongStep,TooManyDifferentTags,TooManySteps"] + args: [ + "--disable", "AvoidOutlineForSingleExample,TooClumsy,TooLongStep,TooManyDifferentTags,TooManySteps", + "e2e/_suites/**/*.feature", + ] From 2b36d2a7b217d6f1d84b32da3473e44ff8b76331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Tue, 19 Jan 2021 08:54:38 +0100 Subject: [PATCH 6/8] chore: remove trail comma in arrays' last items --- .vscode/launch.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index ed845a6435..d4c4b46bca 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,7 +9,7 @@ "program": "${workspaceFolder}/cli", "env": { "GO111MODULE": "on", - "OP_LOG_LEVEL": "DEBUG", + "OP_LOG_LEVEL": "DEBUG" }, "args": ["run", "-h"] }, @@ -21,7 +21,7 @@ "program": "${workspaceFolder}/cli", "env": { "GO111MODULE": "on", - "OP_LOG_LEVEL": "DEBUG", + "OP_LOG_LEVEL": "DEBUG" }, "args": ["sync", "integrations", "--remote", "elastic:master"] }, @@ -33,7 +33,7 @@ "program": "${workspaceFolder}/cli", "env": { "GO111MODULE": "on", - "OP_LOG_LEVEL": "DEBUG", + "OP_LOG_LEVEL": "DEBUG" }, "args": ["run", "service", "mysql", "--version", "5.6"] }, @@ -45,7 +45,7 @@ "program": "${workspaceFolder}/cli", "env": { "GO111MODULE": "on", - "OP_LOG_LEVEL": "DEBUG", + "OP_LOG_LEVEL": "DEBUG" }, "args": ["stop", "service", "mysql", "--version", "5.6"] }, @@ -57,7 +57,7 @@ "program": "${workspaceFolder}/cli", "env": { "GO111MODULE": "on", - "OP_LOG_LEVEL": "DEBUG", + "OP_LOG_LEVEL": "DEBUG" }, "args": ["deploy", "redis", "--version", "4.0.11", "--profile", "metricbeat"] }, @@ -69,7 +69,7 @@ "program": "${workspaceFolder}/cli", "env": { "GO111MODULE": "on", - "OP_LOG_LEVEL": "DEBUG", + "OP_LOG_LEVEL": "DEBUG" }, "args": ["undeploy", "redis", "--profile", "metricbeat"] }, @@ -81,7 +81,7 @@ "program": "${workspaceFolder}/cli", "env": { "GO111MODULE": "on", - "OP_LOG_LEVEL": "DEBUG", + "OP_LOG_LEVEL": "DEBUG" }, "args": ["run", "profile", "metricbeat", "-v", "7.5.0", "--withServices", "apache:2.2,redis:3.2.12"] }, @@ -93,7 +93,7 @@ "program": "${workspaceFolder}/cli", "env": { "GO111MODULE": "on", - "OP_LOG_LEVEL": "DEBUG", + "OP_LOG_LEVEL": "DEBUG" }, "args": ["stop", "profile", "metricbeat"] }, @@ -105,7 +105,7 @@ "program": "${file}", "env": { "GO111MODULE": "on", - "OP_LOG_LEVEL": "DEBUG", + "OP_LOG_LEVEL": "DEBUG" }, "args": ["--godog.format", "pretty", "metricbeat"] } From c766834c6d77ee043a5e798a6bfb695b95e5cc72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Tue, 19 Jan 2021 09:18:00 +0100 Subject: [PATCH 7/8] chore: add empty Go file to the root directory Golangci-lint is able to continue --- doc.go | 1 + go.mod | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 doc.go create mode 100644 go.mod diff --git a/doc.go b/doc.go new file mode 100644 index 0000000000..06ab7d0f9a --- /dev/null +++ b/doc.go @@ -0,0 +1 @@ +package main diff --git a/go.mod b/go.mod new file mode 100644 index 0000000000..38e69233f2 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/elastic/e2e-testing + +go 1.14 From f757a41b763038c46b5f5747944b4213ae7342bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Tue, 19 Jan 2021 11:11:24 +0100 Subject: [PATCH 8/8] chore: add Go license to empty file --- doc.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc.go b/doc.go index 06ab7d0f9a..526ee16820 100644 --- a/doc.go +++ b/doc.go @@ -1 +1,5 @@ +// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +// or more contributor license agreements. Licensed under the Elastic License; +// you may not use this file except in compliance with the Elastic License. + package main