I'm trying to create a version of an unlocked package using the codecoverage parameter, but it's failing at the first line of the first method in the test class.
@TestSetup
static void makeData(){
Id acctLender = Schema.getGlobalDescribe().get('Account').getDescribe().getRecordTypeInfosByName().get('Lender').getRecordTypeId();
The error I'm getting is: System.NullPointerException: Attempt to de-reference a null object
I replaced the above code with a SOQL search for the RecordType Id, and got a different error message with the same theme: List has no rows for assignment to SObject
I've tried explicitly pointing it to the dev hub with the -targetdevhubusername parameter, but that makes no difference.
The command entered was: sfdx force:package:version:create -p LenderBatch --codecoverage -targetdevhubusername username -x -w 10
Is there a parameter I'm missing here? Many thanks for any help.
*** Update
Another option apart from the pilot mentioned by sfdxfox, is the orgdependent parameter currently in beta.