douglascayers / sfdc-convert-attachments-to-chatter-files

📎 Easily migrate your Attachments to Salesforce Files.
https://douglascayers.com/2015/10/10/salesforce-convert-attachments-to-chatter-files/
BSD 3-Clause "New" or "Revised" License
73 stars 29 forks source link

Can't deploy package due to unit test failures #13

Closed agaillard44 closed 7 years ago

agaillard44 commented 7 years ago

Hi, I tried the package on a sandboxe and everything works like a charm. Unfortunately, i can't deploy it on production environment due to unit test failures :

ConvertAttachmentsToFilesServiceTest test_inbound_email_and_do_convert System.AssertException: Assertion Failed Stack Trace: Class.ConvertAttachmentsToFilesServiceTest.test_inbound_email_and_do_convert: line 291, column 1

ConvertAttachmentsToFilesServiceTest test_inbound_email_and_do_not_convert System.AssertException: Assertion Failed: Expected: true, Actual: false Stack Trace: Class.ConvertAttachmentsToFilesServiceTest.test_inbound_email_and_do_not_convert: line 369, column 1

Am i the only one to experiencing that problem ?

Many thanks in advance for your help

douglascayers commented 7 years ago

Hello,

Could you share if there are any other error messages included in the Debug Logs when the test runs?

Those tests are asserting that Attachments belonging to EmailMessage objects upon being converted to Chatter Files (ContentVersion) will be parented to the Case that the email relates to. If you can attach the Debug Log when you run the unit test that will help in identifying what in your org might be preventing the conversion.

Things to consider:

Thanks,

Doug

agaillard44 commented 7 years ago

Hi Doug,

Many thanks for your answer. I've activated chatter feed on case (it was not activated) and tried to re install the package and now facing theses errors. Ehanced email is activated on the org (should disable it ?) and don't have validation rule on ContentDocument records on the org. Any Ideas ?

Deployment CompleteTest failure, method: ConvertAttachmentsToFilesBatchableTest.test_preserve_original_owner -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertAttachmentsToFilesBatchableTest.test_preserve_original_owner: line 132, column 1

Test failure, method: ConvertAttachmentsToFilesBatchableTest.test_scope_conversion -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertAttachmentsToFilesBatchableTest.test_scope_conversion: line 63, column 1

Test failure, method: ConvertAttachmentsToFilesQueueableTest.test_queueable_with_options -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertAttachmentsToFilesQueueableTest.test_queueable_with_options: line 16, column 1

Test failure, method: ConvertAttachmentsToFilesQueueableTest.test_queueable_without_options -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertAttachmentsToFilesQueueableTest.test_queueable_without_options: line 80, column 1

Test failure, method: ConvertAttachmentsToFilesServiceTest.test_no_delete -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertAttachmentsToFilesServiceTest.test_no_delete: line 10, column 1

Test failure, method: ConvertAttachmentsToFilesServiceTest.test_no_share_private_attachments_with_parent_record -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertAttachmentsToFilesServiceTest.test_no_share_private_attachments_with_parent_record: line 118, column 1

Test failure, method: ConvertAttachmentsToFilesServiceTest.test_yes_delete -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertAttachmentsToFilesServiceTest.test_yes_delete: line 62, column 1

Test failure, method: ConvertAttachmentsToFilesServiceTest.test_yes_share_private_attachments_with_parent_record -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertAttachmentsToFilesServiceTest.test_yes_share_private_attachments_with_parent_record: line 172, column 1

Test failure, method: ConvertNotesToContentNotesBatchableTest.test_preserve_original_owner -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertNotesToContentNotesBatchableTest.test_preserve_original_owner: line 131, column 1

Test failure, method: ConvertNotesToContentNotesBatchableTest.test_scope_conversion -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertNotesToContentNotesBatchableTest.test_scope_conversion: line 62, column 1

Test failure, method: ConvertNotesToContentNotesQueueableTest.test_queueable_without_options -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertNotesToContentNotesQueueableTest.test_queueable_without_options: line 81, column 1

Test failure, method: ConvertNotesToContentNotesQueueableTest.test_queueable_with_options -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertNotesToContentNotesQueueableTest.test_queueable_with_options: line 15, column 1

Test failure, method: ConvertNotesToContentNotesServiceTest.test_no_share_private_notes_with_parent_record -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertNotesToContentNotesServiceTest.test_no_share_private_notes_with_parent_record: line 124, column 1

Test failure, method: ConvertNotesToContentNotesServiceTest.test_no_delete -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertNotesToContentNotesServiceTest.test_no_delete: line 10, column 1

Test failure, method: ConvertNotesToContentNotesServiceTest.test_yes_share_private_notes_with_parent_record -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertNotesToContentNotesServiceTest.test_yes_share_private_notes_with_parent_record: line 178, column 1

Test failure, method: ConvertNotesToContentNotesServiceTest.test_yes_delete -- System.QueryException: List has no rows for assignment to SObject stack Class.ConvertNotesToContentNotesServiceTest.test_yes_delete: line 65, column 1

[image: http://www.ikumbi-solutions.com/img2/logopetit.png] http://www.ikumbi-solutions.com/

Anthony Gaillard

Consultant Solutions

F : 02 51 84 57 35 / M : 06 78 69 99 88

anthony.gaillard@ikumbi-solutions.com

11, rue Arthur III

44200 Nantes

www.ikumbi-solutions.com

[image: http://www.ikumbi-solutions.com/img2/baseline.png]

Suivez nous!

[image: http://www.ikumbi-solutions.com/img2/twitter.png] http://bit.ly/YDhvpj [image: http://www.ikumbi-solutions.com/img2/linkedIn.png] http://linkd.in/XBITUs [image: http://www.ikumbi-solutions.com/img2/viadeo.png] http://bit.ly/13V7Bz1 [image: http://www.ikumbi-solutions.com/img2/facebook.png] http://on.fb.me/13V6zDb

2017-02-26 6:50 GMT+01:00 Doug Ayers notifications@github.com:

Hello,

Could you share if there are any other error messages included in the Debug Logs when the test runs?

Those tests are asserting that Attachments belonging to EmailMessage objects upon being converted to Chatter Files (ContentVersion) will be parented to the Case that the email relates to. If you can attach the Debug Log when you run the unit test that will in identifying what in your org might be preventing the conversion.

Things to consider:

  • Do you have Enhanced Email enabled in the org you're deploying to?
  • Is Chatter Feed enabled on Case object in the org you're deploying to?
  • Are there any validation rules on ContentDocument, ContentVersion, or ContentDocumentLink records in the org you're deploying to?

Thanks,

Doug

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DouglasCAyers/sfdc-convert-attachments-to-chatter-files/issues/13#issuecomment-282535044, or mute the thread https://github.com/notifications/unsubscribe-auth/AYusYh9ZZQDRnPUXz3kRv1Db585PULplks5rgRK-gaJpZM4MHZoK .

douglascayers commented 7 years ago

Hi @agaillard44,

Sorry for late reply. Been busy and now trying to catch up!

I spot checked a few of those line numbers with test errors System.QueryException: List has no rows for assignment to SObject and seems to be when querying for profile whose name equals Standard User.

Profile p = [ SELECT id FROM Profile WHERE name = 'Standard User' ];

Does your org have a standard profile whose name is Standard User or something similar? My unit tests use that profile name because I thought that was something all orgs came with. If necessary, you may need to update the unit tests to query for a differently named profile for the testing, like System Administrator or something.

Thanks,

Doug

douglascayers commented 7 years ago

Another question, what edition is your org you're deploying to? Professional, Enterprise, Unlimited, something else? You can determine the editiion of the org by navigating to Setup | Company Information and looking for the Organization Edition field.

agaillard44 commented 7 years ago

Hi Doug,

I understand org has been created in french so the standard user profile has been named 'utilisateur standard'. I will have to update the unit test. Thanks again for your help. To answer your last question my edition is enterprise.

[image: http://www.ikumbi-solutions.com/img2/logopetit.png] http://www.ikumbi-solutions.com/

Anthony Gaillard

Consultant Solutions

F : 02 51 84 57 35 / M : 06 78 69 99 88

anthony.gaillard@ikumbi-solutions.com

11, rue Arthur III

44200 Nantes

www.ikumbi-solutions.com

[image: http://www.ikumbi-solutions.com/img2/baseline.png]

Suivez nous!

[image: http://www.ikumbi-solutions.com/img2/twitter.png] http://bit.ly/YDhvpj [image: http://www.ikumbi-solutions.com/img2/linkedIn.png] http://linkd.in/XBITUs [image: http://www.ikumbi-solutions.com/img2/viadeo.png] http://bit.ly/13V7Bz1 [image: http://www.ikumbi-solutions.com/img2/facebook.png] http://on.fb.me/13V6zDb

2017-03-12 23:22 GMT+01:00 Doug Ayers notifications@github.com:

Hi @agaillard44 https://github.com/agaillard44,

Sorry for late reply. Been busy and now trying to catch up!

I spot checked a few of those line numbers with test errors System.QueryException: List has no rows for assignment to SObject and seems to be when querying for profile whose name equals Standard User.

Profile p = [ SELECT id FROM Profile WHERE name = 'Standard User' ];

Does your org have a standard profile whose name is Standard User or something similar? My unit tests use that profile name because I thought that was something all orgs came with. If necessary, you may need to update the unit tests to query for a differently named profile for the testing, like System Administrator or something.

Thanks,

Doug

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DouglasCAyers/sfdc-convert-attachments-to-chatter-files/issues/13#issuecomment-285981859, or mute the thread https://github.com/notifications/unsubscribe-auth/AYusYnh-9k6QHT8wxnQv1NWuGfTwOrU1ks5rlHAQgaJpZM4MHZoK .

douglascayers commented 7 years ago

Thanks for the update @agaillard44. I would not have guessed the organization's language would have changed the data values on the records, but apparently it does!