Test coverage for codesigned updates - #51
Open
ofalvai wants to merge 1 commit into
Open
Conversation
ofalvai
commented
Sep 1, 2026
There was a problem hiding this comment.
Pull request overview
Adds integration coverage for signed CodePush updates across native platforms.
Changes:
- Signs generated update archives using a test RSA keypair.
- Configures native test applications with the public key.
- Adds a tampered-signature rejection scenario.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
test/test.ts |
Integrates signing and adds signature validation coverage. |
test/codesign.ts |
Implements hashing, JWT signing, and tampering helpers. |
test/fixtures/codesigning/test-public-key.pem |
Adds the test public key. |
test/fixtures/codesigning/test-private-key.pem |
Adds the test private key. |
Suppressed comments (1)
test/test.ts:247
- The
--expoiOS path returns frominstallPlatformat line 234 before this plist replacement runs. Expo iOS is a supported integration-test mode (package.json:28,33,38), so its app has no public key: signed updates are not actually verified, and the tampered-signature test will receiveDOWNLOAD_SUCCEEDEDrather than the expectedDOWNLOAD_ERROR. AddCodePushPublicKeyto the generated Expo Info.plist before that branch returns too.
"<key>CodePushDeploymentKey</key>\n\t<string>" + this.getDefaultDeploymentKey() + "</string>\n\t<key>CodePushServerURL</key>\n\t<string>" + this.getServerUrl() + "</string>\n\t<key>CodePushPublicKey</key>\n\t<string>" + codeSigningPublicKey + "</string>\n\t</dict>\n</plist>"))
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const string = path.join(innerprojectDirectory, "android", "app", "src", "main", "res", "values", "strings.xml"); | ||
| TestUtil.replaceString(string, TestUtil.SERVER_URL_PLACEHOLDER, this.getServerUrl()); | ||
| TestUtil.replaceString(string, TestUtil.ANDROID_KEY_PLACEHOLDER, this.getDefaultDeploymentKey()); | ||
| TestUtil.replaceString(string, "</resources>", `<string moduleConfig="true" name="CodePushPublicKey">${codeSigningPublicKey}</string>\n</resources>`); |
ofalvai
force-pushed
the
push-qntptxzvpzzy
branch
2 times, most recently
from
September 2, 2026 05:50
500fb6e to
f01e321
Compare
ofalvai
force-pushed
the
push-qntptxzvpzzy
branch
from
September 2, 2026 06:20
f01e321 to
c177c00
Compare
ofalvai
marked this pull request as ready for review
September 2, 2026 06:28
ofalvai
commented
Sep 2, 2026
| @@ -0,0 +1,96 @@ | |||
| "use strict"; | |||
Collaborator
Author
There was a problem hiding this comment.
New file, I think it's time to start splitting up that really long test.ts
ofalvai
commented
Sep 2, 2026
|
|
||
| import { Platform, ProjectManager, ServerUtil, setupUpdateScenario, TestConfig, TestUtil } from "code-push-plugin-testing-framework"; | ||
|
|
||
| const CODEPUSH_METADATA_FILE_NAME = ".codepushrelease"; |
Collaborator
Author
There was a problem hiding this comment.
This and the next few functions are existing code, moving from test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
We want to make bigger changes to the iOS package signature codepath, but integration tests don't verify codesigned updates at the moment.
What
Instead of adding a ton of new test cases for codesigned updates, this PR makes existing test cases run codesigned updates. Signature verification is an additional step during package install, we don't lose test coverage by testing codesigned updates.
Main changes:
.codepushreleaseJWT token for each update packageCodePushUpdateKeyfor the test apps, enabling signature checking behaviorTwo smaller fixes are also included in this PR, surfaced by the main change:
expo.jsat the repo root) didn't handle theCodePushPublicKeyconfig field, so even if users added this field toapp.json, it had no effect on the Expo app prebuild.Info.plistediting. It was matching the string1.0as a regular expression (note the dot char!), which also started matching sections of the public key, as soon as I added one to the plist. This PR replaces that fragile regex string replace logic with much simpler and stableplutilcalls (this is part of macOS at/usr/bin/plutil).