Skip to content

Commit

Permalink
Merge pull request #281 from clumio-oss/local-testing
Browse files Browse the repository at this point in the history
Improve support for local testing.
  • Loading branch information
sodul authored Jan 25, 2024
2 parents b4a8e40 + 9069172 commit 042e32e
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 188 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ jobs:
- name: Install
run: |
python -m pip install --upgrade pip
pip install --upgrade -r requirements-optional.txt
pip install --upgrade -e .
pip install --upgrade .[dev]
- name: Format
run: black --check --diff green example
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Unreleased
#### Date TBD

- Cleanup test_runner.py to more modern Python style.
- Simplify green's dev testing setup.

# Version 4.0.0
#### 16 Jan 2024

Expand Down
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@ test: test-versions test-installed test-coverage
@echo "\n(test) completed\n"

test-local:
@pip3 install -r requirements-optional.txt
@pip3 install --upgrade -e .[dev]
@make test-installed
make test-versions
make test-coverage
@# test-coverage needs to be last in deps, don't clean after it runs!

test-on-containers: clean-silent
@# Run the tests on pristine containers to isolate us from the local environment.
@for version in 3.8 3.9 3.10 3.11 3.12.0; do \
docker run --rm -it -v `pwd`:/green python:$$version \
bash -c "python --version; cd /green && pip install -e .[dev] && ./g green" ; \
done

test-coverage:
@# Generate coverage files for travis builds (don't clean after this!)
@make clean-silent
Expand All @@ -40,10 +47,9 @@ test-installed:
@rm -rf venv-installed
@python3 -m venv venv-installed
@make clean-silent
source venv-installed/bin/activate; pip3 install -r requirements-optional.txt
source venv-installed/bin/activate; python3 setup.py sdist
tar zxvf dist/green-$(VERSION).tar.gz
source venv-installed/bin/activate; cd green-$(VERSION) && pip3 install .
source venv-installed/bin/activate; cd green-$(VERSION) && pip3 install --upgrade .[dev]
source venv-installed/bin/activate; green -vvvv green
@rm -rf venv-installed
@make clean-silent
Expand Down
Loading

0 comments on commit 042e32e

Please sign in to comment.