-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (31 loc) · 1.31 KB
/
Makefile
File metadata and controls
38 lines (31 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# StationAPI Makefile
# Cargoを使ったテスト実行のためのシンプルなタスク定義
.PHONY: test test-unit test-integration test-all clean help
# デフォルトターゲット
help:
@echo "Available targets:"
@echo " test-unit - Run unit tests only (no database required)"
@echo " test-integration - Run integration tests (requires PostgreSQL)"
@echo " test-all - Run all tests"
@echo " test - Alias for test-unit"
@echo " clean - Clean build artifacts"
@echo ""
@echo "Environment variables:"
@echo " TEST_DATABASE_URL - Database URL for integration tests"
@echo " (default: postgres://test:test@localhost/stationapi_test)"
# ユニットテストのみ実行(データベース不要)
test-unit:
@echo "Running unit tests (no database required)..."
cargo test --lib --package stationapi
# 統合テストのみ実行(データベース必要)
test-integration:
@echo "Running integration tests (requires PostgreSQL)..."
@echo "Make sure PostgreSQL is running and TEST_DATABASE_URL is set"
cargo test --lib --package stationapi --features integration-tests
# 全てのテストを実行
test-all: test-unit test-integration
# デフォルトはユニットテスト
test: test-unit
# クリーンアップ
clean:
cargo clean