From 8684161f8d65f247a5cbb2608692391c5d3ae789 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 13 Jul 2023 19:43:18 +0200 Subject: Makefile: add test target --- .github/workflows/ci.yml | 6 ++---- DEVELOPMENT.md | 5 ++++- Makefile | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a791e75..9d58c15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,10 +31,8 @@ jobs: run: pip install -q -e . - name: Verify that scripts are runnable run: cgitize --version - - name: Unit tests - run: make test/unit - - name: Integration test (local) - run: make test/local + - name: Run tests + run: make test test_docker: runs-on: ubuntu-latest diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 7006dc4..487c318 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -4,7 +4,7 @@ Workspace setup * Create a virtual Python environment: `make venv` * Use the virtual environment: `. .venv/bin/activate` * Deactivate the environment when you're done: `deactivate` -* Make sure unit tests work: `make test/unit` +* Make sure basic tests work: `make test` Development ----------- @@ -21,6 +21,9 @@ Run them using limits. Set environment variables described in [examples/cgitize.toml] to use "access tokens" and get much higher rate limits. + * Run both unit tests and the `local` test using + + make test [examples/cgitize.toml]: examples/cgitize.toml diff --git a/Makefile b/Makefile index 0d7ad33..7f30332 100644 --- a/Makefile +++ b/Makefile @@ -30,20 +30,35 @@ python: .PHONY: repl repl: python +.PHONY: test +test: test/unit test/local + .PHONY: test/unit test/unit: + @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + @echo Unit tests + @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ python -m unittest --verbose --buffer .PHONY: test/local test/local: + @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + @echo Integration test: local + @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./test/integration/local/test.sh .PHONY: test/docker test/docker: + @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + @echo Integration test: docker + @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./test/integration/docker/test.sh .PHONY: test/example test/example: + @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + @echo Integration test: example + @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./test/integration/example/test.sh .PHONY: tag -- cgit v1.2.3