refactor: use make test in pre-commit hook
This commit is contained in:
@@ -35,7 +35,7 @@ repos:
|
|||||||
hooks:
|
hooks:
|
||||||
- id: pytest
|
- id: pytest
|
||||||
name: Run unit tests
|
name: Run unit tests
|
||||||
entry: bash -c 'uv run --group dev pytest tests/ -q; rc=$?; [ $rc -eq 5 ] && exit 0 || exit $rc'
|
entry: make test
|
||||||
language: system
|
language: system
|
||||||
types: [python]
|
types: [python]
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ DISTRO ?= almalinux/el9
|
|||||||
PACKAGES := $(shell find $(ROOT_DIR)/rpms -mindepth 1 -maxdepth 1 -type d -exec test -f {}/metadata.yaml \; -print | xargs -n1 basename | sort)
|
PACKAGES := $(shell find $(ROOT_DIR)/rpms -mindepth 1 -maxdepth 1 -type d -exec test -f {}/metadata.yaml \; -print | xargs -n1 basename | sort)
|
||||||
|
|
||||||
# Default target to build all packages
|
# Default target to build all packages
|
||||||
.PHONY: all list build clean
|
.PHONY: all list build clean test
|
||||||
all: build-all
|
all: build-all
|
||||||
|
|
||||||
# List all available packages
|
# List all available packages
|
||||||
@@ -47,6 +47,10 @@ dry-run:
|
|||||||
@echo "Dry run - showing what would be built for distro $(DISTRO):"
|
@echo "Dry run - showing what would be built for distro $(DISTRO):"
|
||||||
$(BUILD_TOOL) build-all --distro $(DISTRO) --dry-run
|
$(BUILD_TOOL) build-all --distro $(DISTRO) --dry-run
|
||||||
|
|
||||||
|
# Run unit tests
|
||||||
|
test:
|
||||||
|
@uv run --group dev pytest tests/ -q; rc=$$?; [ $$rc -eq 5 ] && exit 0 || exit $$rc
|
||||||
|
|
||||||
# Clean target
|
# Clean target
|
||||||
clean:
|
clean:
|
||||||
@echo "Cleaning build artifacts..."
|
@echo "Cleaning build artifacts..."
|
||||||
|
|||||||
Reference in New Issue
Block a user