feat(integration-tests): add --verbose flag to runner.sh#11
Conversation
Add comprehensive verbose logging to integration test runner to help understand how 'caf' works at a glance. The verbose flag enables: - Environment diagnostics (working directory, user, shell, PATH) - Command availability checks (tree, git, pnpm, caf) - Repository structure display using tree command - Debug logs for git clone operations - Installed skills/subagents directory structure visualization - Final test summary with complete skills and subagents listings Changes: - runner.sh: Add --verbose/-v flag with debug_log() and show_structure() helpers - runner.sh: Add --help/-h flag with usage information - Dockerfile: Install 'tree' command for better directory visualization - Makefile: Add 'test-verbose' target for easy verbose test execution Usage: ./runner.sh --verbose make test-verbose https://claude.ai/code/session_01PV7rMwWhzGUphMgySRjX5r
Update the integration tests job in the GitHub Actions workflow to run with the --verbose flag. This will provide detailed debug logs in CI runs, showing: - Environment diagnostics and command availability - Repository structures with tree visualization - Skills and subagents directory structures - Complete test summary with all installed components This helps with debugging CI failures and understanding how the CAF CLI works in the CI environment. https://claude.ai/code/session_01PV7rMwWhzGUphMgySRjX5r
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||
…loop The runner.sh script had a bug where `shift` was being used inside a `for arg in "$@"` loop. This is incorrect because: - `shift` modifies the positional parameters ($@) during iteration - The for loop has already captured the argument values - This causes errors when the script tries to shift during iteration Fixed by removing the `shift` commands, which aren't needed in a for loop since we're just checking each argument value directly. This resolves the GitHub Actions failure in run 21728851590. https://claude.ai/code/session_01PV7rMwWhzGUphMgySRjX5r
…ture The show_structure function was failing when called on directories that don't exist yet (e.g., .claude/skills before any skills are installed). With 'set -e' enabled, these failures caused the script to exit with code 2. Changes: - Add directory existence check before attempting to list contents - Return gracefully with debug message if directory doesn't exist - Add error handling to ls command to prevent script termination - Add fallback message if directory listing fails This prevents the script from crashing when verbose mode tries to show directory structures that haven't been created yet. Fixes GitHub Actions failure in run 21729027803. https://claude.ai/code/session_01PV7rMwWhzGUphMgySRjX5r
Replace && || constructs with proper if-then-else blocks to ensure compatibility with 'set -e'. The && || pattern can cause unexpected failures because: - A && B || C runs C if either A fails OR B fails - With 'set -e', this can cause premature script termination Changes: - Replace command availability checks with if-then-else blocks - Improve show_structure function with nested if blocks - Add explicit 'return 0' to ensure function always succeeds - Ensure all error paths are handled gracefully This makes the script more robust and prevents exit code 2 failures when running with strict error handling enabled. Fixes GitHub Actions failure in run 21729120119. https://claude.ai/code/session_01PV7rMwWhzGUphMgySRjX5r
…runner.sh The Dockerfile was using CMD which caused docker run arguments to be interpreted by Node.js instead of being passed to the bash script. This resulted in the error: "node: bad option: --verbose" Changed from CMD to ENTRYPOINT so that: - The runner.sh script is the main process - Arguments passed to docker run are forwarded directly to the script - The --verbose flag is properly received by the bash script This ensures `docker run --rm caf-integration-test --verbose` correctly passes the --verbose flag to runner.sh instead of to the node runtime. Fixes the "node: bad option: --verbose" error in GitHub Actions. https://claude.ai/code/session_01PV7rMwWhzGUphMgySRjX5r
User description
Add comprehensive verbose logging to integration test runner to help understand
how 'caf' works at a glance. The verbose flag enables:
Changes:
Usage:
./runner.sh --verbose
make test-verbose
https://claude.ai/code/session_01PV7rMwWhzGUphMgySRjX5r
PR Type
Enhancement
Description
Add comprehensive verbose logging to integration test runner with debug output
Implement
--verboseand--helpflags with environment diagnosticsDisplay repository and directory structures using tree command
Add debug logs for git clone operations and skill installations
Enable verbose mode by default in GitHub Actions CI workflow
Install tree command in Docker image for better visualization
Diagram Walkthrough
File Walkthrough
runner.sh
Add verbose flag with debug logging and diagnosticsintegration_tests/scripts/runner.sh
--verbose/-vand--help/-hcommand-line argument parsingdebug_log()function for conditional debug output with bluecolor coding
show_structure()function to display directory trees usingtree command or ls fallback
shell, PATH, and command availability
workspace initialization
installation
listings
Makefile
Add test-verbose make targetintegration_tests/Makefile
test-verbosetarget to phony targets declarationtest-verbosetarget that builds image and runs containerwith
--verboseflagtest.yml
Enable verbose mode in CI workflow.github/workflows/test.yml
--verboseflag by defaultmake -C integration_tests testtomake -Cintegration_tests test-verboseDockerfile
Install tree command for visualizationintegration_tests/Dockerfile
treecommand to system dependencies installationvisualization