Skip to content

W-20683414 ODS Lifecycle E2E tests#23

Merged
charithaT07 merged 8 commits intomainfrom
W-20683414-ODS-Lifecycle-E2E-tests
Jan 6, 2026
Merged

W-20683414 ODS Lifecycle E2E tests#23
charithaT07 merged 8 commits intomainfrom
W-20683414-ODS-Lifecycle-E2E-tests

Conversation

@charithaT07
Copy link
Collaborator

Summary

Brief description of what this PR does.

This PR introduces end-to-end tests for ODS (On-Demand Sandbox) functionality, covering the sandbox lifecycle from creation to deletion.

This is the initial implementation for review and feedback. Future enhancements will add E2E coverage with additional ODS workflows including site imports

Test Coverage

✅ Sandbox creation with permissions and wait functionality
✅ Sandbox listing and verification
✅ Code deployment to sandbox
✅ Sandbox state management (stop/start/restart)
✅ Sandbox status retrieval
✅ Sandbox deletion
✅ Error handling for invalid realms and authentication failures

* @W-20683414 initial ODS E2E tests

* added end to end ODS lifecycle tests

* minor refactors

* updated e2e test run flow

* Updated execa version and lockfile

* resolved linting and formatting issues
@charithaT07 charithaT07 marked this pull request as ready for review January 6, 2026 12:00
@charithaT07 charithaT07 requested a review from clavery as a code owner January 6, 2026 12:00
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@charithaT07 Lets keep this file and not delete. My plan for it was a cross-functional e2e test of the CLI itself from shell.

/**
* Helper function to parse JSON response from CLI
*/
function extractJsonFromText(text: string): null | string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this function was necessary? When using --json mode the stdout should be valid JSON so I'm curious which situation it was not.

Also be aware that OCLIF has some test helpers https://oclif.io/docs/testing/ that may be useful and conserve code when testing the CLI directly. We should make sure we're taking full advantage of those.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks , as json mode is giving valid json I removed extractJsonFromText. Agreed on OCLIF test helpers . The reason we used execa is to exercise the CLI as an external process to better reflect real user behavior.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason we used execa is to exercise the CLI as an external process to better reflect real user behavior.

Yep no problem there. Just wanted to make sure you knew about the test helpers. Use what is useful

clavery
clavery previously approved these changes Jan 6, 2026
Copy link
Collaborator

@clavery clavery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. If you're putting in the new workflow I'll reapprove when that's ready. I'll add vars and secrets today for

vars.TEST_REALM (var not secret)
vars.SFCC_CLIENT_ID
secrets.SFCC_CLIENT_SECRET
vars.SFCC_ACCOUNT_MANAGER_HOST
vars.SFCC_SANDBOX_API_HOST

@charithaT07 charithaT07 requested a review from clavery January 6, 2026 19:54
@amit-kumar8-sf amit-kumar8-sf self-requested a review January 6, 2026 20:00
@charithaT07 charithaT07 merged commit 473ed6a into main Jan 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments