From 7426d68a9ff7f0072b498fe81278037943440d5e Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 12 Jul 2023 21:59:23 +0200 Subject: Makefile: add shortcuts for integration tests --- Makefile | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 71dab31..0622bc1 100644 --- a/Makefile +++ b/Makefile @@ -92,6 +92,7 @@ buildx/push: . venv_dir := .venv +venv_activate := . '$(call escape,$(venv_dir)/bin/activate)' .PHONY: venv/reset venv/reset: @@ -101,33 +102,42 @@ venv/reset: .PHONY: venv venv: venv/reset - . '$(call escape,$(venv_dir))/bin/activate' && pip install -q -r requirements.txt + $(venv_activate) && pip install -q -r requirements.txt # Is there a better way? .PHONY: venv/upgrade venv/upgrade: venv/reset - . '$(call escape,$(venv_dir))/bin/activate' \ + $(venv_activate) \ && pip install -q . \ && pip uninstall -q --yes '$(call escape,$(PROJECT))' \ && pip freeze > requirements.txt -.PHONY: py -py: python +.PHONY: python +python: + $(venv_activate) && python .PHONY: repl repl: python -.PHONY: python -python: - . '$(call escape,$(venv_dir))/bin/activate' && python +.PHONY: test/unit +test/unit: + python -m unittest --verbose --buffer + +.PHONY: test/local +test/local: + ./test/integration/local/test.sh + +.PHONY: test/docker +test/docker: + ./test/integration/docker/test.sh -.PHONY: test -test: - . '$(call escape,$(venv_dir))/bin/activate' && python -m unittest --verbose --buffer +.PHONY: test/example +test/example: + ./test/integration/example/test.sh .PHONY: tag tag: - . '$(call escape,$(venv_dir))/bin/activate' \ + $(venv_activate) \ && pip install -q --upgrade setuptools-scm \ && version="$$( python -m setuptools_scm --strip-dev )" \ && git tag "v$$version" -- cgit v1.2.3