SalesforceCommerceCloud / b2c-crm-sync

... a contemporary perspective on how to integrate B2C Commerce and the Salesforce Customer 360 Platform to power frictionless customer experiences in the B2C domain.
https://salesforcecommercecloud.github.io/b2c-crm-sync/
BSD 3-Clause "New" or "Revised" License
65 stars 45 forks source link

Multi-cloud unit-tests command failed #18

Open olegforce opened 2 years ago

olegforce commented 2 years ago

After running npm run crm-sync:test:use-cases tests following results are received:

  0 passing (1m)
  8 failing

  1) Authenticating a B2C Customer Profile via the OCAPI Shop API
       "before all" hook for "does not create a SFDC Contact when b2c-crm-sync is disabled for a storefront":
     Error: DELETE_FAILED: Your attempt to delete Unknown Customer could not be completed because it is associated with the following orders.: 00000216, 00000219
Your attempt to delete Unknown Customer could not be completed because it is associated with the following active orders.: 00000216, 00000219

      at Context.<anonymous> (test/_use-cases/b2c/authentication.live.test.js:107:19)
      at processTicksAndRejections (internal/process/task_queues.js:95:5)

  2) Registering a new B2C Customer Profile via the OCAPI Shop API
       "before all" hook for "does not create a SFDC Contact when b2c-crm-sync is disabled for a storefront":
     Error: DELETE_FAILED: Your attempt to delete Unknown Customer could not be completed because it is associated with the following orders.: 00000216, 00000219
Your attempt to delete Unknown Customer could not be completed because it is associated with the following active orders.: 00000216, 00000219

      at Context.<anonymous> (test/_use-cases/b2c/customerRegistration.live.test.js:101:19)
      at processTicksAndRejections (internal/process/task_queues.js:95:5)

  3) Progressive resolution B2C Commerce Customer creation scenarios via the B2CContactProcess API
       "before all" hook for "creates a Contact from a B2C CustomerList ID and Email attribute combination":
     Error: DELETE_FAILED: Your attempt to delete Unknown Customer could not be completed because it is associated with the following orders.: 00000216, 00000219
Your attempt to delete Unknown Customer could not be completed because it is associated with the following active orders.: 00000216, 00000219

      at Context.<anonymous> (test/_use-cases/sfdc/b2cContactProcess.create.live.test.js:106:19)
      at processTicksAndRejections (internal/process/task_queues.js:95:5)

  4) Progressive resolution of a B2C Commerce Customer error scenarios via the B2CContactProcess API
       "before all" hook for "returns an error if non-identifiers are used without a B2C CustomerList for resolution via the B2CContactProcess service":
     Error: DELETE_FAILED: Your attempt to delete Unknown Customer could not be completed because it is associated with the following orders.: 00000216, 00000219
Your attempt to delete Unknown Customer could not be completed because it is associated with the following active orders.: 00000216, 00000219

      at Context.<anonymous> (test/_use-cases/sfdc/b2cContactProcess.errors.live.test.js:104:19)
      at processTicksAndRejections (internal/process/task_queues.js:95:5)

  5) Progressive resolution of a B2C Commerce Customer via the B2CContactProcess API
       "before all" hook for "resolves an existing Contact using LastName and Email -- where the existing Contact does not have a B2C CustomerList":
     Error: DELETE_FAILED: Your attempt to delete Unknown Customer could not be completed because it is associated with the following orders.: 00000216, 00000219
Your attempt to delete Unknown Customer could not be completed because it is associated with the following active orders.: 00000216, 00000219

      at Context.<anonymous> (test/_use-cases/sfdc/b2cContactProcess.resolve.live.test.js:107:19)
      at processTicksAndRejections (internal/process/task_queues.js:95:5)

  6) Progressive resolution of a B2C Commerce Customer via the B2CContactProcess API
       "after all" hook for "returns an error when multiple records are resolved by B2C CustomerList and CustomerNo":
     DELETE_FAILED: Your attempt to delete Unknown Customer could not be completed because it is associated with the following orders.: 00000216, 00000219
Your attempt to delete Unknown Customer could not be completed because it is associated with the following active orders.: 00000216, 00000219

      at HttpApi.getError (node_modules/jsforce/lib/http-api.js:250:13)
      at /Users/osapishchuk/IdeaProjects/b2c-crm-sync/node_modules/jsforce/lib/http-api.js:95:22
      at tryCallOne (node_modules/promise/lib/core.js:37:12)
      at /Users/osapishchuk/IdeaProjects/b2c-crm-sync/node_modules/promise/lib/core.js:123:15
      at flush (node_modules/asap/raw.js:50:29)
      at processTicksAndRejections (internal/process/task_queues.js:77:11)

  7) Progressive resolution of a B2C Commerce Customer update scenarios via the B2CContactProcess API
       "before all" hook for "allows direct updates by B2C CustomerList, Email, and LastName":
     Error: DELETE_FAILED: Your attempt to delete Unknown Customer could not be completed because it is associated with the following orders.: 00000216, 00000219
Your attempt to delete Unknown Customer could not be completed because it is associated with the following active orders.: 00000216, 00000219

      at Context.<anonymous> (test/_use-cases/sfdc/b2cContactProcess.update.live.test.js:103:19)
      at processTicksAndRejections (internal/process/task_queues.js:95:5)

  8) Updating an SFDC Contact representing a B2C Commerce Customer Profile from within SFDC
       "before all" hook for "successfully updates a B2C Commerce Profile with changes initiated from SFDC when integration is enabled":
     Error: DELETE_FAILED: Your attempt to delete Unknown Customer could not be completed because it is associated with the following orders.: 00000216, 00000219
Your attempt to delete Unknown Customer could not be completed because it is associated with the following active orders.: 00000216, 00000219

      at Context.<anonymous> (test/_use-cases/sfdc/b2cCustomerProfileUpdate.live.test.js:98:19)
      at processTicksAndRejections (internal/process/task_queues.js:95:5)

All 8 use-cases throw the same error:

     DELETE_FAILED: Your attempt to delete Unknown Customer could not be completed because it is associated with the following orders.: 00000216, 00000219
Your attempt to delete Unknown Customer could not be completed because it is associated with the following active orders.: 00000216, 00000219
olegforce commented 2 years ago

To mitigate this issue, I :

I had the same issue on another new org, may I understand possible root cause for this. Is it some issue with permissions or something else?

olegforce commented 2 years ago

I assume it's something with the quality of the data on the org I'm using. These multi-cloud tests again failed to execute on the new org which was provisioned internally by Q Central, while I was installing b2c-crm-sync on it. FYI: Same order numbers and same errors.