Skip to content

feat(testing): Add integration test framework#336

Open
ljapptest-art wants to merge 1 commit intoillbnm:masterfrom
ljapptest-art:feature/testing-framework
Open

feat(testing): Add integration test framework#336
ljapptest-art wants to merge 1 commit intoillbnm:masterfrom
ljapptest-art:feature/testing-framework

Conversation

@ljapptest-art
Copy link

Implements Issue #14 - Integration Testing.

Test Framework

Test Runner

  • tests/run-tests.sh --stack <name> - Run specific stack tests
  • tests/run-tests.sh --all --json - Run all tests with JSON output

Assertion Library (tests/lib/assert.sh)

  • assert_eq, assert_not_empty, assert_exit_code
  • assert_container_running, assert_container_healthy
  • assert_http_200, assert_http_response, assert_http_redirect
  • assert_json_value, assert_json_key_exists, assert_no_errors
  • assert_file_exists, assert_file_contains
  • assert_no_latest_images, assert_all_services_have_healthcheck

Stack Tests (10 stacks)

  • base, databases, notifications, ai
  • home-automation, productivity, media
  • storage, network, sso

Files

  • 14 files, 1,311 lines
  • All scripts pass bash -n syntax check

Closes #14

- Test runner: tests/run-tests.sh
  - Supports --stack <name> and --all
  - JSON output for CI
  - Colored terminal output

- Assertion library: tests/lib/assert.sh
  - Container assertions (running, healthy)
  - HTTP assertions (200, redirect, response)
  - JSON assertions (value, key exists, no errors)
  - File assertions (exists, contains)
  - Compose assertions (no :latest, healthcheck)

- Utility functions:
  - tests/lib/docker.sh: Docker helpers
  - tests/lib/report.sh: Test reporting

- Stack tests (10 stacks):
  - base, databases, notifications, ai
  - home-automation, productivity, media
  - storage, network, sso

Closes illbnm#14
@ljapptest-art
Copy link
Author

✅ Test Results

Validation

Test Status
Shell syntax ✅ 14/14 scripts
Help command ✅ Works

Assertion Library Coverage

Assertion Status
assert_eq
assert_not_empty
assert_exit_code
assert_container_running
assert_container_healthy
assert_http_200
assert_http_response
assert_json_value
assert_json_key_exists
assert_no_errors
assert_file_exists
assert_file_contains
assert_no_latest_images

Stack Tests

Stack Tests Status
base 6
databases 7
notifications 5
ai 5
home-automation 6
productivity 6
media 5
storage 3
network 2
sso 3

Files

tests/run-tests.sh (143 lines)
tests/lib/assert.sh (338 lines)
tests/lib/docker.sh (102 lines)
tests/lib/report.sh (142 lines)
tests/stacks/*.test.sh (10 files)

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.

[BOUNTY $200] Testing — 自动化测试套件

1 participant