1- #
2- # Conveniences for splunk-sdk development
3- #
1+ # ## Conveniences for splunk-sdk-python development
42
5- CONTAINER_NAME := "splunk"
6-
7- # VIRTUALENV MANAGEMENT
3+ # # VIRTUALENV MANAGEMENT
84
95# https://docs.astral.sh/uv/reference/cli/#uv-run--upgrade
10- # --no-config is used to skip all the internal Splunk package indexes
6+ # --no-config skips our Splunk package index
117.PHONY : uv-sync
128uv-sync :
13- @echo " [splunk-sdk] Make sure to tun this only in the repo root!"
14- uv sync --all-groups --all-extras --no-config
9+ uv sync --no-config
1510
1611.PHONY : uv-upgrade
1712uv-upgrade :
18- @echo " [splunk-sdk] Make sure to run this only in the repo root!"
19- uv sync --all-groups --all-extras --upgrade --no-config
13+ uv sync --no-config --upgrade
2014
2115.PHONY : clean
22- clean :
16+ clean :
2317 rm -rf ./build ./dist ./.venv ./.ruff_cache ./.pytest_cache ./splunk_sdk.egg-info ./__pycache__ ./** /__pycache__
2418
2519.PHONY : docs
2620docs :
2721 make -C ./docs html
2822
23+ # # TESTING
24+
25+ # -ra generates a report on all failed tests
26+ # -vv lets us see what failed and why the rest of the suite is running
27+ PYTEST_CMD := python -m pytest --no-header -ra -vv
28+
2929.PHONY : test
3030test :
31- # Previously failing tests go first
32- python -m pytest --ff ./tests
31+ $(PYTEST_CMD ) ./tests
3332
3433.PHONY : test-unit
3534test-unit :
36- # Previously failing tests go first
37- python -m pytest --ff ./tests/unit
35+ $(PYTEST_CMD ) ./tests/unit
3836
3937.PHONY : test-integration
4038test-integration :
41- # Previously failing tests go first
42- python -m pytest --ff ./tests/integration ./tests/system
39+ # Previously failing tests go first
40+ $(PYTEST_CMD) --ff ./tests/integration ./tests/system
4341
4442.PHONY : test-ai
4543test-ai :
46- # Previously failing tests go first
47- python -m pytest --ff ./tests/integration/ai ./tests/unit/ai
44+ $(PYTEST_CMD ) ./tests/integration/ai ./tests/unit/ai
45+
46+ # # DOCKER
47+
48+ CONTAINER_NAME := splunk
49+ SPLUNK_HOME := /opt/splunk
4850
4951.PHONY : docker-up
5052docker-up :
@@ -81,8 +83,8 @@ docker-refresh: docker-remove docker-start
8183
8284.PHONY : docker-splunk-restart
8385docker-splunk-restart :
84- docker exec -it splunk sudo sh -c ' /opt/splunk /bin/splunk restart --run-as-root'
86+ docker exec -it $( CONTAINER_NAME ) sudo sh -c ' $(SPLUNK_HOME) /bin/splunk restart --run-as-root'
8587
8688.PHONY : docker-tail-python-log
8789docker-tail-python-log :
88- docker exec splunk sudo tail /opt/splunk /var/log/splunk/python.log
90+ docker exec -it $( CONTAINER_NAME ) sudo tail $( SPLUNK_HOME ) /var/log/splunk/python.log
0 commit comments