Skip to content

Add CI test framework and GitHub Actions pipeline#17

Closed
terchris wants to merge 12 commits intonorwegianredcross:mainfrom
helpers-no:refactor/ci-tests
Closed

Add CI test framework and GitHub Actions pipeline#17
terchris wants to merge 12 commits intonorwegianredcross:mainfrom
helpers-no:refactor/ci-tests

Conversation

@terchris
Copy link
Copy Markdown
Contributor

@terchris terchris commented Dec 3, 2025

Summary

  • Add new test framework with modular structure (static/, unit/, install/)
  • Add GitHub Actions CI pipeline that runs tests on push/PR
  • Delete old tests from addition-templates/tests/
  • Fix config-supervisor.sh missing --verify handler

Test Structure

.devcontainer/additions/tests/
├── run-all-tests.sh          # Orchestrator
├── lib/test-framework.sh     # Shared utilities
├── static/                   # Level 1: Syntax, metadata, categories, flags
├── unit/                     # Level 2: --help, --verify, library functions
└── install/                  # Level 3: Install/uninstall cycle

CI Pipeline

  • Build: Builds devcontainer image
  • Static Tests: Runs 18 static tests inside container
  • ShellCheck: Lints shell scripts
  • Unit Tests: Runs unit tests inside container
  • Install Tests: Manual trigger only (modifies system)

Test Results (local)

Total Tests:  18
Passed:       18
Skipped:      0
Failed:       0

✅ ALL TESTS PASSED

Test plan

  • Static tests pass locally
  • CI pipeline builds container successfully
  • CI pipeline runs static tests
  • CI pipeline runs unit tests

🤖 Generated with Claude Code

terchris and others added 12 commits April 24, 2025 09:14
…shell install working on ARM cpus, 3-script to select development templates
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Phase 0: New test structure
- Add test framework with assertions, numbering, and summary
- Add static tests: syntax, metadata, categories, flags (18 tests)
- Add unit tests: --help execution, --verify, library functions
- Add install cycle tests: install → verify → uninstall → verify
- Remove old tests from addition-templates/tests/

Phase 1: CI Pipeline
- Add GitHub Actions workflow (.github/workflows/ci-tests.yml)
- Build container, run static/unit tests inside it
- ShellCheck linting (warnings don't fail build)
- Optional install tests via manual trigger

Test output format:
  Running: 1.1) Install scripts use valid categories... PASS
  Running: 1.7) Config scripts have --verify handler... ISSUES

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add non-interactive verification function that checks:
- supervisord.conf exists
- conf.d directory exists
- Supervisor running status
- Count of auto-generated service configs

This fixes the test failure in static test 1.7.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Move install-tailscale.sh and start-tailscale.sh to a dedicated
tailscale/ subfolder. These scripts need refactoring to follow
the standard template pattern and will be addressed later.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Install cycle tests (Level 3) require a fully configured devcontainer
environment with prerequisites set up. They are kept for local testing
only and removed from the CI pipeline.

CI now runs:
- Static Tests (Level 1): syntax, metadata, categories, flags
- Unit Tests (Level 2): --help, --verify, library functions
- ShellCheck linting

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@terchris terchris closed this Jan 30, 2026
@terchris terchris deleted the refactor/ci-tests branch January 30, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant