bug: microcks test get swallows test failure details and operation results in text output mode
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 85/100
Hướng nghiên cứu
Bắt đầu từ cmd/testQuery.go, đặc biệt là phần chuyển đổi sang TestResultSummary, và so sánh đầu ra văn bản với cmd/testExecutor.go cùng trình định dạng hiện có trong pkg/output. Thêm hoặc cập nhật một bài kiểm tra tập trung cho microcks test get ở chế độ văn bản. Hoàn thành khi đầu ra bao gồm các thao tác thất bại và thông báo lỗi của chúng, chứ không chỉ có bảng tóm tắt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
I noticed that when running microcks test get <testResultId> on a failed test, the CLI doesn't show any failure details or which operations failed.
Right now, it just prints the exact same 1-line table you get from microcks test list:
ID SERVICE ID SUCCESS IN PROGRESS ELAPSED
test-1 svc-orders false false 150ms
Looking at cmd/testQuery.go, the CLI actually calls mc.GetFullTestResult(args[0]) which returns the full TestCaseResults and step error messages, but then lines 97–107 cast it down to TestResultSummary and drop all the operation results before printing:
return printTestResults([]connectors.TestResultSummary{{
ID: result.ID,
Version: result.Version,
TestNumber: result.TestNumber,
TestDate: result.TestDate,
TestedEndpoint: result.TestedEndpoint,
ServiceID: result.ServiceID,
ElapsedTime: result.ElapsedTime,
Success: result.Success,
InProgress: result.InProgress,
}})
So if a test fails, there's no way to see what actually went wrong from the terminal without passing --output json and digging through raw JSON.
Expected behavior
In default text mode, microcks test get should format the test result using the existing output.NewFormatter(output.FormatText) (similar to what cmd/testExecutor.go does):
Test test-1: FAILURE (150ms)
[FAIL] POST /orders
order-validation: price: expected number got string
This way you can immediately see which operations failed and the error message directly in your terminal.
Actual behavior
$ microcks test get test-1 --microcksURL http://127.0.0.1:8888
ID SERVICE ID SUCCESS IN PROGRESS ELAPSED
test-1 svc-orders false false 150ms
All test cases, operations, and failure messages are omitted from the output.
How to Reproduce?
- Spin up a quick local mock returning a failed test with
testCaseResults:
python3 -c '
from http.server import HTTPServer, BaseHTTPRequestHandler
import json
class Mock(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-Type", "application/json")
self.end_headers()
self.wfile.write(json.dumps({
"id": "test-1",
"serviceId": "svc-orders",
"success": False,
"elapsedTime": 150,
"testCaseResults": [{
"operationName": "POST /orders",
"success": False,
"elapsedTime": 150,
"testStepResults": [{
"requestName": "order-validation",
"success": False,
"message": "price: expected number got string"
}]
}]
}).encode())
def log_message(self, *args): pass
HTTPServer(("127.0.0.1", 8888), Mock).serve_forever()
'
- Run
test get:
go run main.go test get test-1 --microcksURL http://127.0.0.1:8888
You'll see it only prints the 1-line summary table without showing the failed POST /orders operation or the error message.
Microcks version or git rev
main
Install method (docker-compose, helm chart, operator, docker-desktop extension,...)
cli
Additional information
Since output.NewFormatter(output.FormatText) is already implemented in pkg/output, we can just route text mode through it in newTestGetCommand.
Tested this locally and happy to submit a PR with the fix and unit test if this sounds good!
- Ngôn ngữ chính
- Go
- Star
- 59
- Fork
- 74
- Merge trung bình
- 4 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 23
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microcks/microcks-cli
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
microcks/microcks-cli#606 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
microcks/microcks-cli#601 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
microcks/microcks-cli#598 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: microcks login ignores the --config flag and always modifies default configCó thể đã có người làm @aryarathoree đã nhận 3 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
microcks/microcks-cli#594 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Wrong link to test resultsCó thể đã có người làm @SajanBisht đã nhận 3 ngày trước. Đang mởcomponent/cli keep-open kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microcks/microcks-cli#589 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microcks/microcks-cli
Issue tương tự
-
docs(prompts): IF BLOCKED workflow-scope branch says to comment on the issue on jira/local trackersĐang mởagent-butler-finding bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
jordansmall/spindrift#6238 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug from-studio
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
esengine/DeepSeek-Reasonix#14868 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Install notes print "Camunda REST API: https://" without a host when global.host is setCó thể đã có người làm @irisfield đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
camunda/camunda-platform-helm#7790 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
wso2/agent-manager#2220 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: zot exits with code 0 when it can't startCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
project-zot/zot#4636 ·
Maintainer thường phản hồi trong vòng 1 ngày