Skip to content

Conversation

@denischilik
Copy link
Contributor

@denischilik denischilik commented Nov 13, 2025

Background

This change introduces an iOS Integration Test App for the mParticle Apple SDK.
Previously, there was no automated way to record and replay SDK API interactions for integration testing.
The new Integration Test App, combined with WireMock recording, provides a standardized framework to simulate and verify SDK network behavior across SDK updates.

What Has Changed

  • New IntegrationTests Tuist project linked to local SDK sources
  • WireMock recorder setup for capturing API traffic
  • Automation script run_wiremock_recorder.sh for building, running simulator, and recording
  • Added configs (.gitignore, Project.swift, mappings) and sample app (main.swift)

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.

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

@denischilik denischilik marked this pull request as ready for review November 13, 2025 18:01
@denischilik denischilik requested a review from a team as a code owner November 13, 2025 18:01
- Add Tuist project configuration for IntegrationTests
- Add WireMock recorder script for API mocking
- Add initial test app implementation
- Add proxy mappings for events and identify endpoints
- Add README and generation scripts

Add NO_OPEN parameter to generate.sh to control Xcode opening

- Remove unused configuration variables
- Add NO_OPEN parameter (defaults to false)
- Conditionally call tuist generate with --no-open flag when NO_OPEN=true
- Allows generate.sh to be used both standalone (opens Xcode) and from other scripts (skips Xcode)

Refactor run_wiremock_recorder.sh to use detached mode with auto-cleanup

- Add generate.sh call at the beginning to build project
- Run WireMock in detached mode (-d flag) with named container
- Extract logic into three functions: start_wiremock, wait_for_wiremock, stop_wiremock
- Add health check waiting for WireMock to be ready (checks admin API)
- Implement trap for automatic cleanup on EXIT/INT/TERM signals
- Script now stays running until interrupted, ensuring proper container cleanup

Add build_application function to run_wiremock_recorder.sh

Add reset_simulators function

Add find_device, start_simulator and install_application functions

Add launch_application and wait_for_app_completion functions

Add automatic device selection and test execution flow

- Add find_available_device() function to automatically select available iPhone simulator
- Add find_app_path() function to locate built application
- Add complete test execution flow after WireMock starts
- Update device priority list to include iPhone 17
- Move DEVICE_NAME to global variables for dynamic assignment

Fix build command to use generic iOS Simulator platform and add quiet mode

- Change destination to 'generic/platform=iOS Simulator' to avoid dependency on specific device name
- Add -quiet flag to reduce build output verbosity

- change order

Update README: clarify purpose as API recording tool for testing

- Update description to focus on recording API requests for later use in tests
- Simplify prerequisites and overview sections
- Remove detailed technical sections (Build Process, WireMock Recording, Device Selection, Benefits)
- Consolidate troubleshooting into single section for port conflicts
- Remove CI/CD integration examples
- Update development workflow to emphasize recording purpose

Use local SDK sources directly instead of building xcframework

- Update Project.swift to use .local(path: '../') package reference
- Remove Tuist/Package.swift to allow Xcode to resolve local package
- Simplify generate.sh to only generate project (no xcframework build)
- Update README to reflect new simpler approach
- Remove temp_artifacts directory (no longer needed)

Benefits:
- No need to rebuild xcframework for every change
- Xcode automatically picks up latest source code changes
- Much faster development workflow
- Simpler and more maintainable approach

Remove generate.sh script and update documentation

- Delete generate.sh (no longer needed - tuist generate is called directly)
- Update README to remove generate.sh section
- Simplify available scripts documentation to only show run_wiremock_recorder.sh

- add documentation how to use tuist

- cleanup .gitignore

Remove comment
@denischilik denischilik force-pushed the feat/SDKE-534-Implement-iOS-Test-App branch from b205baa to f8c9b58 Compare November 13, 2025 18:16
Copy link
Contributor

@nickolas-dimitrakas nickolas-dimitrakas left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@BrandonStalnaker BrandonStalnaker left a comment

Choose a reason for hiding this comment

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

LGTM thanks fro addressing that one thing earlier


Tools for recording mParticle Apple SDK API requests using WireMock for later use in integration testing.

## Prerequisites
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should probably add the installation of any tools just to CONTRIBUTING.md
Also there's mention of docker commands below so I'm assuming this should be a prerequisite too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, will update in then PR

// main.swift
// IntegrationTests
//
// Created by Denis Chilik on 11/4/25.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Should be either removed or changed to Rokt. Ideally this should be in the project config

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, but let discuss with after the daily first. To keep it consistent.

@denischilik denischilik merged commit a1e51fc into main Nov 14, 2025
11 checks passed
@denischilik denischilik deleted the feat/SDKE-534-Implement-iOS-Test-App branch November 14, 2025 14:18
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.

5 participants