Skip to content

Conversation

@vpaiu
Copy link
Contributor

@vpaiu vpaiu commented Dec 10, 2025

Issue

D356921475

Description of Changes

  • Fetched the sagemaker unit tests from: Add testing changes sagemaker-code-editor#202
  • Tweaked the following unit tests because of patch differences:
    1. webview.test.ts - Updated the hashes.
    2. custom-extensions-marketplace.test.ts - Changed because Code Editor has its own patch for custom marketplace (patches/web-server/marketplace.diff)
    3. signature-verification.test.ts - Removed some tests which are unnecessary because of patches/common/allow-unused-vars.diff
    4. display-language.test.ts - Rewrote the unit tests to fit Code Editor's patches/web-server/display-language.diff patch.
  • Imported the script for running the unit tests with one small change: the script now checks if the code-editor-src folder exists, if it doesn't ./scripts/prepare-src.sh code-editor-sagemaker-server is executed.
  • Made changes to .gitignore for ignoring the node_modules, package.json, and package-lock.json generated during the tests run.
  • Changed the CODEOWNERS file to allow the sagemaker team to make changes to the sagemaker-tests folder.

Testing

The unit tests all run successfully locally

Screenshots/Videos

N/A

Additional Notes

N/A

Backporting


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@vpaiu vpaiu requested a review from a team as a code owner December 10, 2025 15:34
Copy link
Contributor

@feiyangliu2023 feiyangliu2023 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 to me, good job!

@austinjang2
Copy link

LGTM

Copy link
Contributor

@azmkercso azmkercso left a comment

Choose a reason for hiding this comment

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

I have two nitpicky comments, but I do not see any issues with the tests

Comment on lines +11 to +12
package-lock.json
package.json
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this necessary? What prompted adding this? Usually package.json files are not ignored

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When running ./scripts/run-sagemaker-unit-tests.sh the package.json is generated, and for now we don't really need to store it, since the only dependency is @types/node, and the tests themselves are not a proper single project (the test files are just compiled one by one and run individually). If the unit tests are expanded in the future then we could add a proper package.json.

}

const content = readFileSync(filePath, 'utf8');
const expectedHash = "script-src 'self' 'wasm-unsafe-eval' 'sha256-yhZXuB8LS6t73dvNg6rtLX8y4PHLnqRm5+6DdOGkOcw=' https: http://localhost:* blob:;";
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: the hardcoded checksum here could be blocking further automated rebases. As a future improvement, the expected checksum could be dynamically injected here during the rebasing process.

@vpaiu vpaiu merged commit 81a0b57 into aws:1.0 Dec 11, 2025
1 check passed
vpaiu added a commit to vpaiu/code-editor that referenced this pull request Dec 11, 2025
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.

4 participants