You need to sign in to do that
Don't have an account?
James Wróbel
Production code deployment not working due to failed test
Hi, we have some Apex classes to deploy to our production org however one of the test classes is failing preventing us from being able to continue. It looks like it is not able to create a test User record in production. There were no issues with this test in lower environments, only when attempting to deploy to production. The profiles are the same across environments so I dont expect that to be the issue. Are there any additional settings that need to be made to create this kind of test data in a production org?
Thanks!
James
Thanks!
James
Can you let us know what exactly the error while running the test class?
Thanks.
Test failure, method: IndividualUtilitiesCustomTest.getIndividualIdFromUserPositive -- System.StringException: Invalid id: No Individual stack Class.IndividualUtilitiesCustomTest.getIndividualIdFromUserPositive: line 178, column 1Test failure, method: IndividualUtilitiesCustomTest.getIndividualIdFromUserPositive -- System.StringException: Invalid id: No Individual stack Class.IndividualUtilitiesCustomTest.getIndividualIdFromUserPositive: line 178, column 1
Is your test class contains (seealldata=true)?
This error is not generic so have to go through code .
Thanks,
No, seealldata=true has not been set in the test class.
Basically, the test class runs and creates some records of different objects, i.e. Account, Contact, User. When it comes to accessing the User record that it should have created, it does not seem to be able to find/access that record. I am wondering if there are any restrictions or some setting that is required to allow test data of this kind to be created in a production environment? This test works without issue in all our other non-production environments, it only fails when attempting to run against production hence the suggestion that it might be an org specific issue.
Thanks.
Can you confirm with which user you are running create user ? May be your user does not have permisison to create user in production org. Did you check ?
Thanks
It is using our Copado integration user account that has system admin access. There doesn't appear to be many settings in the profile around the User object but all looks ok (the same settings as in other environments). There are also a number of system permissions within the Admin profile around user management, but these are all set to true. The profile reflects the access in our other non-prod environment that are working so I assuming it isn't the root cause.
Thanks.