Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#3,540 16 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Ambito
cli, release

Direzione di ricerca

Inizia riproducendo il malfunzionamento con la definizione di scratch-org fornita e sf package version create, quindi esegui sf apex run test --class-names MyProfilePageControllerTest --synchronous per confermare il test che fallisce. Analizza il task CI create_package_version e la selezione dei test di package-version; il lavoro è completato quando la creazione della beta non è bloccata dal malfunzionamento di MyProfilePageControllerTest al di fuori del pacchetto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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).


Lingua principale
Nessun dato sulla lingua
Stelle
571
Fork
80
Merge medio
2g 21h
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di forcedotcom/cli

Tutte le issue di forcedotcom/cli

Issue simili

Altre issue su CLI

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.