The content publishing in test runs are counted against the limits bandwidth allocated to our instance. The situation is even worse when it comes to sandboxes, because limit is further reduced on the sandboxes. And obviously we want to test each and every functionality of the instance and not to behave differently in the test context hence, we have to publish the content in the test cases (Also, there is no way to mock in test cases).
Following are the challenges
- CI/CD pipelines continuously fails for the lower environments since the limit is really low.
- Each time a refresh is done, need to create a case with salesforce to get it increased with a business justification.
- Developer teams get blocked sometimes to further deliver the user stories.
- Lower instances behave way differently than the production.
- Running validate against production for each user story in lower environment may be costlier - since it will utilize limts
- ideally salesforce should not count test runs as limit
- A way to mock the publishing content like we do for APIs
- Production and staging should be as close as possible
Ref article: https://help.salesforce.com/articleView?id=000334861&language=en_US&type=1&mode=1