Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
628b9e2
feat: 优化系统源配置和rosdep一键安装工具网络选项
tangsangsimida Aug 4, 2025
650d5e3
Merge branch 'fishros:master' into master
tangsangsimida Aug 7, 2025
d1a9315
feat(tools): 支持选择中科大 ROS 镜像源
tangsangsimida Aug 29, 2025
ade9adb
refactor(tools): 优化 ROS 源添加流程
tangsangsimida Aug 29, 2025
49657eb
refactor(tools): 优化 ROS 安装工具的退出处理
tangsangsimida Aug 29, 2025
e220cc8
fix(tools): 修复rosdepc函数中print_warn的错误调用
tangsangsimida Sep 17, 2025
a982a56
refactor(tools): 精简 tool_config_rosdep.py 文件
tangsangsimida Sep 17, 2025
c6e7812
refactor(tools): 精简 tool_config_rosdep.py 中的导入信息
tangsangsimida Sep 17, 2025
b8a6c5d
refactor(install): 优化代码结构和错误处理
tangsangsimida Sep 17, 2025
1ee4dc2
refactor(base.py, tool_config_rosdep.py): 更新字符串格式化方法
tangsangsimida Sep 18, 2025
f473822
fix(tool):移除部分不支持ros1的系统编号
tangsangsimida Sep 18, 2025
7774e36
Merge branch 'fishros:master' into master
tangsangsimida Sep 20, 2025
c0222ea
feat(test): 添加自动化测试工作流和测试 runner
awan-deng Oct 9, 2025
355653f
ci(test-install): 更新工作流依赖安装步骤
awan-deng Oct 9, 2025
15ebf68
feat(test): 增强测试运行器的错误检测能力
awan-deng Oct 9, 2025
de552eb
fix(install): 跳过GitHub Actions环境中的配置文件生成和提示信息
awan-deng Oct 9, 2025
29cfa27
fix(tests): 更新 fish_install_test.yaml 测试配置文件
awan-deng Oct 9, 2025
5898519
fix(tools): 处理自动化测试环境中的 EOFError 异常
awan-deng Oct 9, 2025
d4d12bc
test(fish_install_test): 更新 ROS 安装测试用例配置
awan-deng Oct 9, 2025
6281462
fix(tests): 更新 fish_install_test.yaml 中的选项描述
awan-deng Oct 9, 2025
c4973b6
fix(tests): 确保复制配置文件前目录存在
awan-deng Oct 9, 2025
7a0a6ad
feat(test): 为测试运行器添加环境变量配置支持
awan-deng Oct 9, 2025
2fb07fc
test(fish_install_test): 更新ROS安装选项描述
awan-deng Oct 9, 2025
a051bef
feat(tests): 添加HTML格式测试报告生成功能
awan-deng Oct 9, 2025
a2fbcd6
ci(test-install): 添加测试报告上传功能
awan-deng Oct 9, 2025
8314756
build(github-actions): 更新测试工作流中的上传构件操作版本
awan-deng Oct 9, 2025
67d8531
feat(tests): 更新fish安装测试配置
awan-deng Oct 9, 2025
72a3a2d
test(test_runner): 增加安装测试的超时时间至10分钟
awan-deng Oct 9, 2025
7d00260
build(workflow): 扩展测试安装脚本支持的分支和操作系统版本
awan-deng Oct 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Test Install Script

on:
push:
branches: [ dev, master ]
pull_request:
branches: [ dev, master ]

jobs:
test-install:
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, ubuntu-25.10]
runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y python3-yaml python3-distro

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pyyaml distro

- name: Run tests
run: |
cd tests && python3 test_runner.py

- name: Upload test reports
uses: actions/upload-artifact@v4
if: always()
with:
name: test-reports-${{ matrix.os }}
path: |
tests/test_report.json
tests/test_report.html
if-no-files-found: ignore
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

*.pyc
*.pyc
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- 一键安装:ROS(支持ROS和ROS2,树莓派Jetson) [贡献@小鱼](https://github.com/fishros)
- 一键安装:VsCode(支持amd64和arm64) [贡献@小鱼](https://github.com/fishros)
- 一键安装:github桌面版(小鱼常用的github客户端) [贡献@小鱼](https://github.com/fishros)
- 一键安装:nodejs开发环境(通过nodejs可以预览小鱼官网噢 [贡献@小鱼](https://github.com/fishros)
- 一键安装:nodejs开发环境(通过nodejs可以预览小鱼官网噢) [贡献@小鱼](https://github.com/fishros)
- 一键配置:rosdep(小鱼的rosdepc,又快又好用) [贡献@小鱼](https://github.com/fishros)
- 一键配置:ROS环境(快速更新ROS环境设置,自动生成环境选择) [贡献@小鱼](https://github.com/fishros)
- 一键配置:系统源(更换系统源,支持全版本Ubuntu系统) [贡献@小鱼](https://github.com/fishros)
Expand Down
12 changes: 8 additions & 4 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,15 @@ def main():
else:
download_tools(code,tools,url_prefix)
run_tool_file(tools[code]['tool'].replace("/","."))
config_helper.gen_config_file()

PrintUtils.print_delay(tr.tr("欢迎加入机器人学习交流QQ群:438144612(入群口令:一键安装)"),0.05)
PrintUtils.print_delay(tr.tr("鱼香小铺正式开业,最低499可入手一台能建图会导航的移动机器人,淘宝搜店:鱼香ROS 或打开链接查看:https://item.taobao.com/item.htm?id=696573635888"),0.001)
PrintUtils.print_delay(tr.tr("如在使用过程中遇到问题,请打开:https://fishros.org.cn/forum 进行反馈"),0.001)
# 检查是否在 GitHub Actions 环境中运行
# 如果是,则跳过生成配置文件和后续的打印操作,因为这些操作需要用户输入
if os.environ.get('GITHUB_ACTIONS') != 'true':
config_helper.gen_config_file()

PrintUtils.print_delay(tr.tr("欢迎加入机器人学习交流QQ群:438144612(入群口令:一键安装)"),0.05)
PrintUtils.print_delay(tr.tr("鱼香小铺正式开业,最低499可入手一台能建图会导航的移动机器人,淘宝搜店:鱼香ROS 或打开链接查看:https://item.taobao.com/item.htm?id=696573635888"),0.001)
PrintUtils.print_delay(tr.tr("如在使用过程中遇到问题,请打开:https://fishros.org.cn/forum 进行反馈"),0.001)

if __name__=='__main__':
run_exc = []
Expand Down
13 changes: 13 additions & 0 deletions tests/fish_install_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 测试配置文件,用于 GitHub Actions 自动化测试
# 格式: chooses: [{choose: <选项ID>, desc: <选项描述>}]

# 测试用例 1: 安装 ROS
- name: "Install ROS"
chooses:
- { choose: 1, desc: "一键安装(推荐):ROS(支持ROS/ROS2,树莓派Jetson)" }
- { choose: 1, desc: "更换系统源再继续安装" }
- { choose: 2, desc: "更换系统源并清理第三方源" }
- { choose: 1, desc: "自动测速选择最快的源" }
- { choose: 1, desc: "中科大镜像源 (推荐国内用户使用)" }
- { choose: 1, desc: "humble(ROS2)" }
- { choose: 1, desc: "桌面端完整版" }
146 changes: 146 additions & 0 deletions tests/generate_report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import json
import time
import os

def generate_html_report(report, output_file):
"""生成HTML格式的测试报告"""
html_content = """
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>一键安装工具测试报告</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
background-color: #f5f5f5;
}
.header {
background-color: #4CAF50;
color: white;
padding: 20px;
text-align: center;
border-radius: 5px;
margin-bottom: 20px;
}
.summary {
background-color: white;
padding: 20px;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
margin-bottom: 20px;
}
.test-case {
background-color: white;
padding: 20px;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
margin-bottom: 20px;
}
.passed {
border-left: 5px solid #4CAF50;
}
.failed {
border-left: 5px solid #f44336;
}
.test-name {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
}
.test-status {
display: inline-block;
padding: 5px 10px;
border-radius: 3px;
color: white;
}
.status-passed {
background-color: #4CAF50;
}
.status-failed {
background-color: #f44336;
}
.output {
background-color: #f8f8f8;
padding: 15px;
border-radius: 5px;
margin-top: 10px;
white-space: pre-wrap;
font-family: monospace;
font-size: 12px;
max-height: 300px;
overflow-y: auto;
}
.footer {
text-align: center;
margin-top: 20px;
color: #666;
font-size: 14px;
}
</style>
</head>
<body>
<div class="header">
<h1>一键安装工具测试报告</h1>
<p>生成时间: """ + time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + """</p>
</div>

<div class="summary">
<h2>测试摘要</h2>
<p>总计: """ + str(report["summary"]["total"]) + """</p>
<p>通过: """ + str(report["summary"]["passed"]) + """</p>
<p>失败: """ + str(report["summary"]["failed"]) + """</p>
</div>

<div class="details">
<h2>详细测试结果</h2>
"""

for test_case in report["details"]:
status_class = "passed" if test_case["success"] else "failed"
status_text = "通过" if test_case["success"] else "失败"
status_style = "status-passed" if test_case["success"] else "status-failed"

html_content += f"""
<div class="test-case {status_class}">
<div class="test-name">
{test_case["name"]}
<span class="test-status {status_style}">{status_text}</span>
</div>
<div class="output-title">输出日志:</div>
<div class="output">{test_case["output"]}</div>
</div>
"""

html_content += """
</div>

<div class="footer">
<p>测试报告由一键安装工具自动生成</p>
</div>
</body>
</html>
"""

with open(output_file, 'w', encoding='utf-8') as f:
f.write(html_content)


if __name__ == "__main__":
# 读取JSON测试报告
report_file = "test_report.json"
if os.path.exists(report_file):
with open(report_file, 'r', encoding='utf-8') as f:
report = json.load(f)

# 生成HTML报告
html_report_file = "test_report.html"
generate_html_report(report, html_report_file)
print(f"HTML测试报告已生成: {html_report_file}")
else:
print(f"找不到测试报告文件: {report_file}")
Loading
Loading