Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feature/monitor-t…
Browse files Browse the repository at this point in the history
…hings

* upstream/master:
  fix: generate a jUnit file per test suite (elastic#907)
  chore: rename slack channel for Fleet's nightly build (elastic#899)
  chore: do not scan 6.8.x branch (elastic#879)
  chore: bump helm versions (elastic#874)
  • Loading branch information
v1v committed Mar 17, 2021
2 parents 514bcbb + b94817c commit 15aaf3f
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 23 deletions.
3 changes: 1 addition & 2 deletions .backportrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"targetBranchChoices": [
{ "name": "7.x", "checked": true },
{ "name": "7.12.x", "checked": true },
{ "name": "7.11.x", "checked": true },
{ "name": "6.8.x", "checked": true }
{ "name": "7.11.x", "checked": true }
],
"targetPRLabels": ["backport"],
"upstream": "elastic/e2e-testing"
Expand Down
2 changes: 1 addition & 1 deletion .ci/e2eTestingFleetDaily.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pipeline {
booleanParam(name: 'notifyOnGreenBuilds', value: true),
booleanParam(name: 'NIGHTLY_SCENARIOS', value: true),
string(name: 'runTestsSuites', value: 'fleet'),
string(name: 'SLACK_CHANNEL', value: "fleet"),
string(name: 'SLACK_CHANNEL', value: "elastic-agent"),
],
propagate: false,
wait: false
Expand Down
2 changes: 1 addition & 1 deletion .ci/jobs/e2e-testing-integrations-daily-mbp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
scm:
- github:
branch-discovery: no-pr
head-filter-regex: '(master|7\.x|7\.12\.x|7\.11\.x|6\.8\.x)'
head-filter-regex: '(master|7\.x|7\.12\.x|7\.11\.x)'
discover-pr-forks-strategy: merge-current
discover-pr-forks-trust: permission
discover-pr-origin: merge-current
Expand Down
2 changes: 1 addition & 1 deletion .ci/jobs/e2e-testing-mbp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
scm:
- github:
branch-discovery: no-pr
head-filter-regex: '(master|PR-.*|v\d\.d\.d|7\.x|7\.12\.x|7\.11\.x|6\.8\.x)'
head-filter-regex: '(master|PR-.*|v\d\.d\.d|7\.x|7\.12\.x|7\.11\.x)'
discover-pr-forks-strategy: merge-current
discover-pr-forks-trust: permission
discover-pr-origin: merge-current
Expand Down
7 changes: 2 additions & 5 deletions .ci/scripts/build-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@ mkdir -p $(pwd)/outputs

go get -v -u gotest.tools/gotestsum

# See https://pkg.go.dev/gotest.tools/gotestsum/#readme-junit-xml-output
GOTESTSUM_JUNITFILE="$(pwd)/outputs/TEST-unit-cli.xml" make -C cli install test

# See https://pkg.go.dev/gotest.tools/gotestsum/#readme-junit-xml-output
GOTESTSUM_JUNITFILE="$(pwd)/outputs/TEST-unit-e2e.xml" make -C e2e unit-test
make -C cli install test
make -C e2e unit-test
4 changes: 2 additions & 2 deletions .ci/scripts/install-helm-test-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ set -euxo pipefail
MSG="parameter missing."
HOME=${HOME:?$MSG}

HELM_VERSION="${HELM_VERSION:-"3.4.1"}"
HELM_VERSION="${HELM_VERSION:-"3.5.2"}"
HELM_TAR_GZ_FILE="helm-v${HELM_VERSION}-linux-amd64.tar.gz"
HELM_KIND_VERSION="v${HELM_KIND_VERSION:-"0.8.1"}"
HELM_KIND_VERSION="v${HELM_KIND_VERSION:-"0.10.0"}"
HELM_KUBERNETES_VERSION="${HELM_KUBERNETES_VERSION:-"1.18.2"}"

HELM_CMD="${HOME}/bin/helm"
Expand Down
6 changes: 4 additions & 2 deletions cli/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Get current directory of a Makefile: https://stackoverflow.com/a/23324703
ROOT_DIR:=$(CURDIR)

include ../commons.mk

TEST_TIMEOUT?=5m

GO_IMAGE?='golang'
Expand Down Expand Up @@ -41,5 +43,5 @@ sync-integrations:
OP_LOG_LEVEL=${LOG_LEVEL} go run main.go sync integrations --delete

.PHONY: test
test:
gotestsum --format testname -- -count=1 -timeout=$(TEST_TIMEOUT) ./...
test: test-report-setup
gotestsum --junitfile "$(PWD)/outputs/TEST-unit-cli.xml" --format testname -- -count=1 -timeout=$(TEST_TIMEOUT) ./...
4 changes: 4 additions & 0 deletions commons.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Prepare junit build context
.PHONY: test-report-setup
test-report-setup:
mkdir -p $(PWD)/outputs
16 changes: 13 additions & 3 deletions e2e/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include ../commons.mk

SUITE?=metricbeat
TAGS?=
DEVELOPER_MODE?=false
Expand Down Expand Up @@ -101,9 +103,17 @@ notice:
-depsOut ""

.PHONY: unit-test
unit-test:
gotestsum --format testname -- -count=1 -timeout=$(TEST_TIMEOUT) ./...
cd _suites && gotestsum --format testname -- -count=1 -timeout=$(TEST_TIMEOUT) ./...
unit-test: test-report-setup unit-test-e2e unit-test-suite-fleet unit-test-suite-helm unit-test-suite-metricbeat

# See https://pkg.go.dev/gotest.tools/gotestsum/#readme-junit-xml-output
.PHONY: unit-test-e2e
unit-test-e2e:
gotestsum --junitfile "$(PWD)/outputs/TEST-unit-e2e.xml" --format testname -- -count=1 -timeout=$(TEST_TIMEOUT) ./...

# See https://pkg.go.dev/gotest.tools/gotestsum/#readme-junit-xml-output
.PHONY: unit-test-suite-%
unit-test-suite-%:
cd _suites/$* && gotestsum --junitfile "$(PWD)/outputs/TEST-unit-e2e-$*.xml" --format testname -- -count=1 -timeout=$(TEST_TIMEOUT) ./...

## Test examples

Expand Down
8 changes: 4 additions & 4 deletions e2e/_suites/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ This is an example of the optional configuration:

```shell
# Depending on the versions used,
export HELM_VERSION="3.4.1" # Helm version: for Helm v2.x.x we have to initialise Tiller right after the k8s cluster
export HELM_CHART_VERSION="7.10.0" # version of the Elastic's Observability Helm charts
export HELM_VERSION="3.5.2" # Helm version: for Helm v2.x.x we have to initialise Tiller right after the k8s cluster
export HELM_CHART_VERSION="7.11.2" # version of the Elastic's Observability Helm charts
export HELM_KUBERNETES_VERSION="1.18.2" # version of the cluster to be passed to kind
```

3. Install dependencies.

- Install Helm 3.4.1
- Install Kind 0.8.1
- Install Helm 3.5.2
- Install Kind 0.10.0
- Install Go: `https://golang.org/doc/install` _(The CI uses [GVM](https://github.com/andrewkroh/gvm))_
- Install godog (from project's root directory): `make -C e2e install-godog`
Expand Down
4 changes: 2 additions & 2 deletions e2e/_suites/helm/helm_charts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var kubectl k8s.Kubectl
var helmVersion = "3.x"

// helmChartVersion represents the default version used for the Elastic Helm charts
var helmChartVersion = "7.10.0"
var helmChartVersion = "7.11.2"

// kubernetesVersion represents the default version used for Kubernetes
var kubernetesVersion = "1.18.2"
Expand Down Expand Up @@ -362,7 +362,7 @@ func (ts *HelmChartTestSuite) getResourceName(resource string) string {
} else if resource == k8s.ResourceTypes.ClusterRoleBinding {
return strings.ToLower(ts.Name + "-" + ts.Name + "-cluster-role-binding")
} else if resource == k8s.ResourceTypes.ConfigMap {
if ts.Name == "metricbeat" {
if ts.Name == "filebeat" || ts.Name == "metricbeat" {
return strings.ToLower(ts.Name + "-" + ts.Name + "-daemonset-config")
}
return strings.ToLower(ts.Name + "-" + ts.Name + "-config")
Expand Down

0 comments on commit 15aaf3f

Please sign in to comment.