2021-09-07 15:48:58 +00:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
2020-07-01 02:28:31 +00:00
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
|
2021-09-07 15:48:58 +00:00
|
|
|
SHELL = bash
|
|
|
|
|
2021-04-26 17:48:43 +00:00
|
|
|
OUTPUT_DIR = artifacts/
|
|
|
|
KEYWORDS_REPO = git@github.com:nspcc-dev/neofs-keywords.git
|
2021-09-07 15:48:58 +00:00
|
|
|
VENVS = $(shell ls -1d venv/*/ | sort -u | xargs basename -a)
|
2022-07-05 07:18:37 +00:00
|
|
|
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
|
|
|
DEV_IMAGE_PY ?= registry.spb.yadro.com/tools/pytest-neofs-x86_64:4
|
|
|
|
|
|
|
|
ifeq ($(shell uname -s),Darwin)
|
|
|
|
DOCKER_NETWORK = --network bridge -p 389:389 -p 636:636
|
|
|
|
endif
|
|
|
|
|
2021-09-07 15:48:58 +00:00
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: venvs
|
2021-04-26 17:48:43 +00:00
|
|
|
|
2021-09-07 15:48:58 +00:00
|
|
|
include venv_template.mk
|
|
|
|
|
|
|
|
run: venvs
|
2020-12-11 11:35:02 +00:00
|
|
|
@echo "⇒ Test Run"
|
2021-04-26 17:48:43 +00:00
|
|
|
@robot --timestampoutputs --outputdir $(OUTPUT_DIR) robot/testsuites/integration/
|
2020-07-01 02:28:31 +00:00
|
|
|
|
2021-09-07 15:48:58 +00:00
|
|
|
.PHONY: venvs
|
|
|
|
venvs:
|
|
|
|
$(foreach venv,$(VENVS),venv.$(venv))
|
|
|
|
|
|
|
|
$(foreach venv,$(VENVS),$(eval $(call VENV_template,$(venv))))
|
2020-07-01 02:28:31 +00:00
|
|
|
|
2022-02-14 10:57:08 +00:00
|
|
|
submodules:
|
|
|
|
@git submodule init
|
|
|
|
@git submodule update --recursive --remote
|
|
|
|
|
2021-09-07 15:48:58 +00:00
|
|
|
clean:
|
|
|
|
rm -rf venv.*
|
2021-04-26 17:48:43 +00:00
|
|
|
|
2022-07-05 07:18:37 +00:00
|
|
|
pytest-local:
|
|
|
|
@echo "⇒ Run Pytest"
|
|
|
|
export PYTHONPATH=$(ROOT_DIR)/neofs-keywords/lib:$(ROOT_DIR)/neofs-keywords/robot:$(ROOT_DIR)/robot/resources/lib:$(ROOT_DIR)/robot/resources/lib/python_keywords:$(ROOT_DIR)/robot/variables && \
|
|
|
|
python -m pytest pytest_tests/testsuites/
|
|
|
|
|
2021-04-26 17:48:43 +00:00
|
|
|
help:
|
|
|
|
@echo "⇒ run Run testcases ${R}"
|
2022-07-05 07:18:37 +00:00
|
|
|
|
|
|
|
.PHONY: pytest-docker
|
|
|
|
pytest-docker:
|
|
|
|
-docker ps
|
|
|
|
-docker rm neofs_tests_py
|
|
|
|
-docker pull $(DEV_IMAGE_PY)
|
|
|
|
docker run -t --rm \
|
|
|
|
-w /tests \
|
|
|
|
--name neofs_tests_py \
|
|
|
|
-e PYTHONPATH="/tests/neofs-keywords/lib:/tests/neofs-keywords/robot:/tests/robot/resources/lib:/tests/robot/resources/lib/python_keywords:/tests/robot/variables:/tests/pytest_tests/helpers" \
|
|
|
|
-v $(CURDIR):/tests \
|
|
|
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
|
|
|
-v $(NEO_BIN_DIR):/neofs \
|
|
|
|
--privileged \
|
|
|
|
$(DOCKER_NETWORK) \
|
|
|
|
--env-file $(CURDIR)/.env \
|
|
|
|
$(DEV_IMAGE_PY) \
|
|
|
|
-v \
|
|
|
|
-m "$(CI_MARKERS)" \
|
|
|
|
--color=no \
|
|
|
|
--junitxml=/tests/xunit_results.xml \
|
|
|
|
--alluredir=/tests/allure_results \
|
|
|
|
--setup-show \
|
|
|
|
/tests/pytest_tests/testsuites
|