bug: --filteredOperations fails on comma-separated list
Maintainer thường phản hồi trong vòng 3 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
- 65/100
Hướng nghiên cứu
Bắt đầu từ pkg/connectors/microcks_client.go và đọc ensureValidOperationsList, sau đó kiểm tra phần mô tả --filteredOperations trong test.md cùng các unit test liên quan. Xác nhận rằng các giá trị phân tách bằng dấu phẩy và một operation đơn lẻ được loại bỏ khoảng trắng thừa và chuyển đổi, trong khi đầu vào dạng JSON array vẫn được hỗ trợ; công việc hoàn tất khi các trường hợp này chạy qua và CLI gửi danh sách operation như mong đợi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
While trying to run tests on specific operations using --filteredOperations, I noticed that passing a comma-separated list (or even a single operation) like --filteredOperations "GET /pastries,POST /pastries" fails immediately:
creating test: parsing filteredOperations JSON: invalid character 'G' looking for beginning of value
The docs in test.md mention that --filteredOperations accepts a "Comma-separated list of operations to test", but ensureValidOperationsList in pkg/connectors/microcks_client.go runs a direct json.Unmarshal on the string.
So right now it only works if you pass a raw JSON array string like '["GET /pastries"]', which is pretty unintuitive for a CLI flag and contradicts what the docs say.
Expected behavior
It should accept normal comma-separated strings like --filteredOperations "GET /pastries, POST /pastries" (and single operations like "GET /pastries"), trim whitespace, and turn that into the array payload for the server.
Keeping support for the ["..."] JSON array format would also be good so we don't break anyone already passing JSON.
Actual behavior
$ microcks test "hello:1.0" "http://localhost:8080" HTTP --filteredOperations "GET /hello,POST /hello" --microcksURL http://127.0.0.1:8888
creating test: parsing filteredOperations JSON: invalid character 'G' looking for beginning of value
exit status 2
How to Reproduce?
Run a test passing a comma-separated list to --filteredOperations:
microcks test "MyAPI:1.0" "http://localhost:8080" HTTP --filteredOperations "GET /pastries,POST /pastries" --microcksURL http://127.0.0.1:8888
It fails with the JSON parse error.
Microcks version or git rev
main
Install method (docker-compose, helm chart, operator, docker-desktop extension,...)
cli
Additional information
The fix is pretty straightforward in pkg/connectors/microcks_client.go, if the string doesn't start with [, we can just split on commas, trim spaces, and marshal the slice to JSON.
Tested this locally and happy to open a quick PR with the fix and unit tests if that sounds good!
- Ngôn ngữ chính
- Go
- Star
- 59
- Fork
- 75
- Merge trung bình
- 7 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 20
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
-
Logging into a locally started instance clears its container reference, causing stop to do nothingĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
microcks/microcks-cli#620 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
WatchConfig.UpsertEntry silently deletes existing contexts when re-upserting a watched fileCó thể đã có người làm @aryarathoree đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
microcks/microcks-cli#610 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug: microcks test get swallows test failure details and operation results in text output modeCó 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 85/100
microcks/microcks-cli#608 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
KeycloakClient strips realm path when realm URL lacks trailing slashCó thể đã có người làm @aryarathoree đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
microcks/microcks-cli#606 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Windows test failures in MockFileSystem.Walk due to path separatorCó thể đã có người làm @dipak0000812 đã nhận 7 ngày trước. Đang mở
Độ 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 3 ngày
Tất cả issue của microcks/microcks-cli
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
-
/shutdown/ready can fail to return an HTTP response when readiness takes longer than the server write timeoutCó thể đã có người làm @floriankoch đã nhận hôm nay. Đang mởtriage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
envoyproxy/gateway#10562 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Adding an LDAP group reports every search failure as "LDAP Group DN is not found"Có thể đã có người làm @Daksha1611 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
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 70/100
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 75/100