Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Beta Package Version Creation Failing Due to Apex Test Outside Package Scope

Đang mở
#3,540 16 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Lĩnh vực
cli, release

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ả

owned by another team tracked elsewhere validated

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
  1. 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
    }
  }
}
  1. Ensure MyProfilePageControllerTest exists in the org.
  2. Run the test class directly to confirm it fails:
    sf apex run test --class-names MyProfilePageControllerTest --synchronous
    
  3. 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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của forcedotcom/cli

Tất cả issue của forcedotcom/cli

Issue tương tự

Thêm issue về CLI

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.