Remove obsolete documentation files and consolidate into docs/ directory. Remove redundant test scripts (functionality will be folded into run.sh). Update AGENTS.md with SDLC workflow. Update PRD.md with tier0 architecture clarification. Update README.md to reflect clean directory structure. Changes: - Delete: BUILD-COMPLETE.md, BUILD-SUMMARY.md, RESUME.md, SESSION-CLOSED.md - Delete: FINAL-SECURITY-COMPLIANCE-REPORT.md, QUICK_START.md, JOURNAL.md - Move: TEST-COVERAGE.md, VERIFICATION-REPORT.md to docs/ - Delete: test-iso.sh, test-runner.sh (will fold into run.sh) - Update: AGENTS.md with SDLC workflow section - Update: PRD.md with tier0 architecture clarification and diagram - Update: README.md to reflect clean directory structure Root directory now contains only: AGENTS.md, README.md, PRD.md, Dockerfile, run.sh 💘 Generated with Crush Assisted-by: GLM-4.7 via Crush <crush@charm.land>
55 lines
1.3 KiB
Bash
55 lines
1.3 KiB
Bash
#!/usr/bin/env bats
|
|
# Unit tests for build script functions
|
|
|
|
# Add bats library to BATS_LIB_PATH
|
|
|
|
load 'bats-support/load'
|
|
load 'bats-assert/load'
|
|
load '../test_helper/common.bash'
|
|
|
|
@test "validate_environment checks for required tools" {
|
|
source "${PROJECT_ROOT}/src/build-iso.sh"
|
|
|
|
# Create mock directory structure
|
|
mkdir -p "${TEST_TEMP_DIR}/config"
|
|
mkdir -p "${TEST_TEMP_DIR}/output"
|
|
|
|
# Override variables for testing
|
|
PROJECT_ROOT="$TEST_TEMP_DIR"
|
|
CONFIG_DIR="$TEST_TEMP_DIR/config"
|
|
OUTPUT_DIR="$TEST_TEMP_DIR/output"
|
|
|
|
# Test with missing tools (should fail)
|
|
run validate_environment
|
|
assert_failure
|
|
}
|
|
|
|
@test "prepare_build creates output directory" {
|
|
source "${PROJECT_ROOT}/src/build-iso.sh"
|
|
|
|
# Override variables for testing
|
|
PROJECT_ROOT="$TEST_TEMP_DIR"
|
|
OUTPUT_DIR="$TEST_TEMP_DIR/output"
|
|
|
|
# Remove directory if it exists
|
|
rm -rf "$OUTPUT_DIR"
|
|
|
|
# Run function
|
|
run prepare_build
|
|
assert_success
|
|
|
|
# Check directory was created
|
|
assert [ -d "$OUTPUT_DIR" ]
|
|
}
|
|
|
|
@test "build_iso fails without live-build setup" {
|
|
source "${PROJECT_ROOT}/src/build-iso.sh"
|
|
|
|
# Override variables for testing
|
|
PROJECT_ROOT="$TEST_TEMP_DIR"
|
|
OUTPUT_DIR="$TEST_TEMP_DIR/output"
|
|
|
|
# Run function
|
|
run build_iso
|
|
assert_failure
|
|
} |