# Testing, CI and Debugging Relevant source files - [.github/workflows/smoke.yml](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/.github/workflows/smoke.yml) - [DEPENDENCIES.md](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/DEPENDENCIES.md?plain=1) - [src/kernel/tests.zig](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/src/kernel/tests.zig) - [src/kernel/ui/prompt.zig](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/src/kernel/ui/prompt.zig) - [tests/smoke.sh](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/tests/smoke.sh) CadenzaOS provides a structured quality assurance pipeline combining automated continuous integration, headless QEMU smoke assertions, kernel-level exception validation, and serial diagnostics. This parent page outlines the testing framework and debugging mechanisms across the codebase. For deep technical details, see the child pages: - [Smoke Tests and GitHub Actions](/GlenMeehan/CadenzaOS/9.1-smoke-tests-and-github-actions) - [Panic Handling and Debug Tooling](/GlenMeehan/CadenzaOS/9.2-panic-handling-and-debug-tooling) Title: CI and Smoke Pipeline Architecture ![diagram](mermaids/9-testing,-ci-and-debugging-diagram-1.png) Sources: [.github/workflows/smoke.yml1-32](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/.github/workflows/smoke.yml#L1-L32)[tests/smoke.sh1-206](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/tests/smoke.sh#L1-L206) --- ## 9.1 Smoke Tests and GitHub Actions Automated regression testing ensures that changes do not break core boot sequencing, command execution, or filesystem operations. The continuous integration pipeline runs on every push and pull request via GitHub Actions [.github/workflows/smoke.yml1-3](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/.github/workflows/smoke.yml#L1-L3) It provisions an Ubuntu environment, installs build prerequisites including NASM, QEMU, and Zig, and builds the disk image using `./build.sh ci`[.github/workflows/smoke.yml15-23](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/.github/workflows/smoke.yml#L15-L23) The smoke test harness (`tests/smoke.sh`) executes a two-stage verification process: 1. **Stage 1 (Boot Assertion):** Boots the kernel headlessly in QEMU and waits for the `Cadenza />` prompt to appear on the serial log [tests/smoke.sh4-122](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/tests/smoke.sh#L4-L122) 2. **Stage 2 (Interactive Commands):** Connects to the QEMU TCP monitor interface to type shell commands (`spawn`, `touch`, `del`) and asserts expected outputs on the serial stream [tests/smoke.sh5-206](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/tests/smoke.sh#L5-L206) The script also includes checks for directory operations like `mkdir` and `mv`[tests/smoke.sh178-204](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/tests/smoke.sh#L178-L204) and verifies user interaction with prompts, such as the confirmation for `del`[tests/smoke.sh160-166](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/tests/smoke.sh#L160-L166) Additionally, the kernel implements standalone validation and fault-triggering functions in `src/kernel/tests.zig` to verify exception handlers and allocator resilience [src/kernel/tests.zig1-183](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/src/kernel/tests.zig#L1-L183) System requirements and dependency versions are documented in `DEPENDENCIES.md:1-72`(). For complete implementation details, workflow configurations, and unit test routines, see [Smoke Tests and GitHub Actions](/GlenMeehan/CadenzaOS/9.1-smoke-tests-and-github-actions). Sources: [.github/workflows/smoke.yml1-32](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/.github/workflows/smoke.yml#L1-L32)[tests/smoke.sh1-206](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/tests/smoke.sh#L1-L206)[src/kernel/ui/prompt.zig1-53](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/src/kernel/ui/prompt.zig#L1-L53)[src/kernel/tests.zig1-183](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/src/kernel/tests.zig#L1-L183)[DEPENDENCIES.md1-71](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/DEPENDENCIES.md?plain=1#L1-L71) --- ## 9.2 Panic Handling and Debug Tooling When runtime faults, memory errors, or unrecoverable assertions occur, CadenzaOS relies on robust panic handling and diagnostic tracing infrastructure. Kernel fault tests intentionally trigger processor exceptions—such as divide-by-zero, breakpoints (`int3`), invalid opcodes (`ud2`), general protection faults, and page faults—to ensure that CPU exception vectors and interrupt handlers dispatch correctly [src/kernel/tests.zig21-84](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/src/kernel/tests.zig#L21-L84) Title: Exception Dispatch and Diagnostic Flow ![diagram](mermaids/9-testing,-ci-and-debugging-diagram-2.png) Sources: [src/kernel/tests.zig21-84](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/src/kernel/tests.zig#L21-L84)[tests/smoke.sh58-61](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/tests/smoke.sh#L58-L61) Diagnostic tooling includes serial-based logging, memory map verification (`e820_test`), and emulator support configurations. For full documentation on panic routines, stack tracing, and debugging environments, see [Panic Handling and Debug Tooling](/GlenMeehan/CadenzaOS/9.2-panic-handling-and-debug-tooling). Sources: [src/kernel/tests.zig21-84](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/src/kernel/tests.zig#L21-L84)[tests/smoke.sh58-61](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/tests/smoke.sh#L58-L61)[DEPENDENCIES.md26-32](https://github.com/GlenMeehan/CadenzaOS/blob/8f182160/DEPENDENCIES.md?plain=1#L26-L32)