This page provides information on a common issue encountered when building unlocked packages in Salesforce that do not contain any Apex code but still fail due to code coverage requirements.
unpackagedMetadata
or apexTestAccess
properties: Check if you are using the unpackagedMetadata
or apexTestAccess
properties on the package in sfdx-project.json
. In this case, these properties were not used.
Snapshot build org: If you are using a snapshot build org and have deployed Apex classes to the initial scratch org that you made a snapshot of, then Salesforce will execute Apex tests (RunAllLocalTests
). However, Salesforce probably wouldn't run the apex tests at all if there were none in the package you were verifying.
Creating a class and testing it: As a workaround, you can create a class and test it. This seems to be a bug, but it's not confirmed.
Error Message: "No org shape exists for the specified sourceOrg. Create an org shape and try again."
Symptom: When attempting to use an Org Shape, an error is received stating that no org shape exists for the specified sourceOrg, despite the Org Shape being previously activated and the ID matching. Solution: Recreate the org shape
Error Message: "Your password cannot be reset at this time. Please contact your organization's administrator for more information."
Symptom: When creating a pool of scratch orgs using a shape org, sfp is unable to provision it with the above error message
Solution:
The issue is related to the `minimum 1 day password lifetime` setting. If this setting is enabled, it may cause the above error. To resolve this, you can disable this setting in the scratch org definition file. Here is an example of how to do this:
After making this change, the error should no longer occur. If you still encounter issues, please create an issue in the repository for further assistance.