Skip to content

test: 添加测试环境设置脚本和文档 / Add test environment setup script and docs#1728

Open
kasc0206 wants to merge 1 commit into
apple:mainfrom
kasc0206:test/setup-test-environment
Open

test: 添加测试环境设置脚本和文档 / Add test environment setup script and docs#1728
kasc0206 wants to merge 1 commit into
apple:mainfrom
kasc0206:test/setup-test-environment

Conversation

@kasc0206

@kasc0206 kasc0206 commented Jun 14, 2026

Copy link
Copy Markdown

摘要 / Summary

Added a test environment setup script and comprehensive testing documentation to address the 345 .binaryNotFound test failures caused by missing kernel installation.

添加了测试环境设置脚本和全面的测试文档,解决因内核缺失导致的 345 个 .binaryNotFound 测试失败问题。

新增文件 / New Files

scripts/setup-test-env.sh

Automated test environment setup script that:

  • Builds the container CLI binary and installs it to bin/container
  • Installs the recommended Linux kernel (with --enable-kernel-install)
  • Starts the container system service
  • Supports --skip-build, --skip-kernel, --app-root, --log-root options

自动化的测试环境设置脚本:

  • 构建 CLI 二进制并安装到 bin/container
  • 安装推荐的 Linux 内核
  • 启动 container 系统服务
  • 支持跳过构建/内核安装、自定义数据/日志目录

docs/testing.md

Bilingual (中文/English) testing guide covering:

  • Quick start setup instructions
  • Test structure overview
  • Common issues and solutions table
  • Environment variables reference
  • Single test execution examples
  • Kernel test debugging guide

双语测试指南:

  • 快速开始设置说明
  • 测试结构概览
  • 常见问题及解决方案表
  • 环境变量参考
  • 单个测试执行示例
  • 内核测试调试指南

修改文件 / Modified Files

Makefile

  • Added setup-test-env target (wraps scripts/setup-test-env.sh)

  • Added integration-test target (runs integration tests with proper filter)

  • 新增 setup-test-env 目标

  • 新增 integration-test 目标

验证 / Verification

  • swift build passes
  • ✅ Shell syntax checked with bash -n scripts/setup-test-env.sh
  • ✅ Makefile syntax verified

Related Issue / 相关 Issue

Closes #1729

新增 / Added:
- scripts/setup-test-env.sh: Test environment setup script
  Auto-builds the CLI, installs the recommended kernel, starts system
  Supports --skip-build, --skip-kernel, custom APP_ROOT/LOG_ROOT
- docs/testing.md: Comprehensive testing guide (中英文 / bilingual)
  Test structure, configuration, common issues and solutions

更新 / Updated:
- Makefile: Add setup-test-env and integration-test targets

解决 / Resolves:
The 345 .binaryNotFound test failures were caused by missing kernel
installation. The setup script automates kernel download and install,
which was previously a manual step requiring user interaction.
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.

测试:345 个集成测试因内核缺失而失败 / 345 integration tests fail due to missing kernel

2 participants