[BUG]: Default Validate Test Level isn't set to RunSpecifiedTests when passing --tests
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, node.js
Hướng nghiên cứu
Read the shared testLevelFlag in src/utils/flags.ts and compare how sf project deploy validate and sf project deploy start set the test level when --tests is provided. The report identifies an existing fix in plugin-deploy-retrieve PR 1650, with code changes still pending. Done means validate selects RunSpecifiedTests implicitly and the request no longer fails with INVALID_OPERATION.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Before You Submit
- I'm using the latest version of Salesforce CLI
- I've searched the existing issues
- I've run
sf doctorto diagnose common issues
Related Issue
No response
Command
sf project deploy validate
Org Type
Production
Did this work before?
Not sure
Last Working Version
No response
Summary
sf project deploy validate overrides the shared testLevelFlag default (src/utils/flags.ts), which sets --test-level to RunSpecifiedTests when --tests is passed, with a static default: TestLevel.RunLocalTests.
As a result, sf project deploy validate --tests MyTest (without --test-level) sent runTests=[MyTest] with testLevel=RunLocalTests, and the Metadata API rejected the request:
INVALID_OPERATION: runTests can only be used with a testLevel of RunSpecifiedTests
This doesn't affect sf project deploy start, which successfully sets test level to RunSpecifiedTests when you pass it --tests. This request is to align this behavior with the validate command.
I created the PR for this fix last month in plugin-deploy-retrieve: https://github.com/salesforcecli/plugin-deploy-retrieve/pull/1650 (Markdown changes were approved but pending code changes)
Repository to Reproduce
No response
Steps to reproduce
- Run
sf project deploy validatewith--testsbut no explicit--test-levelset.
Expected Result
When --tests are provided to sf project deploy validate, the test level is set to RunSpecifiedTests implicitly.
Actual Result
When --tests are provided to sf project deploy validate, the test level is set to RunAllLocalTestsand the validation fails with an INVALID_OPERATION.
Error Message
INVALID_OPERATION: runTests can only be used with a testLevel of RunSpecifiedTests
System Information
{
"architecture": "linux-x64",
"cliVersion": "@salesforce/cli/2.156.8",
"nodeVersion": "node-v24.22.1",
"osVersion": "Linux 5.14.0-687.60.1.el9_8.x86_64",
"rootPath": "/usr/local/sf",
"shell": "bash",
"pluginVersions": [
"@oclif/plugin-autocomplete 4.0.5 (core)",
"@oclif/plugin-commands 5.0.5 (core)",
"@oclif/plugin-help 7.0.5 (core)",
"@oclif/plugin-not-found 4.0.5 (core)",
"@oclif/plugin-plugins 7.0.10 (core)",
"@oclif/plugin-search 2.0.5 (core)",
"@oclif/plugin-update 5.0.8 (core)",
"@oclif/plugin-version 3.0.6 (core)",
"@oclif/plugin-warn-if-update-available 4.0.4 (core)",
"@oclif/plugin-which 4.0.5 (core)",
"@salesforce/cli 2.156.8 (core)",
"agent 2.2.3 (core)",
"apex 4.4.4 (core)",
"api 2.0.19 (core)",
"auth 6.0.0 (core)",
"data 5.1.19 (core)",
"deploy-retrieve 4.2.18 (core)",
"info 4.0.18 (core)",
"limits 4.0.6 (core)",
"marketplace 2.0.18 (core)",
"org 7.0.2 (core)",
"packaging 3.0.14 (core)",
"schema 4.0.12 (core)",
"settings 3.0.17 (core)",
"sobject 2.0.13 (core)",
"telemetry 4.2.1 (core)",
"templates 57.4.8 (core)",
"trust 4.0.23 (core)",
"user 6.0.3 (core)",
"apex-code-coverage-transformer 3.1.12 (user)",
"apextestlist 1.15.4 (user)",
"sfdx-git-delta 7.6.0 (user)"
]
}
Additional Information
See the fix in PR https://github.com/salesforcecli/plugin-deploy-retrieve/pull/1650
Screenshots or Log Files
No response
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 575
- Fork
- 80
- Merge trung bình
- 11 giờ 37 phút
- Pull request đã merge (30 ngày)
- 6
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 forcedotcom/cli
-
area:afdx bug owned by another team
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
forcedotcom/cli#3676 · 3 bình luận ·
-
sf agent mcp asset replace --assets null throws raw TypeError instead of InvalidShapeCó thể đã có người làm @konkonrong-lgtm đã nhận 86 ngày trước. Đang mởarea:afdx bug investigating owned by another team validated
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
forcedotcom/cli#3625 · 4 bình luận ·
-
area:afdx bug owned by another team
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
forcedotcom/cli#3608 · 2 bình luận ·
-
investigating validated
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
forcedotcom/cli#3683 · 1 bình luận ·
-
Profile convert to metadata format is O(n²) per tag in `mergeProfiles` (13.8.3+), blocks the event loop for minutes on large profilesCó thể đã có người làm @sfdcmatt đã nhận 1 ngày trước. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
forcedotcom/cli#3681 · 1 bình luận ·
Tất cả issue của forcedotcom/cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
richardcase/skills#29 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:desktop bug has repro platform:macos
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
anthropics/claude-code#107903 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
punitarani/fli#270 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ccch1mneyyy/dsh-TUI#1899 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
question
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày