Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Generate Mock data , copy prod to sandbox data #87

Closed
cropredy opened this issue Nov 11, 2014 · 6 comments
Closed

Suggestion: Generate Mock data , copy prod to sandbox data #87

cropredy opened this issue Nov 11, 2014 · 6 comments

Comments

@cropredy
Copy link

Andrew - Great tool as I was certainly getting tired of writing custom triggers to do rollups across lookup fields. However, it creates some interesting challenges with regression testing:

Assume the following dev cycle:

  1. Install package in sandbox
  2. Instantiate dlrs__LookupRollupSummary__c through the UI
  3. Deploy the custom trigger via the UI button
  4. Write regression tests that depend on the parent record's rollup field having some value (new functionality is why we installed the package in the first place)

It is at step 4 where the developer, presuming one wants to avoid @isTest(SeeAllData=true), has to mock out the values in dlrs__LookupRollupSummary__c.

So, Suggestion#1 would be to provide another button in the tool that would generate the data in a form suitable for inclusion in Test.loadData(somestaticResource) This becomes even more important as you add fields and functionality.

Continuing the dev cycle...

  1. Install package in PROD
  2. Populate PROD records of dlrs__LookupRollupSummary__c;
  3. Deploy any dev-created code plus the generated trigger; SFDC runs all tests and hence mocked data needed

and ...

  1. Refresh dev sandbox (we tend to refresh dev sandboxes every quarter from PROD)
  2. Uh-oh, dlrs__LookupRollupSummary__c has to be built all over again for any UI testing in the dev sandbox.

Suggestion#2: Provide a button that allows auto-copy of rows from one org to another via REST API so the reinstantiation of data rows from PROD to sandbox is painless and error-free.

Summary - In essence, SObject values are being used for metadata but they aren't really SFDC metadata and hence require copying/management/mocking.

Obviously easy for me to propose and not so easy for you to dispose so I'm certainly understanding.

@wes1278
Copy link
Contributor

wes1278 commented Nov 11, 2014

@cropredy I agree, this is a painful process. However, there is some great news ahead! Custom Metadatatypes are coming. I think these might be a great candidate for this new Salesforce feature.
Learn more about them by watching the dreamforce session about them this last Dreamforce: http://dreamforce.vidyard.com/watch/Wzzbh7ebd1PgNRBllkwQ8g

They will allow you to create actual metadata that can be migrated from one org to the next.

@afawcett, any comments on this?

@afawcett
Copy link
Collaborator

👍 Totally agree @wes1278 great use case!

@afawcett
Copy link
Collaborator

@cropredy Thanks your most welcome, and thank you for putting together this excellent summary of the problem. Your assertion that this is metadata data and not record data is spot on. Both of your options sound interesting, but i like @wes1278 idea the most, it really depends on timings i guess, how urgent this issue is vs when this new platform feature will be available. What kind of priority is this issue for you?

@cropredy
Copy link
Author

As we are still experimenting with DLRS I suspect our rollout will be slow so we can work around the data as metadata issue for now - especially since it seems as if Custom Metadata Types will be GA Summer 15. I watched the video and it seems promising for this DLRS application - as long as the custom metadata types are deployable via ANT, we'll be good here although I'd like to see changesets as well.

@afawcett
Copy link
Collaborator

Great thanks, i'll keep this open as an enhancement, as i will need to review how to adapt the tool to utilise this feature.

@aheber
Copy link
Contributor

aheber commented Mar 8, 2023

Closing this, I believe the needed functionality has been available for a long time now that DLRS uses Custom Metadata Records for the configuration and if needed supports custom Test method definitions to enable mocking records for successful test execution.

@aheber aheber closed this as completed Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants