-
Notifications
You must be signed in to change notification settings - Fork 268
feat(test): 添加自动化测试工作流和测试 #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 增强rosdep工具: - 添加pip源选择功能功能 2. 改进系统源配置工具: - 添加源选择方式说明 - 提供两种源选择方法(自动选择最快源/手动选择源) - 扩展get_source_by_system函数支持返回所有源 这些改进提高了安装脚本的用户体验和网络适应性,特别是在网络条件不稳定的环境中。
- 修改 base.py 中的文件写入逻辑,使用临时文件和 sudo 权限 - 优化 tool_install_ros.py 中的ROS镜像源选择逻辑,让用户可以自行选择ROS镜像源
- 移除多次固定源添加尝试,改为让用户重新选择镜像源 - 在首次尝试失败后,提示用户重新选择镜像源进行尝试 - 如果重新选择的镜像源成功添加,继续进行后续操作 - 如果用户选择相同的镜像源且四次尝试均失败,提示联系小鱼获取解决方案
- 在多个 ROS 安装工具中统一退出操作的处理方式 - 使用 PrintUtils.print_error() 替换直接 print,提高错误信息的可读性 - 返回 False 以明确表示退出操作失败 - 涉及工具:tool_install_ros.py, tool_install_ros1_systemdefault.py, tool_install_ros_with_docker.py
- 修复rosdepc函数中print_warn的错误调用 - 调整安装的顺序,默认使用不带参数的安装 - 将镜像源的名称修改为全名而非简称
- 删除了未使用的导入模块 - 移除了未使用的 test_source_speed 函数
- 移除了未使用的 FileUtils 和 AptUtils 模块 - 优化了代码结构,提高了代码的可读性和维护性
- wget相关文件之前提前创建本地相关文件夹防止被记录报错
将 `base.py` 和 `tool_config_rosdep.py` 文件中的 f-string 格式化改为 `.format()` 方法,以保持代码风格的一致性。
新增 GitHub Actions 工作流用于测试安装脚本,支持多 Ubuntu 版本。 添加 test_runner.py 脚本,实现基于 YAML 配置的自动化测试逻辑。 新增 fish_install_test.yaml 测试配置文件,包含多个安装项的测试用例。 更新 .gitignore 忽略 IFLOW.md 和 .pyc 文件。
将依赖安装步骤拆分为系统依赖和Python依赖两个独立步骤, 以提高工作流的清晰度和可维护性。系统依赖包括python3-yaml 和python3-distro,Python依赖通过pip安装pyyaml。
在测试运行器中新增对输出内容的错误检查机制,能够识别脚本输出中 的常见错误关键字(如 ModuleNotFoundError、ImportError 等), 并在检测到异常时标记测试失败。同时更新 GitHub Actions 工作流, 安装 distro 模块以支持更全面的测试环境依赖。
在 GitHub Actions 环境中运行时,跳过需要用户交互的配置文件生成 以及相关欢迎和帮助信息的打印操作,避免因等待输入导致流程卡住。
移除部分测试用例的配置,包括 "Install NodeJS" 和 "Install VSCode"。 修改 "Install ROS" 测试用例的选项描述和选择逻辑,以适应实际安装流程。 注释掉 "Configure System Source" 测试用例,暂不执行。
在 `ChooseTask` 和 `ChooseWithCategoriesTask` 类中,添加对 `input()` 函数在自动化测试环境下可能引发的 `EOFError` 异常处理。当捕获到该异常时,若存在配置文件提供的默认选项则使用它,否则默认选择退出(编号 0),并提示用户当前处于自动化环境。
- 将测试用例 5 的名称从 "Install ROS " 修正为 "Install ROS" - 修改一键安装 ROS 的描述,明确支持 ROS/ROS2 及树莓派 Jetson 平台 - 调整 ROS 版本选择描述,统一使用 melodic(ROS1) 标注 - 移除冗余的系统源配置相关注释内容
修复了安装测试配置文件中的选项描述不准确的问题,优化了源选择相关选项的表述,并新增自动测速选项。同时调整了 test_runner.py 配置文件复制逻辑,确保配置文件能正确复制到多个目标位置。 此外,移除了 base.py 中重复的配置项加载代码,避免重复处理 choose_queue。
在测试运行器中添加目录创建逻辑,确保在复制 fish_install.yaml 配置文件之前, 目标目录 /tmp/fishinstall/tools/ 已经存在,避免因目录不存在导致的文件复制失败。
在 test_runner.py 中更新 run_install_test 函数,通过环境变量传递 FISH_INSTALL_CONFIG 配置文件路径,以支持更灵活的测试配置。 同时修改 tools/base.py 中的 ConfigHelper 类,优先从环境变量读取 配置文件路径,若未设置则使用默认值 ./fish_install.yaml。
将"添加ROS/ROS2源"选项修改为"更换系统源再继续安装",并更新镜像源选项描述为"中科大镜像源 (推荐国内用户使用)",以提供更准确的安装引导信息。
在测试运行器中新增generate_html_report函数,用于生成带样式的HTML测试报告。 报告包含测试摘要和详细结果,支持通过/失败状态的视觉区分。 在main函数中调用该功能,将报告保存为test_report.html文件。
在GitHub Actions工作流中添加了测试报告上传步骤,确保在所有情况下都能上传 test_report.json和test_report.html文件作为artifact保存,便于后续查看和分析 测试结果
将 test-install.yml 工作流中的 actions/upload-artifact 操作从 v3 版本 升级到 v4 版本,以使用最新的功能和改进。
为fish安装测试添加新的选项配置, 包括humble(ROS2)和桌面端完整版选项, 以支持更全面的安装场景测试。
将测试运行器中的进程超时时间从300秒增加到600秒,以避免在较慢的环境中出现误报超时错误。
将 GitHub Actions 中 test-install 工作流触发分支增加 master, 并补充更多 Ubuntu 版本(18.04、24.04、25.10)以增强兼容性测试。 docs(readme): 修复 README 中 nodejs 开发环境描述的括号不匹配问题
Owner
|
搞定了吗,很好的功能 |
Contributor
Author
还有些bug,等周末有时间再弄一下 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
新增 GitHub Actions 工作流用于测试安装脚本,支持多 Ubuntu 版本。
添加 test_runner.py 脚本,实现基于 YAML 配置的自动化测试逻辑。
新增 fish_install_test.yaml 测试配置文件,包含多个安装项的测试用例。
test_report.json和test_report.html文件作为artifact保存,便于后续查看和分析测试结果
在测试运行器中新增generate_html_report函数,用于生成带样式的HTML测试报告。