Sfdx force:apex:test:run RunLocalTests doesn't work correctly for the unlocked package apex test class(es)
Salesforce says this works as designed.
Summary
Sfdx force:apex:test:run -l RunLocalTests doesn't work correctly for the unlocked package apex test class(es).
The unmanaged apex test class(es) should be fired with RunLocalTests, but the unlocked package's apex test class should not be run.
The unmanaged apex test class(es) should be fired with RunLocalTests, but the unlocked package's apex test class should not be run.
Workaround
We haven't loaded the full details for this issue yet. Check the official page.
History
First tracked here as Working as Expected with 1 report
Nov 30, 2026
Also open in Compute Services
Static resources, documents, attachments failed to load or return 404 Not Found
Solution ScheduledPlatform / Compute ServicesSpring '20Reported Apr 24, 2020210 reports210reports
Salesforce Lightning Inspector add-on does not work when enhanced domains are enabled.
Solution ScheduledPlatform / Compute ServicesSummer '22Reported Aug 10, 202279 reports79reports
JSON.serialize Exception on Messaging.SendEmailResult Object Due to Ignoring Bean Info
In ReviewPlatform / Compute ServicesWinter '20Reported Dec 3, 201943 reports43reports
System.enqueuejob is consuming high CPU when called inside a Apex Trigger
In ReviewPlatform / Compute ServicesWinter '20Reported Nov 19, 201929 reports29reports