Skip to content

Commit 05a1c6d

Browse files
committed
ci: Improve E2E test reliability and observability
Fixes a timing issue in the example app's E2E test by delaying the `stop()` API call. This ensures the SDK has sufficient time to receive `onInstallConversionData` before being stopped, preventing premature termination of the request. Enhances CI workflows to: * Update the iOS build cache key to include `example/.env`, ensuring a fresh build when environment variables change and preventing stale test configurations. * Log `.env` keys (with values redacted) during workflow runs for better debugging without exposing secrets.
1 parent c9836c1 commit 05a1c6d

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/android-e2e.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ jobs:
8383
- name: Write example app .env
8484
env:
8585
ENV_FILE: ${{ secrets.ENV_FILE }}
86-
run: echo "$ENV_FILE" | base64 -d > example/.env
86+
run: |
87+
echo "$ENV_FILE" | base64 -d > example/.env
88+
echo "::group::.env keys (values redacted)"
89+
sed 's/=.*/=***/' example/.env
90+
echo "::endgroup::"
8791
8892
- name: Build and run E2E on Android emulator
8993
uses: reactivecircus/android-emulator-runner@v2

.github/workflows/ios-e2e.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,17 @@ jobs:
117117
- name: Write example app .env
118118
env:
119119
ENV_FILE: ${{ secrets.ENV_FILE }}
120-
run: echo "$ENV_FILE" | base64 -d > example/.env
120+
run: |
121+
echo "$ENV_FILE" | base64 -d > example/.env
122+
echo "::group::.env keys (values redacted)"
123+
sed 's/=.*/=***/' example/.env
124+
echo "::endgroup::"
121125
122126
- name: Cache iOS build output
123127
uses: actions/cache@v5
124128
with:
125129
path: example/ios/build
126-
key: ios-build-${{ hashFiles('ios/**', 'index.js', 'example/ios/**') }}
130+
key: ios-build-${{ hashFiles('ios/**', 'index.js', 'example/ios/**', 'example/.env') }}
127131
restore-keys: ios-build-
128132

129133
- name: Build iOS simulator app (debug)

example/src/App.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ function runAutoFlow() {
156156
afLog('setConsentData', 'result: GDPR consent set');
157157

158158
// 9. Stop/resume cycle (E2E-006)
159+
// Delay so the SDK has time to receive onInstallConversionData from the
160+
// server before we stop it. Without this, stop(true) fires ~9ms after
161+
// startSdk() and kills the in-flight conversion data request.
162+
setTimeout(() => {
159163
appsFlyer.stop(true, () => {
160164
afLog('stop', 'result: true');
161165

@@ -185,6 +189,7 @@ function runAutoFlow() {
185189
});
186190
}, 3000);
187191
});
192+
}, 10000);
188193
}
189194

190195
const styles = StyleSheet.create({

0 commit comments

Comments
 (0)