Skip to content

Conversation

@Mansi-mParticle
Copy link
Collaborator

Background

  • This PR introduces an automated end-to-end integration testing framework for the Android SDK, aligned with the existing iOS setup.
    It uses WireMock to validate SDK network requests against expected baselines and runs automatically in CI.
    This improves regression detection and increases confidence when shipping changes to the SDK.

What Has Changed

  • This PR adds a Android test app and a suite of automated scripts to run end-to-end integration tests with WireMock. The framework captures SDK network requests, normalizes dynamic fields, and validates them against stored baselines.Scripts handle WireMock and emulator management, app building, test execution, recording, and verification.Key features include zero-configuration startup, secure credential handling, baseline comparison, cross-platform support, and robust error reporting.

Screenshots/Video

  • {Include any screenshots or video demonstrating the new feature or fix, if applicable}

Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have tested this locally.

Additional Notes

  • {Any additional information or context relevant to this PR}

Reference Issue (For employees only. Ignore if you are an outside contributor)

@Mansi-mParticle Mansi-mParticle requested a review from a team as a code owner January 6, 2026 21:22
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
3 Security Hotspots

See analysis details on SonarQube Cloud

log_info '1. Check if ANDROID_HOME is set: echo $ANDROID_HOME'
log_info '2. Verify emulator binary exists: ls $ANDROID_HOME/emulator/emulator'
log_info "3. List available AVDs: emulator -list-avds"
log_info "4. The startup script uses 'sudo' which may require a password"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not necessary. There should be other ways to fix it.

* This app initializes the mParticle SDK with WireMock endpoints and sends
* test events for validation against WireMock recordings.
*/
public class IntegrationTestApplication extends Application {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we convert this to Kotlin?

* This activity sends a series of test events that match the iOS integration
* test suite to ensure feature parity.
*/
public class MainActivity extends AppCompatActivity {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This as well. All the new files can be in Kotlin.

String apiKey = extras.getString("MPARTICLE_API_KEY");
String apiSecret = extras.getString("MPARTICLE_API_SECRET");
if (apiKey != null && apiSecret != null) {
// Write to credentials file for Application class to read
Copy link
Collaborator

Choose a reason for hiding this comment

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

Application onCreate would have finished by this time.
Do we need to support dynamic keys? Why don't we set the keys at build time itself?

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