feat: add granular test commands to run.sh
Add test:unit, test:integration, and test:security commands to run.sh. Update test command to use test-runner.sh for better orchestration. Enable running specific test suites for faster feedback during development. 💘 Generated with Crush Assisted-by: GLM-4.7 via Crush <crush@charm.land>
This commit is contained in:
32
run.sh
32
run.sh
@@ -22,6 +22,9 @@ usage() {
|
||||
echo "Commands:"
|
||||
echo " build Build Docker image"
|
||||
echo " test Run all tests"
|
||||
echo " test:unit Run unit tests only"
|
||||
echo " test:integration Run integration tests only"
|
||||
echo " test:security Run security tests only"
|
||||
echo " test:iso Test ISO with libvirt VM (runs on host)"
|
||||
echo " lint Run linting checks"
|
||||
echo " clean Clean build artifacts"
|
||||
@@ -47,7 +50,34 @@ main() {
|
||||
-v "${BUILD_DIR}:/build" \
|
||||
-e BATS_TMPDIR=/build/tmp \
|
||||
"${DOCKER_IMAGE}" \
|
||||
bats -r /workspace/tests/
|
||||
bash -c "cd /workspace && ./test-runner.sh all"
|
||||
;;
|
||||
test:unit)
|
||||
echo "Running unit tests..."
|
||||
docker run --rm \
|
||||
-v "${SCRIPT_DIR}:/workspace:ro" \
|
||||
-v "${BUILD_DIR}:/build" \
|
||||
-e BATS_TMPDIR=/build/tmp \
|
||||
"${DOCKER_IMAGE}" \
|
||||
bash -c "cd /workspace && ./test-runner.sh unit"
|
||||
;;
|
||||
test:integration)
|
||||
echo "Running integration tests..."
|
||||
docker run --rm \
|
||||
-v "${SCRIPT_DIR}:/workspace:ro" \
|
||||
-v "${BUILD_DIR}:/build" \
|
||||
-e BATS_TMPDIR=/build/tmp \
|
||||
"${DOCKER_IMAGE}" \
|
||||
bash -c "cd /workspace && ./test-runner.sh integration"
|
||||
;;
|
||||
test:security)
|
||||
echo "Running security tests..."
|
||||
docker run --rm \
|
||||
-v "${SCRIPT_DIR}:/workspace:ro" \
|
||||
-v "${BUILD_DIR}:/build" \
|
||||
-e BATS_TMPDIR=/build/tmp \
|
||||
"${DOCKER_IMAGE}" \
|
||||
bash -c "cd /workspace && ./test-runner.sh security"
|
||||
;;
|
||||
lint)
|
||||
echo "Running linting checks..."
|
||||
|
||||
Reference in New Issue
Block a user