build: remove testing.sh in favor of runit.sh; add claude.md reference

Replace inline boot testing with standalone runit.sh runner for clarity:
- Remove scripts/lib/testing.sh source and boot_tests stage from build.sh
- Remove --skip-tests option from build.sh and rebuild-after-zinit.sh
- Update all docs to reference runit.sh for QEMU/cloud-hypervisor testing
- Add comprehensive claude.md as AI assistant entry point with guidelines

Testing is now fully decoupled from build pipeline; use ./runit.sh for
QEMU/cloud-hypervisor validation after builds complete.
This commit is contained in:
2025-11-04 13:47:24 +01:00
parent 334821dacf
commit 721e26a855
8 changed files with 525 additions and 68 deletions

View File

@@ -15,7 +15,6 @@ source "${SCRIPT_DIR}/lib/alpine.sh"
source "${SCRIPT_DIR}/lib/components.sh"
source "${SCRIPT_DIR}/lib/initramfs.sh"
source "${SCRIPT_DIR}/lib/kernel.sh"
source "${SCRIPT_DIR}/lib/testing.sh"
# Build configuration loaded from config/build.conf via common.sh
# Environment variables can override config file values
@@ -42,7 +41,6 @@ ZINIT_CONFIG_DIR="${CONFIG_DIR}/zinit"
# Build options
USE_CONTAINER="${USE_CONTAINER:-auto}"
CLEAN_BUILD="${CLEAN_BUILD:-false}"
SKIP_TESTS="${SKIP_TESTS:-false}"
KEEP_ARTIFACTS="${KEEP_ARTIFACTS:-false}"
# Display usage information
@@ -54,7 +52,6 @@ Usage: $0 [OPTIONS]
Options:
--clean Clean build (remove all artifacts first)
--skip-tests Skip boot tests
--keep-artifacts Keep build artifacts after completion
--force-rebuild Force rebuild all stages (ignore completion markers)
--rebuild-from=STAGE Force rebuild from specific stage onward
@@ -92,10 +89,6 @@ function parse_arguments() {
CLEAN_BUILD="true"
shift
;;
--skip-tests)
SKIP_TESTS="true"
shift
;;
--keep-artifacts)
KEEP_ARTIFACTS="true"
shift
@@ -411,18 +404,9 @@ function main_build_process() {
kernel_build_with_initramfs "$KERNEL_CONFIG" "$INITRAMFS_ARCHIVE" "$kernel_output"
export KERNEL_OUTPUT="$kernel_output"
}
function stage_boot_tests() {
if [[ "$SKIP_TESTS" != "true" ]]; then
# Ensure KERNEL_OUTPUT is set (for incremental builds)
if [[ -z "${KERNEL_OUTPUT:-}" ]]; then
KERNEL_OUTPUT="${DIST_DIR}/vmlinuz.efi"
export KERNEL_OUTPUT
fi
testing_run_all "$KERNEL_OUTPUT"
fi
}
# Boot tests removed - use runit.sh for testing instead
# Run all stages with incremental tracking
stage_run "alpine_extract" stage_alpine_extract
stage_run "alpine_configure" stage_alpine_configure
@@ -442,8 +426,7 @@ function main_build_process() {
stage_run "initramfs_create" stage_initramfs_create
stage_run "initramfs_test" stage_initramfs_test
stage_run "kernel_build" stage_kernel_build
stage_run "boot_tests" stage_boot_tests
# Calculate build time
local end_time=$(date +%s)
local build_time=$((end_time - start_time))
@@ -501,16 +484,13 @@ function main() {
log_info "Starting container build"
docker_detect_runtime
docker_build_container
# Pass through relevant arguments to container
local container_args=""
if [[ "$SKIP_TESTS" == "true" ]]; then
container_args="$container_args --skip-tests"
fi
if [[ "$KEEP_ARTIFACTS" == "true" ]]; then
container_args="$container_args --keep-artifacts"
fi
docker_run_build "./scripts/build.sh${container_args}"
else
log_error "Container runtime required (podman or docker)"

View File

@@ -218,13 +218,9 @@ build_from_args=()
if in_container; then
# Run directly when already inside the dev/build container
if [[ "$run_tests" -eq 1 ]]; then
log "Including boot tests (in-container)"
DEBUG=1 "${PROJECT_ROOT}/scripts/build.sh" "${build_from_args[@]}" "${extra_args[@]}"
else
log "Skipping boot tests (in-container)"
DEBUG=1 "${PROJECT_ROOT}/scripts/build.sh" --skip-tests "${build_from_args[@]}" "${extra_args[@]}"
fi
# Note: Tests are run separately using runit.sh, not during build
log "Running rebuild (in-container) - use runit.sh for testing"
DEBUG=1 "${PROJECT_ROOT}/scripts/build.sh" "${build_from_args[@]}" "${extra_args[@]}"
else
# Not in container: delegate to dev-container manager which ensures container exists and is running
devctl="${PROJECT_ROOT}/scripts/dev-container.sh"
@@ -234,11 +230,7 @@ else
exit 1
fi
if [[ "$run_tests" -eq 1 ]]; then
log "Including boot tests via dev-container"
"$devctl" build "${build_from_args[@]}" "${extra_args[@]}"
else
log "Skipping boot tests via dev-container"
"$devctl" build --skip-tests "${build_from_args[@]}" "${extra_args[@]}"
fi
# Note: Tests are run separately using runit.sh, not during build
log "Running rebuild via dev-container - use runit.sh for testing"
"$devctl" build "${build_from_args[@]}" "${extra_args[@]}"
fi