Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

fix: remove Helm Chart tests #3285

Merged
merged 63 commits into from
Dec 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
84ae204
bump stack version 8.7.0-04d5f080
Dec 14, 2022
c37bfca
fix: remove Helm Chart tests
kuisathaverat Dec 12, 2022
d079921
test: show env vars and versions
kuisathaverat Dec 14, 2022
ad8b128
test: set shell flags
kuisathaverat Dec 14, 2022
c62bfd1
test: show env
kuisathaverat Dec 14, 2022
0a9b0c4
fix: freeze requirements
kuisathaverat Dec 14, 2022
375f5b8
docs: add ec2 issue
kuisathaverat Dec 14, 2022
1c37ff3
fix: issue with local pyenv versions installed
kuisathaverat Dec 14, 2022
a1a2da4
fix: improve health checks
kuisathaverat Dec 14, 2022
96a3b9c
fix: decrease debug level
kuisathaverat Dec 14, 2022
219bdaa
fix: add some ansible config
kuisathaverat Dec 14, 2022
a24c481
feat: run filebeat to grab the Docker logs
kuisathaverat Dec 14, 2022
b919cef
fix: add run context
kuisathaverat Dec 15, 2022
88b5123
fix: stop stack
kuisathaverat Dec 15, 2022
45d54d6
fix: grab docker logs
kuisathaverat Dec 15, 2022
4143a44
fix: stop stack
kuisathaverat Dec 15, 2022
b6eb682
fix: grab junit results
kuisathaverat Dec 15, 2022
8fd355e
fix: ignore errors
kuisathaverat Dec 15, 2022
6ff58f0
fix: typo
kuisathaverat Dec 15, 2022
bc79fea
fix: grab stack logs from main agent
kuisathaverat Dec 16, 2022
a1c8c89
fix: env generation an configuration by default
kuisathaverat Dec 16, 2022
4ca03df
docs: wrong steps
kuisathaverat Dec 16, 2022
1f13121
fix: update runners
kuisathaverat Dec 16, 2022
d6fb6ac
fix: improve Stack provision
kuisathaverat Dec 16, 2022
7b8d981
fix: remove attribute
kuisathaverat Dec 16, 2022
bb044ab
fix: get public IP
kuisathaverat Dec 19, 2022
46d64ed
fix: lint
kuisathaverat Dec 20, 2022
5abdaf1
fix: remove docker pull output
kuisathaverat Dec 20, 2022
1fdaa74
feat: add clean target
kuisathaverat Dec 20, 2022
4304753
feat: gran Elastic Agent reports
kuisathaverat Dec 20, 2022
7e4aff7
fix: remove label setting
kuisathaverat Dec 20, 2022
0e01afa
chore: Ansible confing
kuisathaverat Dec 20, 2022
8aee710
fix: set test logs right path
kuisathaverat Dec 21, 2022
e8abc6e
fix: retry stack deploy
kuisathaverat Dec 21, 2022
24df8a4
feat: grab logs
kuisathaverat Dec 21, 2022
24dd16c
fix: set proper label
kuisathaverat Dec 21, 2022
765170a
feat: print logs
kuisathaverat Dec 21, 2022
adebec1
fix: increase retry time
kuisathaverat Dec 21, 2022
3f7614a
test: change log to INFO
kuisathaverat Dec 21, 2022
f1f1ae1
fix: sysntax error
kuisathaverat Dec 21, 2022
9eeb502
fix: update update test versions
kuisathaverat Dec 22, 2022
6c2618c
fix: grab logs
kuisathaverat Dec 22, 2022
f3c505e
fix: remove folder before move agent
kuisathaverat Dec 22, 2022
5ed2eec
fix: change log level
kuisathaverat Dec 22, 2022
d440378
fix: set command path
kuisathaverat Dec 22, 2022
550f0a9
fix: fetch logs
kuisathaverat Dec 22, 2022
8880b2c
fix: collect artifacts
kuisathaverat Dec 23, 2022
2dc23b4
feat: allow overwrite Elastic Stack config
kuisathaverat Dec 23, 2022
eb089db
fix: force binariy path
kuisathaverat Dec 23, 2022
7457018
fix: test only releases
kuisathaverat Dec 23, 2022
6367e25
fix: report junit test results
kuisathaverat Dec 23, 2022
48801ea
fix: set runner Ip properly
kuisathaverat Dec 23, 2022
85b5d19
test: collect logs in a tar file
kuisathaverat Dec 27, 2022
9ed633f
fix: wrong flename
kuisathaverat Dec 27, 2022
0b48701
fix: remove fleet folder
kuisathaverat Dec 27, 2022
360a4f2
fix: do not log env
kuisathaverat Dec 28, 2022
0a29e9d
fix: lint
kuisathaverat Dec 28, 2022
e4a63e2
fix: proper report folder name
kuisathaverat Dec 28, 2022
089d1ca
feat: grab logs in fleet mode
kuisathaverat Dec 28, 2022
3129a68
fix: exclude more folders
kuisathaverat Dec 28, 2022
e8bf094
fix: exclude elastic-agent binary
kuisathaverat Dec 29, 2022
a37a8ab
fix: update teardown playbook
kuisathaverat Dec 29, 2022
dbaa9b7
fix: teardown the environment
kuisathaverat Dec 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .ci/.e2e-tests-beats.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
---
SUITES:
- suite: "helm"
provider: "docker"
scenarios:
- name: "Filebeat"
tags: "filebeat"
platforms: ["debian_10_amd64"]
- name: "Metricbeat"
tags: "metricbeat"
platforms: ["debian_10_amd64"]
- suite: "fleet"
scenarios:
- name: "Fleet"
Expand Down
12 changes: 0 additions & 12 deletions .ci/.e2e-tests-daily.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
---
SUITES:
- suite: "helm"
provider: "docker"
scenarios:
- name: "APM Server"
tags: "apm-server"
platforms: ["debian_10_amd64"]
- name: "Filebeat"
tags: "filebeat"
platforms: ["debian_10_amd64"]
- name: "Metricbeat"
tags: "metricbeat"
platforms: ["debian_10_amd64"]
- suite: "fleet"
scenarios:
- name: "Fleet"
Expand Down
12 changes: 0 additions & 12 deletions .ci/.e2e-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
---
SUITES:
- suite: "helm"
provider: "docker"
scenarios:
- name: "APM Server"
tags: "apm-server"
platforms: ["debian_10_amd64"]
- name: "Filebeat"
tags: "filebeat"
platforms: ["debian_10_amd64"]
- name: "Metricbeat"
tags: "metricbeat"
platforms: ["debian_10_amd64"]
- suite: "fleet"
scenarios:
- name: "Fleet"
Expand Down
59 changes: 23 additions & 36 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ pipeline {
booleanParam(name: "notifyOnGreenBuilds", defaultValue: false, description: "If it's needed to notify to Slack with green builds.")
string(name: 'SLACK_CHANNEL', defaultValue: 'observablt-bots', description: 'The Slack channel(s) where errors will be posted. For multiple channels, use a comma-separated list of channels')
string(name: 'ELASTIC_AGENT_DOWNLOAD_URL', defaultValue: '', description: 'If present, it will override the download URL for the Elastic agent artifact. (I.e. https://snapshots.elastic.co/8.0.0-59098054/downloads/beats/elastic-agent/elastic-agent-8.0.0-SNAPSHOT-linux-x86_64.tar.gz')
string(name: 'ELASTIC_AGENT_VERSION', defaultValue: '8.6.0-c9d1a5e9-SNAPSHOT', description: 'SemVer version of the Elastic Agent to be used for the tests. You can use here the tag of your PR to test your changes')
string(name: 'BEAT_VERSION', defaultValue: '8.6.0-c9d1a5e9-SNAPSHOT', description: 'SemVer version of the Beat to be used for the tests. You can use here the tag of your PR to test your changes')
choice(name: 'LOG_LEVEL', choices: ['TRACE', 'DEBUG', 'INFO'], description: 'Log level to be used')
string(name: 'ELASTIC_AGENT_VERSION', defaultValue: '8.7.0-04d5f080-SNAPSHOT', description: 'SemVer version of the Elastic Agent to be used for the tests. You can use here the tag of your PR to test your changes')
string(name: 'BEAT_VERSION', defaultValue: '8.7.0-04d5f080-SNAPSHOT', description: 'SemVer version of the Beat to be used for the tests. You can use here the tag of your PR to test your changes')
choice(name: 'LOG_LEVEL', choices: ['INFO', 'DEBUG', 'TRACE'], description: 'Log level to be used')
choice(name: 'TIMEOUT_FACTOR', choices: ['5', '3', '7', '11'], description: 'Max number of minutes for timeout backoff strategies')
string(name: 'KIBANA_VERSION', defaultValue: '', description: 'Docker tag of the kibana to be used for the tests. It will refer to an image related to a Kibana PR, under the Observability-CI namespace')
string(name: 'STACK_VERSION', defaultValue: '8.6.0-c9d1a5e9-SNAPSHOT', description: 'SemVer version of the stack to be used for the tests.')
string(name: 'STACK_VERSION', defaultValue: '8.7.0-04d5f080-SNAPSHOT', description: 'SemVer version of the stack to be used for the tests.')
string(name: 'HELM_CHART_VERSION', defaultValue: '7.17.3', description: 'SemVer version of Helm chart to be used.')
string(name: 'HELM_VERSION', defaultValue: '3.9.0', description: 'SemVer version of Helm to be used.')
string(name: 'KIND_VERSION', defaultValue: '0.14.0', description: 'SemVer version of Kind to be used.')
Expand All @@ -84,7 +84,6 @@ pipeline {
KIBANA_VERSION = "${params.KIBANA_VERSION.trim()}"
STACK_VERSION = "${params.STACK_VERSION.trim()}"
FORCE_SKIP_GIT_CHECKS = "${params.forceSkipGitChecks}"
HELM_CHART_VERSION = "${params.HELM_CHART_VERSION.trim()}"
HELM_VERSION = "${params.HELM_VERSION.trim()}"
KIND_VERSION = "${params.KIND_VERSION.trim()}"
KUBERNETES_VERSION = "${params.KUBERNETES_VERSION.trim()}"
Expand Down Expand Up @@ -157,17 +156,9 @@ pipeline {
"STACK_INSTANCE_ID=${env.BUILD_URL}_stack",
"TAGS=non-existing-tag"
]) {
ciBuild() {
sh(label: 'Create Stack node', script: "make -C .ci provision-stack")
}
ciBuild() {
retryWithSleep(retries: 3, seconds: 5, backoff: true){
sh(label: 'Setup Stack node', script: "make -C .ci setup-stack")
}
}
ciBuild() {
retryWithSleep(retries: 3, seconds: 5, backoff: true){
sh(label: 'Start Elastic Stack', script: "make -C .ci start-elastic-stack")
sh(label: 'Setup Stack node', script: "make -C .ci create-stack")
}
}
}
Expand Down Expand Up @@ -221,15 +212,27 @@ pipeline {
cleanup {
// Once all tests are complete we need to teardown the single instance with the deployed stack
script {
dir("${env.REAL_BASE_DIR}") {
ciBuild() {
def stackIP = getNodeIp('stack')
sh(label: 'Grab logs', script:"make -C .ci fetch-test-reports NODE_IP_ADDRESS=${stackIP} NODE_LABEL=debian_10_amd64")
archiveArtifacts(allowEmptyArchive: true, artifacts: "outputs/**/TEST-*,outputs/**/*.zip,outputs/**/*.tgz")
junit2otel(traceName: 'junit-e2e-tests', allowEmptyResults: true, keepLongStdio: true, testResults: "outputs/**/TEST-*.xml")
}
}
def stackMachine = getMachineInfo('stack')
if (!params.DESTROY_CLOUD_RESOURCES) {
def stackRunnerIP = getNodeIp('stack')
log(level: 'DEBUG', text: "Stack instance won't be destroyed after the build. Please SSH into the stack machine on ${stackRunnerIP}")
} else {
dir("${env.REAL_BASE_DIR}") {
ciBuild() {
retryWithSleep(retries: 3, seconds: 5, backoff: true){
sh(label: 'Destroy stack node', script: "make -C .ci destroy-stack")
withEnv([
"STACK_INSTANCE_ID=${env.BUILD_URL}_stack",
]) {
ciBuild() {
retryWithSleep(retries: 3, seconds: 5, backoff: true){
sh(label: 'Destroy stack node', script: "make -C .ci destroy-stack")
}
}
}
}
Expand Down Expand Up @@ -278,7 +281,7 @@ def checkSkipTests() {
}

// patterns for all places that should trigger a full build
def regexps = [ "^e2e/_suites/fleet/.*", "^e2e/_suites/helm/.*", "^e2e/_suites/kubernetes-autodiscover/.*", "^.ci/.*", "^cli/.*", "^e2e/.*\\.go", "^internal/.*\\.go" ]
def regexps = [ "^e2e/_suites/fleet/.*", "^e2e/_suites/kubernetes-autodiscover/.*", "^.ci/.*", "^cli/.*", "^e2e/.*\\.go", "^internal/.*\\.go" ]
setEnvVar("SKIP_TESTS", !isGitRegionMatch(patterns: regexps, shouldMatchAll: false))
}
}
Expand All @@ -302,9 +305,6 @@ def ciBuild(Closure body){
[var: "AWS_SECRET_ACCESS_KEY", password: awsAuthObj.secret_key]
]) {
withOtelEnv() {
retryWithSleep(retries: 3, seconds: 5, backoff: true){
sh("make -C .ci setup-env") // make sure the environment is created
}
body()
}
}
Expand Down Expand Up @@ -543,21 +543,8 @@ def generateFunctionalTestStep(Map args = [:]){
}
}
}
withEnv([
"ARCHITECTURE=${goArch}",
"CUCUMBER_REPORTS_PATH=${env.REAL_BASE_DIR}/outputs/${testRunnerIP}",
"PLATFORM=${platform}",
"SUITE=${suite}",
"TAGS=${tags}",
]){
retryWithSleep(retries: 3, seconds: 5, backoff: true){
dockerLogin(secret: "${DOCKER_ELASTIC_SECRET}", registry: "${DOCKER_REGISTRY}")
sh(script: ".ci/scripts/generate-cucumber-reports.sh", label: "generate-cucumber-reports.sh")
}
}
junit2otel(traceName: 'junit-e2e-tests', allowEmptyResults: true, keepLongStdio: true, testResults: "outputs/${testRunnerIP}/TEST-*.xml")
archiveArtifacts allowEmptyArchive: true,
artifacts: "outputs/${testRunnerIP}/TEST-*.xml, outputs/${testRunnerIP}/TEST-*.json, outputs/${testRunnerIP}/TEST-*.json.html"
archiveArtifacts(allowEmptyArchive: true, artifacts: "outputs/**/TEST-*,outputs/**/*.zip,outputs/**/*.tgz")
junit2otel(traceName: 'junit-e2e-tests', allowEmptyResults: true, keepLongStdio: true, testResults: "outputs/**/TEST-*.xml")
}
}
}
Expand Down
69 changes: 51 additions & 18 deletions .ci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ STACK_INSTANCE_ID ?= stack_$(STACK_LABEL)_$(RUN_ID)
# Debian 10 AMD (see .e2e-platforms.yaml)
NODE_IMAGE ?= ami-0d90bed76900e679a
NODE_INSTANCE_TYPE ?= t3.xlarge
NODE_LABEL ?= debian_amd64
NODE_LABEL ?= debian_10_amd64
NODE_SHELL_TYPE ?= sh
NODE_USER ?= admin
NODE_IP_ADDRESS ?= $(shell cat $(PROJECT_DIR)/.ci/.node-host-ip)
Expand All @@ -41,6 +41,12 @@ SUITE ?= fleet
# Tags to run. Please check out the feature files
TAGS ?= fleet_mode

SHELL = /bin/bash
MAKEFLAGS += --silent --no-print-directory
.SHELLFLAGS = -ec

export ANSIBLE_CONFIG := $(CURDIR)/ansible/ansible.cfg

# Check that given variables are set and all have non-empty values,
# die with an error otherwise.
#
Expand All @@ -61,6 +67,21 @@ __check_defined = \
.runID:
echo "$(shell uuidgen|cut -d'-' -f1)" > $(RUN_ID_FILE)

.PHONY: show-env
show-env:
@source $(VENV_DIR)/bin/activate; \
echo "PROJECT_DIR: $(PROJECT_DIR)"; \
echo "VENV_DIR: $(VENV_DIR)"; \
echo "VENV_BIN_DIR: $(VENV_BIN_DIR)"; \
echo "ANSIBLE: $$(ansible --version)"; \
echo "Python: $$(python --version)"; \
echo "RUN_ID: $(RUN_ID)"; \
echo "STACK_VERSION: $(STACK_VERSION)"; \
echo "SUITE: $(SUITE)"; \
echo "TAGS: $(TAGS)"; \
echo "PROVIDER: $(PROVIDER)";
echo "NODE_LABEL: $(NODE_LABEL)";

.PHONY: setup-env
setup-env:
$(MAKE) .runID
Expand All @@ -74,17 +95,18 @@ destroy-env:
rm -fr $(VENV_DIR)

.PHONY: list-platforms
list-platforms:
list-platforms:
@docker run --rm -i -w "/workdir" -v $(PROJECT_DIR)/.ci:/workdir mikefarah/yq:4 ".PLATFORMS | keys" .e2e-platforms.yaml

# Create the env file for the target platform
.PHONY: set-env-%
set-env-%:
@$(PROJECT_DIR)/.ci/scripts/yq.sh "$*"
@$(PROJECT_DIR)/.ci/scripts/gen-platform-env-file.py "$*"

.PHONY: provision-stack
provision-stack: .runID
provision-stack: setup-env show-env
@:$(call check_defined, RUN_ID, You need to an unique RUN_ID. To create it please run 'make .runID' goal)
source $(VENV_DIR)/bin/activate; \
$(ANSIBLE_PLAYBOOK) $(PROJECT_DIR)/.ci/ansible/playbook.yml \
--private-key="$(SSH_KEY)" \
--extra-vars "$(LABELS_STRING) nodeLabel=stack nodeImage=$(STACK_IMAGE) nodeInstanceType=$(STACK_INSTANCE_TYPE) nodeUser=$(STACK_USER)" \
Expand All @@ -94,9 +116,10 @@ provision-stack: .runID

.PHONY: setup-stack
setup-stack: export TAGS = non-existing-tag
setup-stack: .runID
setup-stack: setup-env show-env
@:$(call check_defined, RUN_ID, You need to have an unique RUN_ID. To create it please run 'make .runID' goal)
@:$(call check_defined, STACK_IP_ADDRESS, IP address of the stack not defined)
source $(VENV_DIR)/bin/activate; \
$(ANSIBLE_PLAYBOOK) $(PROJECT_DIR)/.ci/ansible/playbook.yml \
--private-key="$(SSH_KEY)" \
--extra-vars "$(LABELS_STRING) nodeLabel=stack nodeImage=$(STACK_IMAGE) nodeInstanceType=$(STACK_INSTANCE_TYPE) nodeUser=$(STACK_USER)" \
Expand All @@ -109,15 +132,15 @@ setup-stack: .runID
create-stack: provision-stack setup-stack start-elastic-stack

.PHONY: destroy-stack
destroy-stack:
destroy-stack: setup-env show-env
@:$(call check_defined, RUN_ID, You need to have an unique RUN_ID. To create it please run 'make .runID' goal)
$(ANSIBLE_PLAYBOOK) $(PROJECT_DIR)/.ci/ansible/playbook.yml \
source $(VENV_DIR)/bin/activate; \
$(ANSIBLE_PLAYBOOK) $(PROJECT_DIR)/.ci/ansible/teardown.yml \
--private-key="$(SSH_KEY)" \
--extra-vars="$(LABELS_STRING) nodeLabel=stack nodeImage=$(STACK_IMAGE) nodeUser=$(STACK_IMAGE)" \
--extra-vars="runId=$(RUN_ID) instanceID=$(STACK_INSTANCE_ID) nodeShellType=$(STACK_SHELL_TYPE) workspace=$(PROJECT_DIR)/ sshPublicKey=$(SSH_KEY_PUBLIC)" \
--ssh-common-args='$(SSH_OPTS)' \
-t destroy
rm -fr $(PROJECT_DIR)/.ci/.stack-host-ip
--ssh-common-args='$(SSH_OPTS)'
# rm -fr $(PROJECT_DIR)/.ci/.stack-host-ip

.PHONY: ssh-stack
ssh-stack:
Expand All @@ -132,9 +155,10 @@ show-stack:
@echo "Stack Shell : $(STACK_SHELL_TYPE)"

.PHONY: provision-node
provision-node: .runID set-env-$(NODE_LABEL)
provision-node: setup-env set-env-$(NODE_LABEL)
@:$(call check_defined, RUN_ID, You need to have an unique RUN_ID. To create it please run 'make .runID' goal)
@:$(call check_defined, STACK_IP_ADDRESS, IP address of the stack not defined)
source $(VENV_DIR)/bin/activate; \
. $(PROJECT_DIR)/.ci/.env-$(NODE_LABEL) && $(ANSIBLE_PLAYBOOK) $(PROJECT_DIR)/.ci/ansible/playbook.yml \
--private-key="$(SSH_KEY)" \
--extra-vars "$(LABELS_STRING) stackRunner=$(STACK_IP_ADDRESS) nodeLabel=$${NODE_LABEL} nodeImage=$${NODE_IMAGE} nodeInstanceType=$${NODE_INSTANCE_TYPE} nodeUser=$${NODE_USER}" \
Expand All @@ -143,11 +167,11 @@ provision-node: .runID set-env-$(NODE_LABEL)
-t provision-node

.PHONY: setup-node
setup-node: .runID set-env-$(NODE_LABEL)
setup-node: setup-env set-env-$(NODE_LABEL)
@:$(call check_defined, RUN_ID, You need to have an unique RUN_ID. To create it please run 'make .runID' goal)
@:$(call check_defined, STACK_IP_ADDRESS, IP address of the stack not defined)
@:$(call check_defined, NODE_IP_ADDRESS, IP address of the test node not defined)
source $(VENV)/bin/activate; \
source $(VENV_DIR)/bin/activate; \
. $(PROJECT_DIR)/.ci/.env-$(NODE_LABEL) && $(ANSIBLE_PLAYBOOK) $(PROJECT_DIR)/.ci/ansible/playbook.yml \
--private-key="$(SSH_KEY)" \
--extra-vars "$(LABELS_STRING) stackRunner=$(STACK_IP_ADDRESS) nodeLabel=$${NODE_LABEL} nodeImage=$${NODE_IMAGE} nodeInstanceType=$${NODE_INSTANCE_TYPE} nodeUser=$${NODE_USER}" \
Expand All @@ -160,8 +184,9 @@ setup-node: .runID set-env-$(NODE_LABEL)
create-node: provision-node setup-node

.PHONY: destroy-node
destroy-node: set-env-$(NODE_LABEL)
destroy-node: setup-env set-env-$(NODE_LABEL)
@:$(call check_defined, RUN_ID, You need to have an unique RUN_ID. To create it please run 'make .runID' goal)
source $(VENV_DIR)/bin/activate; \
. $(PROJECT_DIR)/.ci/.env-$(NODE_LABEL) && $(ANSIBLE_PLAYBOOK) $(PROJECT_DIR)/.ci/ansible/teardown.yml \
--private-key="$(SSH_KEY)" \
--extra-vars="$(LABELS_STRING) nodeLabel=$${NODE_LABEL} nodeImage=$${NODE_IMAGE} nodeUser=$${NODE_USER}" \
Expand All @@ -170,9 +195,10 @@ destroy-node: set-env-$(NODE_LABEL)
rm -fr $(PROJECT_DIR)/.ci/.node-host-ip

.PHONY: fetch-test-reports
fetch-test-reports: .runID set-env-$(NODE_LABEL)
fetch-test-reports: setup-env set-env-$(NODE_LABEL)
@:$(call check_defined, RUN_ID, You need to have an unique RUN_ID. To create it please run 'make .runID' goal)
@:$(call check_defined, NODE_IP_ADDRESS, IP address of the test node not defined)
source $(VENV_DIR)/bin/activate; \
. $(PROJECT_DIR)/.ci/.env-$(NODE_LABEL) && $(ANSIBLE_PLAYBOOK) $(PROJECT_DIR)/.ci/ansible/fetch-test-reports.yml \
--private-key="$(SSH_KEY)" \
--extra-vars "$(LABELS_STRING) nodeLabel=$${NODE_LABEL} nodeImage=$${NODE_IMAGE} nodeInstanceType=$${NODE_INSTANCE_TYPE} nodeUser=$${NODE_USER}" \
Expand All @@ -199,8 +225,9 @@ destroy-elastic-stack:
ssh $(SSH_OPTS_EXTENDED) -i $(SSH_KEY) $(STACK_USER)@$(STACK_IP_ADDRESS) 'sudo docker-compose -f /root/.op/compose/profiles/fleet/docker-compose.yml down --remove-orphans'

.PHONY: start-elastic-stack
start-elastic-stack:
start-elastic-stack: setup-env show-env
@:$(call check_defined, RUN_ID, You need to have an unique RUN_ID. To create it please run 'make .runID' goal)
source $(VENV_DIR)/bin/activate; \
PROVIDER="remote" SUITE="$(SUITE)" TAGS="non-existent-tag" \
$(ANSIBLE_PLAYBOOK) $(PROJECT_DIR)/.ci/ansible/elastic-stack.yml \
--private-key="$(SSH_KEY)" \
Expand All @@ -217,8 +244,9 @@ recreate-fleet-server:
$(MAKE) start-elastic-stack

.PHONY: run-tests
run-tests: set-env-$(NODE_LABEL)
run-tests: setup-env set-env-$(NODE_LABEL) show-env
@:$(call check_defined, RUN_ID, You need to have an unique RUN_ID. To create it please run 'make .runID' goal)
source $(VENV_DIR)/bin/activate; \
. $(PROJECT_DIR)/.ci/.env-$(NODE_LABEL) && PROVIDER="$(PROVIDER)" SUITE="$(SUITE)" TAGS="$(TAGS)" REPORT_PREFIX="$(SUITE)_$${NODE_LABEL}_$(TAGS)" \
$(ANSIBLE_PLAYBOOK) $(PROJECT_DIR)/.ci/ansible/run-tests.yml \
--private-key="$(SSH_KEY)" \
Expand All @@ -230,8 +258,9 @@ run-tests: set-env-$(NODE_LABEL)
. $(PROJECT_DIR)/.ci/.env-$(NODE_LABEL) && ssh $(SSH_OPTS_EXTENDED) -i $(SSH_KEY) $${NODE_USER}@$(NODE_IP_ADDRESS) "sudo bash /home/$${NODE_USER}/e2e-testing/.ci/scripts/functional-test.sh \"$(TAGS)\""

.PHONY: run-tests-win
run-tests-win: set-env-$(NODE_LABEL)
run-tests-win: setup-env set-env-$(NODE_LABEL) show-env
@:$(call check_defined, RUN_ID, You need to have an unique RUN_ID. To create it please run 'make .runID' goal)
source $(VENV_DIR)/bin/activate; \
. $(PROJECT_DIR)/.ci/.env-$(NODE_LABEL) && PROVIDER="$(PROVIDER)" SUITE="$(SUITE)" TAGS="$(TAGS)" REPORT_PREFIX="$(SUITE)_$${NODE_LABEL}_$(TAGS)" \
$(ANSIBLE_PLAYBOOK) $(PROJECT_DIR)/.ci/ansible/run-tests.yml \
--private-key="$(SSH_KEY)" \
Expand All @@ -241,3 +270,7 @@ run-tests-win: set-env-$(NODE_LABEL)
-t run-tests \
-i $(NODE_IP_ADDRESS),
. $(PROJECT_DIR)/.ci/.env-$(NODE_LABEL) && ssh $(SSH_OPTS_EXTENDED) -i $(SSH_KEY) $${NODE_USER}@$(NODE_IP_ADDRESS) "powershell \"C:/Users/$${NODE_USER}/e2e-testing/.ci/scripts/functional-test.ps1\""

.PHONY: clean
clean:
rm -fr "$(PROJECT_DIR)/.ci/".env-* "$(PROJECT_DIR)/.ci/.node-host-ip" "$(PROJECT_DIR)/.ci/.runID" "$(PROJECT_DIR)/.ci/.stack-host-ip" "$(PROJECT_DIR)/outputs" "$(PROJECT_DIR)/None-sshhosts" "$(PROJECT_DIR)/stack-sshhosts"
Loading