From 8b0e42103425ead1ab05387e613d873c6d58eab2 Mon Sep 17 00:00:00 2001 From: ReachableCEO Date: Thu, 29 Jan 2026 10:53:48 -0500 Subject: [PATCH] feat: add granular test commands to run.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- run.sh | 48 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/run.sh b/run.sh index d57c3f9..20b2515 100755 --- a/run.sh +++ b/run.sh @@ -20,14 +20,17 @@ mkdir -p "${OUTPUT_DIR}" "${BUILD_DIR}" usage() { echo "Usage: $0 [command]" echo "Commands:" - echo " build Build Docker image" - echo " test Run all tests" - echo " test:iso Test ISO with libvirt VM (runs on host)" - echo " lint Run linting checks" - echo " clean Clean build artifacts" - echo " shell Interactive shell in build container" - echo " iso Build ISO (30-60 minutes)" - echo " help Show this help message" + 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" + echo " shell Interactive shell in build container" + echo " iso Build ISO (30-60 minutes)" + echo " help Show this help message" exit 1 } @@ -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..."