Bear with me but I am completely confused as the documentation is fragmented, not entirely specific, and contradictory in places.
I am creating an unlocked no namespace package for our org. The test methods for that package requires the use of classes (existing in our org) as those classes are shared testing classes. I need to be able to use those classes in the unlocked package so I do not keep recreating duplicate classes.
What I did
- Scratch org with Package A (needing the test methods)
- I create a package in another scratch org with the shared classes, created a package and package version
- I added the dependency to Package A project son
- I installed the package to the Package A scratch org
Where do you actually create the package for the shared classes? I created it in a scratch org like the docs said. But what happens when the scratch org is deleted due to expiration
I cannot promote the package version as it says I do not have the required permissions. What permission is required to promote?
Do I need to promote the unlocked package to a released version at all?
- When I finally install the shared Package B into the prod org, will it overwrite the current classes since they were previously existing?
Sorry for the confusion but the workflow does not seem well defined. Basic premise is trying to develop a feature package and use existing artifacts from prod to support test methods in the new package
Any clarification would be helpful. My question may also not be clear as I am a bit confused....