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

Deploy Code Version from CLI failing #97

Closed nek4life closed 2 years ago

nek4life commented 2 years ago

Describe the bug

500 Error when trying to create code version

To Reproduce

Follow instructions and create all OCAPI and Webdav config including creating a new API key

Run the following command

npm run crm-sync:test:cli

Output

Creating a Specific Code Version via the CLI ✓ returns true if the code-version was created ✓ returns false if the code-version was not created -- Error: Request failed with status code 500 -- Retrying request | attempt 1 of 3 -- Error: Request failed with status code 500 -- Retrying request | attempt 2 of 3

Expected behavior

Test should pass without 500 error or have more explanation of what to fix. Setup configuration on multiple sandboxes with multiple API keys and have same results.

Following tests all pass before this error

Calculating the Deployment Path ✓ successfully calculates the deploy path for b2c cartridges

Setting-Up the B2C Deployment Folders ✓ successfully creates the expected deployment folders

Verifying and Creating Deployment Folders ✓ successfully verifies the target directory in the file system ✓ successfully verifies and removes a directory with sub-directories ✓ throws an error if a path to process is not defined

Zipping / Archiving a Specific Directory ✓ successfully generates an archive from a source directory ✓ successfully returns an error if any issues occur when creating the zip-archive

Building OCAPI Urls ✓ successfully creates the getSite Shop Url ✓ successfully creates the getSite Data Url

Authentication via SFCC-CI ✓ succeeds when valid credentials are provided ✓ fails when invalid credentials are provided

Activating a specific Code Version via SFCC-CI ✓ returns true if the code-version was activated ✓ returns false if the code-version was not activated ✓ gracefully fails when an error occurs activating a code version

Screenshots If applicable, add screenshots to help explain your problem.

Your local environment details:

Your remote environment details:

olegforce commented 2 years ago

Actually, if this is the same I'm recalling, it will be a very funny one. Funny as it's not an actual failure, but just a scenario running that expects it to fail, hence the outcome is good. In the background, it just run some unit tests and per test, it should fail 3 times. But it's better for someone else to confirm it, I just recall I recently had a chat with @neeraj-jain01 about this one.

nek4life commented 2 years ago

@olegforce thanks for this. I was stopping the script at the error and revising my config thinking it was causing an error. There are other scenarios where the tests display error messages. It would be great if the messages could say something like

Simulating failure scenario attempt 1 of 3 or something like that so it does not look like an error in the tests. Perhaps not displaying the text in red as well. I spent more time on this than I would like to admit :D

nek4life commented 2 years ago

Closing. Tests are actually testing failure. Should probably have better messaging around this, that could be opened as a separate issue.