Skip to content

Add shell script integration testing infrastructure#1899

Open
neilsh wants to merge 4 commits intoOnionUI:mainfrom
neilsh:neil/shell-testing-infra
Open

Add shell script integration testing infrastructure#1899
neilsh wants to merge 4 commits intoOnionUI:mainfrom
neilsh:neil/shell-testing-infra

Conversation

@neilsh
Copy link

@neilsh neilsh commented Jan 23, 2026

Shell Script Integration Testing Infrastructure

Implements a Docker-based integration testing framework for Onion shell scripts using BATS (Bash Automated Testing System). This adds a few example tests.

Features

  • Docker-based isolation: Tests run in an Alpine Linux container that simulates the Miyoo Mini's BusyBox sh environment
  • BATS + helper libraries: Uses bats-support, bats-assert, and bats-file for expressive assertions
  • Modular helpers: Shared test helpers (test_helper.bash, mocks.bash) and feature-specific helpers
  • CI integration: GitHub Actions workflow with Docker layer caching

Test Coverage

Script Tests
pacman_install.sh 3
Guest Mode scripts (install.sh, saveTime.sh, loadTime.sh, launch.sh) 11
apply.sh 3
themes_extract_theme.sh 3
themes_extract_previews.sh 3

Total: 23 tests

Usage

make test-shell        # Run all tests
make test-shell-debug  # Interactive debug mode

Files Added/Modified

  • test/shell-tests/ - Test directory with Dockerfile, README, and organized test files
  • Makefile - New test-shell and test-shell-debug targets
  • .github/workflows/test-shell.yml - CI workflow for shell tests

- Dockerfile for Alpine-based test environment
- BATS helper setup (mocks.bash, test_helper.bash)
- Makefile targets: test-shell, test-shell-debug
- CI Workflow for automated testing
- pacman_install.bats: Tests for JSON config parsing
- apply.bats: Tests for common package installer
- Guest Mode: Comprehensive tests for switching, time persistence, and launching
- Theme Switcher: Tests for theme extraction and preview generation
- Added guest_mode_helper.bash and theme_helper.bash for test setup
@neilsh neilsh force-pushed the neil/shell-testing-infra branch from 874115c to 786ad9f Compare January 23, 2026 06:11
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.

2 participants