-
Notifications
You must be signed in to change notification settings - Fork 383
Replace tox
with pytest
and Makefile
, cleanup in docs/Makefile
#669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
fb9c056
2f77a2f
f77ffdb
a12dc5f
b842d41
4982b68
485e80c
1656286
92bb926
96baeca
d9abd16
a54d756
324669e
d898ac5
b1edb7c
7531347
9000d33
fd3a218
70c3f74
81695d6
7938b65
3ae152b
37d5537
11ada60
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
[run] | ||
omit = | ||
.tox/* | ||
tests/* |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2,7 +2,7 @@ name: Python CI | |||||
on: [push, workflow_dispatch] | ||||||
|
||||||
jobs: | ||||||
build: | ||||||
run-test-suite: | ||||||
runs-on: ${{ matrix.os }} | ||||||
strategy: | ||||||
fail-fast: false | ||||||
|
@@ -23,13 +23,17 @@ jobs: | |||||
steps: | ||||||
- name: Checkout code | ||||||
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 | ||||||
- name: Run docker compose | ||||||
- name: Launch Splunk Docker instance | ||||||
run: SPLUNK_VERSION=${{ matrix.splunk-version }} docker compose up -d | ||||||
- name: Setup Python | ||||||
- name: Setup Python ${{ matrix.python-version }} | ||||||
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c | ||||||
with: | ||||||
python-version: ${{ matrix.python-version }} | ||||||
- name: Install tox | ||||||
run: pip install tox | ||||||
- name: Test Execution | ||||||
run: tox -e py -- ./tests | ||||||
- name: (Python 3.7) Install dependencies | ||||||
if: ${{ matrix.python-version == '3.7' }} | ||||||
run: python -m pip install python-dotenv deprecation pytest | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Can we drop that now? Or is it still required by something? |
||||||
- name: (Python >= 3.9) Install dependencies | ||||||
if: ${{ matrix.python-version != '3.7' }} | ||||||
run: python -m pip install . --group test | ||||||
- name: Run entire test suite | ||||||
run: python -m pytest ./tests |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,56 +1,48 @@ | ||||||
RESET_COLOR=\033[0m | ||||||
GREEN_COLOR=\033[32;01m | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: remove that newline |
||||||
CONTAINER_NAME := 'splunk' | ||||||
CONTAINER_NAME := "splunk" | ||||||
|
||||||
.PHONY: docs | ||||||
docs: | ||||||
@echo "$(GREEN_COLOR)==> docs $(RESET_COLOR)" | ||||||
@rm -rf ./docs/_build | ||||||
@tox -e docs | ||||||
@cd ./docs/_build/html && zip -r ../docs_html.zip . -x ".*" -x "__MACOSX" | ||||||
@echo "$(ATTN_COLOR)==> Docs pages can be found at ./docs/_build/html, docs bundle available at ./docs/_build/docs_html.zip" | ||||||
@make -C ./docs html | ||||||
|
||||||
.PHONY: test | ||||||
test: | ||||||
@echo "$(GREEN_COLOR)==> test $(RESET_COLOR)" | ||||||
@tox -e py -- ./tests | ||||||
@python -m pytest ./tests | ||||||
|
||||||
.PHONY: test-unit | ||||||
test: | ||||||
@echo "$(GREEN_COLOR)==> test $(RESET_COLOR)" | ||||||
@tox -e py -- ./tests/unit | ||||||
test-unit: | ||||||
@python -m pytest ./tests/unit | ||||||
|
||||||
.PHONY: test-integration | ||||||
test: | ||||||
@echo "$(GREEN_COLOR)==> test $(RESET_COLOR)" | ||||||
@tox -e py -- ./tests/integration ./tests/system | ||||||
test-integration: | ||||||
@python -m pytest ./tests/integration ./tests/system | ||||||
|
||||||
.PHONY: up | ||||||
up: | ||||||
@echo "$(GREEN_COLOR)==> up $(RESET_COLOR)" | ||||||
.PHONY: docker-up | ||||||
docker-up: | ||||||
@docker-compose up -d | ||||||
|
||||||
.PHONY: remove | ||||||
remove: | ||||||
@echo "$(GREEN_COLOR)==> rm $(RESET_COLOR)" | ||||||
@docker-compose rm -f -s | ||||||
|
||||||
.PHONY: wait_up | ||||||
wait_up: | ||||||
@echo "$(GREEN_COLOR)==> wait_up $(RESET_COLOR)" | ||||||
@for i in `seq 0 180`; do if docker exec -it $(CONTAINER_NAME) /sbin/checkstate.sh &> /dev/null; then break; fi; printf "\rWaiting for Splunk for %s seconds..." $$i; sleep 1; done | ||||||
|
||||||
.PHONY: down | ||||||
down: | ||||||
@echo "$(GREEN_COLOR)==> down $(RESET_COLOR)" | ||||||
.PHONY: docker-ensure-up | ||||||
docker-ensure-up: | ||||||
@for i in `seq 0 180`; do \ | ||||||
if docker exec -it $(CONTAINER_NAME) /sbin/checkstate.sh &> /dev/null; then \ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This command is really bad and i have been frustrated with it (while using podman), since it does not differentiate between errors returned by
Suggested change
This way you at least get an error that docker is not in
Still not ideal, but at least the error is visible. |
||||||
break; \ | ||||||
fi; \ | ||||||
printf "\rWaiting for Splunk for %s seconds..." $$i; \ | ||||||
sleep 1; \ | ||||||
done | ||||||
.PHONY: docker-start | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: add newline before this. |
||||||
docker-start: docker-up docker-ensure-up | ||||||
|
||||||
.PHONY: docker-down | ||||||
docker-down: | ||||||
@docker-compose stop | ||||||
|
||||||
.PHONY: start | ||||||
start: up wait_up | ||||||
.PHONY: docker-restart | ||||||
docker-restart: docker-down docker-start | ||||||
|
||||||
.PHONY: restart | ||||||
restart: down start | ||||||
.PHONY: docker-remove | ||||||
docker-remove: | ||||||
@docker-compose rm -f -s | ||||||
|
||||||
.PHONY: refresh | ||||||
refresh: remove start | ||||||
.PHONY: docker-refresh | ||||||
docker-refresh: docker-remove docker-start |
Uh oh!
There was an error while loading. Please reload this page.