Skip to content

Simplify test infrastructure and fix versions#456

Merged
wmathurin merged 7 commits into
forcedotcom:devfrom
wmathurin:rn-upgrade-0.82
Jun 1, 2026
Merged

Simplify test infrastructure and fix versions#456
wmathurin merged 7 commits into
forcedotcom:devfrom
wmathurin:rn-upgrade-0.82

Conversation

@wmathurin
Copy link
Copy Markdown
Contributor

Summary

  • Simplify test credentials: both iosTests/ and androidTests/ expect test_credentials.json at their root (removed shared/test/ directory and symlink)
  • Use file:.. for react-native-force in test package.json — tests always run against local code, no push required
  • Add Gradle task to copy test_credentials.json to assets at build time (no more ordering dependency with prepareandroid.js)
  • Fix react-android/hermes-android version: 0.81.50.82.1
  • Update .gitignore for test artifacts
  • CI workflows run create_test_credentials_from_env.js before prepare scripts

Test plan

  • iOS tests build and pass (35/35) via Xcode
  • prepareandroid.js runs successfully
  • Android project builds and runs tests in Android Studio
  • Missing test_credentials.json prints a clear warning

wmathurin added 6 commits June 1, 2026 14:05
…folder

- Remove shared/test/ directory and iosTests symlink
- Both iosTests/ and androidTests/ now expect test_credentials.json
  at their root (gitignored)
- prepareios.js and prepareandroid.js copy it to where the native
  project reads it (ios/ for Xcode, android assets for Android)
- CI workflows run create_test_credentials_from_env.js before prepare
  so the file exists when prepare copies it
Tests should always run against the local code, not a remote branch.
This removes the need to push changes before testing.
Ensures the latest test_credentials.json is always picked up
regardless of when prepareandroid.js was run.
jvmToolchain(17)
}

// Copy test_credentials.json from androidTests/ root into assets before each build
Copy link
Copy Markdown
Contributor

@brandonpage brandonpage Jun 1, 2026

Choose a reason for hiding this comment

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

Is this a good time to switch to the same /shared/test/ directory that the other repos use?

Edit: The directory already exists in the repo, it just isn't used.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did it half-way (android using it, but ios left unchanged) - then moved away from it because of the different expectations around login server. But now that it's fixed, a shared/tests/test_credentials.json would make sense. Maybe I'll do that in the next PR (the 0.83 upgrade ;-).

Copy link
Copy Markdown
Contributor

@brandonpage brandonpage Jun 1, 2026

Choose a reason for hiding this comment

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

It makes using the workspace and automating CI fixes a lot easier when the setup for all repos is standardized.

@wmathurin
Copy link
Copy Markdown
Contributor Author

Android CI failure explained:

The MobileSync tests timeout because test_credentials.json never reaches the APK and the other tests do not get a chance to run. Locally, they all pass.

Two issues:

  1. Workflow order bug — the current dev workflow runs prepareandroid.js before create_test_credentials_from_env.js, so credentials aren't written yet when prepare copies them to assets.
  2. test_login_domain format mismatch — CI credentials use a bare hostname (no https://), but Android's TestCredentials.java expects the full URL. The fix is in the companion PRs (#2912 on Android, #4049 on iOS).

Both fixes need to land in dev before Android CI can pass.

@wmathurin wmathurin merged commit 673e115 into forcedotcom:dev Jun 1, 2026
5 of 7 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.

2 participants