Conversation
c14fb7b to
9a07ae8
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds CI test result upload functionality to automatically parse and upload test results from syscall tests to a dashboard API.
- Adds Python scripts to parse Google Test, Go Test, and pytest log formats and upload results to a CI dashboard
- Implements a disk save mode in the Makefile to clean build cache before creating disk images
- Simplifies the gvisor syscall test whitelist to only include
read_test
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| user/apps/tests/syscall/gvisor/whitelist.txt | Simplified whitelist to contain only read_test, removing all other tests and comments |
| user/Makefile | Updated minimum DADK version requirement from 0.5.0 to 0.5.1 |
| tools/test-upload/test_parse_and_upload.py | Added comprehensive unit tests for the test log parsing functionality |
| tools/test-upload/requirements.txt | Added Python dependency specification for requests library |
| tools/test-upload/parse_and_upload.py | Implemented multi-format test log parser and API upload functionality |
| Makefile | Added DISK_SAVE_MODE environment variable support to clean user program cache before disk image creation |
| .github/workflows/test-x86.yml | Added CI workflow step to parse and upload test results, enabled disk save mode, and made test step continue on error |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| self.assertIn('Expected: is equal to 4', error_log) | ||
| self.assertIn('Actual: 8', error_log) | ||
|
|
||
| def test_futx_example(self): |
There was a problem hiding this comment.
Typo in function name: "test_futx_example" should be "test_futex_example" (missing 'e').
| def test_futx_example(self): | |
| def test_futex_example(self): |
.github/workflows/test-x86.yml
Outdated
|
|
||
| # 检查API_KEY是否存在 | ||
| if [ -z "$API_KEY" ]; then | ||
| echo "警告: TEST_UPLOAD_API_KEY secret未设置,跳过上传" |
There was a problem hiding this comment.
The error message references 'TEST_UPLOAD_API_KEY' but the environment variable being checked is 'API_KEY' (from line 40). The error message should say "CI_DASHBOARD_UPLOAD_API_KEY secret未设置" to match the actual secret name.
| echo "警告: TEST_UPLOAD_API_KEY secret未设置,跳过上传" | |
| echo "警告: CI_DASHBOARD_UPLOAD_API_KEY secret未设置,跳过上传" |
| try: | ||
| error_data = e.response.json() | ||
| error_msg = error_data.get('message', str(e)) | ||
| except: |
There was a problem hiding this comment.
Bare except clause is used here, which catches all exceptions including system exceptions like KeyboardInterrupt and SystemExit. Consider catching specific exceptions (e.g., except (ValueError, json.JSONDecodeError):) to avoid masking unexpected errors.
| except: | |
| except (ValueError, json.JSONDecodeError): |
| test_error_pattern = re.compile( | ||
| r'(test/[^\n:]+:\d+:[^\n]*(?:\n(?!\[)[^\n]*)*)', | ||
| re.MULTILINE | ||
| ) |
There was a problem hiding this comment.
The regex pattern r'(test/[^\n:]+:\d+:[^\n]*(?:\n(?!\[)[^\n]*)*)' is compiled twice in this class (lines 293-296 and lines 328-331). Consider extracting this as a class constant or compiling it once at the beginning of the method to improve performance and maintainability.
| import argparse | ||
| import json | ||
| import requests | ||
| from typing import List, Dict, Optional |
There was a problem hiding this comment.
Import of 'Optional' is not used.
| from typing import List, Dict, Optional | |
| from typing import List, Dict |
| if duration: | ||
| try: | ||
| duration_ms = int(float(duration) * 1000) | ||
| except ValueError: |
There was a problem hiding this comment.
'except' clause does nothing but pass and there is no explanatory comment.
| except ValueError: | |
| except ValueError: | |
| # If duration cannot be parsed, leave duration_ms as 0 |
- 新增测试结果解析和上传工具,支持多种测试框架格式 - 在CI工作流中添加测试结果上传步骤 - 引入磁盘节省模式,优化构建缓存管理 - 更新DADK版本要求至0.5.1 Signed-off-by: longjin <longjin@DragonOS.org>
9a07ae8 to
eefcb55
Compare
No description provided.