Beta Package Version Creation Failing Due to Apex Test Outside Package Scope
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện lỗi với định nghĩa scratch-org được cung cấp và sf package version create, sau đó chạy sf apex run test --class-names MyProfilePageControllerTest --synchronous để xác nhận test bị lỗi. Điều tra tác vụ CI create_package_version và việc chọn test package-version; hoàn tất khi việc tạo beta không bị chặn bởi lỗi của MyProfilePageControllerTest nằm ngoài package.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Related to / reopening: #553
This issue was previously closed in #553 but we are still hitting the same behavior. Beta package version creation fails because Salesforce executes Apex tests that exist in the org but are not part of the package, causing the build to fail on tests we have no control over in the package context.
Description
When running sf package version create for a beta release, the command fails with an Apex Test Failure from a test class (MyProfilePageControllerTest) that is not included in the package source/branch. The test runner is picking up org-level tests beyond the package boundary, which makes the beta pipeline unreliable.
Error from CI logs:
[Error]: Package creation failed with error:
Apex Test Failure:
Class.element.MyProfilePageControllerTest.testSave: line 30,
column 1 System.AssertException: Assertion Failed
Exception in task create_package_version
Steps to Reproduce
- Create a scratch org using the following definition file:
{
"orgName": "Scratch Org",
"adminEmail": "<your-email>",
"edition": "Developer",
"features": ["EnableSetPasswordInApi", "Sites", "COMMUNITIES", "StateAndCountryPicklist"],
"settings": {
"apexSettings": {
"enableDisableParallelApexTesting": false
},
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true
},
"mobileSettings": {
"enableS1EncryptedStoragePref2": false
},
"experienceBundleSettings": {
"enableExperienceBundleMetadata": true
},
"communitiesSettings": {
"enableNetworksEnabled": true,
"enableOotbProfExtUserOpsEnable": true
},
"customAddressFieldSettings": {
"enableCustomAddressField": true
},
"externalClientAppSettings": {
"enableClientSecretInRestApiAccess": true
}
}
}
- Ensure
MyProfilePageControllerTestexists in the org. - Run the test class directly to confirm it fails:
sf apex run test --class-names MyProfilePageControllerTest --synchronous - Observe the test fails due to
MyProfilePageControllerTest.
Expected Behavior
Test should pass
Actual Behavior
The command fails with System.AssertException: Assertion Failed from MyProfilePageControllerTest.testSave (line 30).
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 571
- Fork
- 80
- Merge trung bình
- 2 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 3
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
-
investigating validated
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
forcedotcom/cli#3657 · 2 bình luận ·
-
`sf agent preview` fails with `AgentApiNotFound` against staging (aws-stage1) orgs — `stage.api.salesforce.com` missing from endpoint fallbackCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea:afdx 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#3645 · 2 bình luận ·
-
bug investigating validated
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
forcedotcom/cli#3644 · 6 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 56 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 ·
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 88/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
vanderheijden86/b9s#20 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Assumes hard-coded ~/.dotfilesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100