Better integration test target
This commit is contained in:
parent
ed88220a47
commit
b484346031
3 changed files with 20 additions and 2 deletions
3
Justfile
3
Justfile
|
@ -23,10 +23,13 @@ load-release file:
|
||||||
|
|
||||||
# Tests every part of the project
|
# Tests every part of the project
|
||||||
testall:
|
testall:
|
||||||
|
cd frontend && npm install
|
||||||
cd frontend && npm test
|
cd frontend && npm test
|
||||||
cd frontend && npm run lint
|
cd frontend && npm run lint
|
||||||
|
cd frontend && npm run build
|
||||||
cd backend && make test
|
cd backend && make test
|
||||||
cd backend && make lint
|
cd backend && make lint
|
||||||
|
cd backend && make itest
|
||||||
|
|
||||||
# Cleans up everything related to the project
|
# Cleans up everything related to the project
|
||||||
clean: remove-podman-containers
|
clean: remove-podman-containers
|
||||||
|
|
3
Makefile
3
Makefile
|
@ -13,10 +13,13 @@ remove-podman-containers:
|
||||||
|
|
||||||
# Tests every part of the project
|
# Tests every part of the project
|
||||||
testall:
|
testall:
|
||||||
|
cd frontend && npm install
|
||||||
cd frontend && npm test
|
cd frontend && npm test
|
||||||
cd frontend && npm run lint
|
cd frontend && npm run lint
|
||||||
|
cd frontend && npm run build
|
||||||
cd backend && make test
|
cd backend && make test
|
||||||
cd backend && make lint
|
cd backend && make lint
|
||||||
|
cd backend && make itest
|
||||||
|
|
||||||
# Cleans up everything related to the project
|
# Cleans up everything related to the project
|
||||||
clean: remove-podman-containers
|
clean: remove-podman-containers
|
||||||
|
|
|
@ -8,17 +8,19 @@ GOGET = $(GOCMD) get
|
||||||
# SQLite database filename
|
# SQLite database filename
|
||||||
DB_FILE = db.sqlite3
|
DB_FILE = db.sqlite3
|
||||||
|
|
||||||
|
PROC_NAME = ttime_server
|
||||||
|
|
||||||
# Directory containing migration SQL scripts
|
# Directory containing migration SQL scripts
|
||||||
MIGRATIONS_DIR = internal/database/migrations
|
MIGRATIONS_DIR = internal/database/migrations
|
||||||
SAMPLE_DATA_DIR = internal/database/sample_data
|
SAMPLE_DATA_DIR = internal/database/sample_data
|
||||||
|
|
||||||
# Build target
|
# Build target
|
||||||
build:
|
build:
|
||||||
$(GOBUILD) -o bin/server main.go
|
$(GOBUILD) -o bin/$(PROC_NAME) main.go
|
||||||
|
|
||||||
# Run target
|
# Run target
|
||||||
run: build
|
run: build
|
||||||
./bin/server
|
./bin/$(PROC_NAME)
|
||||||
|
|
||||||
watch: build
|
watch: build
|
||||||
watchexec -c -w . -r make run
|
watchexec -c -w . -r make run
|
||||||
|
@ -37,6 +39,16 @@ clean:
|
||||||
test: db.sqlite3
|
test: db.sqlite3
|
||||||
$(GOTEST) ./... -count=1
|
$(GOTEST) ./... -count=1
|
||||||
|
|
||||||
|
# Integration test target
|
||||||
|
.PHONY: itest
|
||||||
|
itest:
|
||||||
|
pgrep $(PROC_NAME) && echo "Server already running" && exit 1 || true
|
||||||
|
make build
|
||||||
|
./bin/$(PROC_NAME) >/dev/null 2>&1 &
|
||||||
|
sleep 1 # Adjust if needed
|
||||||
|
python ../testing.py
|
||||||
|
pkill $(PROC_NAME)
|
||||||
|
|
||||||
# Get dependencies target
|
# Get dependencies target
|
||||||
deps:
|
deps:
|
||||||
$(GOGET) -v ./...
|
$(GOGET) -v ./...
|
||||||
|
|
Loading…
Reference in a new issue