@@ -56,10 +56,6 @@ new_release: ## Release a new version of SuperDuperDB
56
56
git push --set-upstream origin release-$(RELEASE_VERSION) --tags
57
57
58
58
install-devkit : # # Add essential development tools
59
- # Add pre-commit hooks to ensure that no strange stuff are being committed.
60
- # https://stackoverflow.com/questions/3462955/putting-git-hooks-into-a-repository
61
- python -m pip install pre-commit
62
-
63
59
@echo " Download Docs dependencies"
64
60
python -m pip install --user sphinx furo myst_parser
65
61
@@ -178,6 +174,17 @@ testenv_init: ## Initialize a local Testing environment
178
174
@echo "===> Waiting for TestEnv to become ready"
179
175
@cd deploy/testenv/; ./wait_ready.sh
180
176
177
+ testenv_shutdown : # # Terminate the local Testing environment
178
+ @echo " ===> Shutting down the local Testing environment"
179
+ docker compose -f deploy/testenv/docker-compose.yaml down
180
+
181
+ testenv_restart : testenv_shutdown testenv_init # # Restart the local Testing environment
182
+
183
+
184
+ # #@ Database Testing
185
+
186
+ # When the default paths are fixed, this function can be replaced with:
187
+ # make testdb_init DB=mongodb
181
188
testenv_init_mongodb : # # Initialize a local Testing environment
182
189
@echo " ===> Discover Hostnames"
183
190
@deploy/testenv/validate_hostnames.sh
@@ -192,18 +199,27 @@ testenv_init_mongodb: ## Initialize a local Testing environment
192
199
@echo "===> Run TestEnv MongoDB"
193
200
docker compose -f deploy/testenv/docker-compose.yaml up --detach mongodb --remove-orphans &
194
201
195
- testenv_shutdown : # # Terminate the local Testing environment
196
- @echo " ===> Shutting down the local Testing environment"
197
- docker compose -f deploy/testenv/docker-compose.yaml down
198
202
199
- testenv_restart : testenv_shutdown testenv_init # # Restart the local Testing environment
203
+ # # Helper function for starting database containers
204
+ VALID_DATABASES := mongodb postgres mysql mssql azuresql clickhouse
205
+ check_db_variable :
206
+ @if [ -z " $( DB) " ]; then \
207
+ echo " Error: 'DB' is not set." ; \
208
+ exit 1; \
209
+ fi ; \
210
+ if ! echo " $( VALID_DATABASES) " | grep -qw " $( DB) " ; then \
211
+ echo " Error: '$( DB) ' is not a valid database name. Valid options are: $( VALID_DATABASES) " ; \
212
+ exit 1; \
213
+ fi
200
214
201
- testdb_init : # # Initialize databases in Docker
202
- @mkdir -p deploy/testenv/cache && chmod -R 777 deploy/testenv/cache
203
- cd deploy/databases/; docker compose up --remove-orphans &
215
+ testdb_init : check_db_variable # # Init Database Container (DB=<mongodb|postgres|mysql|mssql|azuresql|clickhouse>)
216
+ @database_path=" deploy/databases/$( DB) " && cd " $$ database_path" && make init_db
204
217
205
- testdb_shutdown : # # Terminate Databases Containers
206
- cd deploy/databases/; docker compose down
218
+ testdb_connect : check_db_variable # # Init Database Container (DB=<mongodb|postgres|mysql|mssql|azuresql|clickhouse>)
219
+ @database_path=" deploy/databases/$( DB) " && cd " $$ database_path" && make requirements && make run-example
220
+
221
+ testdb_shutdown : check_db_variable # # Shutdown Databases Containers (DB=<mongodb|postgres|mysql|mssql|azuresql|clickhouse>)
222
+ @database_path=" deploy/databases/$( DB) " && cd " $$ database_path" && make shutdown_db
207
223
208
224
# #@ CI Testing Functions
209
225
@@ -224,11 +240,4 @@ ext-testing: ## Execute integration testing
224
240
pytest $(PYTEST_ARGUMENTS ) ./test/integration/ext
225
241
226
242
smoke-testing : # # Execute smoke testing
227
- SUPERDUPERDB_CONFIG=deploy/testenv/env/smoke/config.yaml pytest $(PYTEST_ARGUMENTS ) ./test/smoke
228
-
229
- test_notebooks : # # Test notebooks (argument: NOTEBOOKS=<test|dir>)
230
- @echo " Notebook Path: $( NOTEBOOKS) "
231
-
232
- @if [ -n "$(NOTEBOOKS)" ]; then \
233
- pytest --nbval-lax $(NOTEBOOKS); \
234
- fi
243
+ SUPERDUPERDB_CONFIG=deploy/testenv/env/smoke/config.yaml pytest $(PYTEST_ARGUMENTS ) ./test/smoke
0 commit comments