Skip to content

[CI] Add basic Argent end-to-end tests - #4318

Draft
j-piasecki wants to merge 9 commits into
mainfrom
@jpiasecki/tap-e2e
Draft

[CI] Add basic Argent end-to-end tests#4318
j-piasecki wants to merge 9 commits into
mainfrom
@jpiasecki/tap-e2e

Conversation

@j-piasecki

@j-piasecki j-piasecki commented Jul 16, 2026

Copy link
Copy Markdown
Member

Description

  • Updates basic tap and long-press examples to be observable
  • Adds basic Argent e2e tests for the updated examples
  • Updates the workflows to run argent tests on CI

Test plan

Status checks

Copilot AI review requested due to automatic review settings July 16, 2026 07:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an Argent-driven “Basic Tap” end-to-end test flow and CI workflows to run it on Android and iOS, plus small UI/test hooks in the example app so the flow can reliably locate elements and assert gesture callback ordering.

Changes:

  • Add Android and iOS GitHub Actions workflows to build the Expo example app and run the simple-tap-test Argent flow.
  • Update the “Tap” example to expose a deterministic tap counter, log ordered gesture lifecycle events, and add a testID for the tappable box.
  • Add missing testIDs for console modal buttons and rename “Simple Gestures” entries to “Basic …” to match the test flow.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
apps/common-app/src/new_api/simple/tap/index.tsx Adds tap counter UI, ordered logging, and testID for E2E automation.
apps/common-app/src/new_api/index.tsx Renames “Simple Gestures” examples to “Basic …” for discoverability/E2E selection.
apps/common-app/src/console/ConsoleModal.tsx Adds testIDs needed for console interactions in the E2E flow.
.github/workflows/ios-e2e.yml New CI workflow to build iOS simulator app and run Argent tap flow.
.github/workflows/android-e2e.yml New CI workflow to build Android app, boot emulator, and run Argent tap flow.
.argent/flows/simple-tap-test.yaml Defines the Argent flow steps/assertions for the “Basic Tap” E2E test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/common-app/src/new_api/simple/tap/index.tsx
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 64c248a9-66d2-482a-b9a8-c6e00972a2dd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Basic Tap and Basic Long Press examples now display interaction counts.
    • Gesture lifecycle events provide clearer interaction feedback.
    • Long-press interactions animate back to their intermediate state after release.
    • Simple gesture examples now use clearer “Basic” labels.
    • Console controls support more reliable interaction.
  • Testing

    • Added automated Android and iOS coverage for tap and long-press behavior.
    • Continuous integration now runs and reports mobile end-to-end test results.

Walkthrough

The PR adds Argent flows for tap and long-press examples, instruments gesture callbacks and counts, adds a tool-server action, and introduces reusable Android and iOS E2E workflows with caller integration.

Changes

Gesture example instrumentation

Layer / File(s) Summary
Gesture counts, callback logs, and test identifiers
apps/common-app/src/common.tsx, apps/common-app/src/new_api/simple/*, apps/common-app/src/console/ConsoleModal.tsx
Tap and long-press examples display activation counts, log lifecycle callbacks, schedule React Native updates with scheduleOnRN, and expose test identifiers. Shared indexed logging and console controls support the flows.
Example labels
apps/common-app/src/new_api/index.tsx
Simple Gesture labels now use the Basic prefix.

Argent server and platform workflows

Layer / File(s) Summary
Argent tool-server action
.github/actions/argent-server/action.yml
The composite action installs Argent, starts the tool-server, configures logging, checks readiness, and reports failures.
Reusable Android and iOS E2E workflows
.github/workflows/android-e2e.yml, .github/workflows/ios-e2e.yml
The workflows provision emulators or simulators, install application artifacts, start Argent, run flows, and print diagnostics on failure.

Workflow integration and flows

Layer / File(s) Summary
Gesture interaction flows
.argent/flows/simple-tap-test.yaml, .argent/flows/simple-long-press-test.yaml
The flows navigate to the examples, clear console output, verify counts, validate callback order, and check tap and long-press behavior.
Android and iOS workflow wiring
.github/workflows/android.yml, .github/workflows/ios.yml
Pull-request filters include Argent changes. Android and iOS E2E jobs consume built Expo artifacts and invoke the reusable workflows. iOS shares Xcode version configuration between build and E2E jobs.

Sequence Diagram(s)

sequenceDiagram
  participant Workflow
  participant EmulatorOrSimulator
  participant ArgentServer
  participant ArgentFlow
  participant GestureExample
  Workflow->>EmulatorOrSimulator: install Expo artifact
  Workflow->>ArgentServer: start and await readiness
  ArgentFlow->>EmulatorOrSimulator: open gesture example
  ArgentFlow->>GestureExample: perform tap or long press
  GestureExample->>ArgentFlow: expose count and callback logs
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: adding basic Argent end-to-end tests and related CI coverage.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@j-piasecki
j-piasecki force-pushed the @jpiasecki/tap-e2e branch 6 times, most recently from b0f6c76 to b417151 Compare August 7, 2026 13:22
Add `android-e2e.yml` and `ios-e2e.yml`: reusable workflows that boot an
emulator / simulator, install the app built by the build workflow and run the
Argent flows against it. `android.yml` and `ios.yml` run them after the build.

Installing and starting the Argent tool-server is shared by both platforms, so
it lives in a composite action. The server is started in the foreground and
polled for readiness — `--detach` SIGKILLs the whole process group after a hard
15s timeout, which a cold CI runner (first run downloads the simulator-server
binary) does not meet.
@j-piasecki j-piasecki changed the title Tap e2e test [CI] Add basic Argent end-to-end tests Aug 10, 2026
@j-piasecki
j-piasecki marked this pull request as ready for review August 10, 2026 11:00

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (10)
apps/common-app/src/common.tsx (1)

144-160: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Memoize the returned worklet.

logMessage and logMessageWorklet are recreated on every render. The returned worklet therefore has a new identity each render, so it is re-serialized to the worklet runtime and it invalidates any gesture object that closes over it. Wrap both in useCallback to keep a stable identity.

♻️ Proposed refactor
 export function useIndexedLogger() {
   const messageCounter = useRef(0);
 
-  const logMessage = (message: string) => {
+  const logMessage = useCallback((message: string) => {
     messageCounter.current += 1;
     const indexedMessage = `${messageCounter.current}. ${message}`;
     console.log(indexedMessage);
-  };
+  }, []);
 
-  const logMessageWorklet = (message: string) => {
-    'worklet';
-    // Schedule log on the JS thread so the console interceptor can pick it up
-    scheduleOnRN(logMessage, message);
-  };
-
-  return logMessageWorklet;
+  return useCallback(
+    (message: string) => {
+      'worklet';
+      // Schedule log on the JS thread so the console interceptor can pick it up
+      scheduleOnRN(logMessage, message);
+    },
+    [logMessage]
+  );
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/common-app/src/common.tsx` around lines 144 - 160, Update
useIndexedLogger to wrap both logMessage and logMessageWorklet in useCallback
with appropriate dependencies, preserving the existing counter and scheduling
behavior while keeping the returned worklet identity stable across renders.
.github/workflows/ios-e2e.yml (1)

18-21: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Add an explicit permissions: block.

The e2e job uses the default token permissions. Restrict it to contents: read.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ios-e2e.yml around lines 18 - 21, Add an explicit
permissions block to the e2e job, setting contents access to read only while
preserving the existing runner and timeout configuration.

Source: Linters/SAST tools

.github/workflows/android-e2e.yml (3)

146-147: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the debug log level before merge, or track it.

The comment says to drop simulator-server-log: debug once the workflow is green. Debug logging on every run enlarges the log output permanently. Do you want me to open an issue to track the removal?

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/android-e2e.yml around lines 146 - 147, Remove the
temporary simulator-server-log: debug setting and its associated reminder
comment from the Android E2E workflow before merging.

16-19: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Add an explicit permissions: block.

The e2e job inherits the default token permissions. It only needs to read the repository and download artifacts. Add permissions: contents: read to the job.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/android-e2e.yml around lines 16 - 19, Update the e2e job
configuration to add an explicit permissions block granting only contents: read,
while preserving its existing runner and timeout settings.

Source: Linters/SAST tools


134-139: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

find | head -1 can fail the step under pipefail.

GitHub runs shell: bash steps with -eo pipefail. When head -1 exits after the first line, find can receive SIGPIPE and report a non-zero status, which fails the assignment before the explicit empty check runs. Terminate find deterministically instead.

♻️ Proposed change
-          APK=$(find "$RUNNER_TEMP/apk" -name '*.apk' | head -1)
+          APK=$(find "$RUNNER_TEMP/apk" -name '*.apk' -print -quit)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/android-e2e.yml around lines 134 - 139, Update the APK
discovery assignment in the Android E2E workflow to avoid the `find | head -1`
pipeline under `pipefail`; use a deterministic single-result selection that does
not cause `find` to receive SIGPIPE, while preserving the existing empty-APK
validation and error handling.
.github/workflows/ios.yml (1)

33-45: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Add permissions: {} to the config job.

The job only writes a literal string to $GITHUB_OUTPUT. It needs no token scope at all.

🔒 Proposed change
   config:
     if: github.repository == 'software-mansion/react-native-gesture-handler'
 
+    permissions: {}
     runs-on: ubuntu-latest
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ios.yml around lines 33 - 45, Add an empty permissions
declaration to the config job containing the Pin versions step, granting it no
GitHub token scopes while preserving its existing output behavior.

Source: Linters/SAST tools

.argent/flows/simple-long-press-test.yaml (2)

48-49: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Both flows assert absolute log indices because useIndexedLogger never resets its counter. Clearing the console removes the rendered entries but leaves messageCounter untouched, so the final assertions must count every callback emitted earlier in the flow. One added or removed gesture callback breaks both flows with a misleading failure. Resetting the counter when the console is cleared would let each block assert from index 1.

  • .argent/flows/simple-long-press-test.yaml#L48-L49: after the counter reset lands, change 9. onBegin and 10. onFinalize to 1. onBegin and 2. onFinalize.
  • .argent/flows/simple-tap-test.yaml#L48-L49: apply the same change to the tap flow.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.argent/flows/simple-long-press-test.yaml around lines 48 - 49, Reset
useIndexedLogger’s messageCounter when the console is cleared so subsequent logs
start at index 1. In .argent/flows/simple-long-press-test.yaml lines 48-49 and
.argent/flows/simple-tap-test.yaml lines 48-49, update the final assertions from
9. onBegin/10. onFinalize to 1. onBegin/2. onFinalize.

11-11: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Fixed wait: 1000 steps add 4 seconds and can still be too short.

The TODO records the intent to use wait: idle. Fixed sleeps are the usual source of E2E flakiness on slow runners. Do you want me to open an issue to track the replacement?

Also applies to: 16-16, 30-30, 41-41

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.argent/flows/simple-long-press-test.yaml at line 11, Replace the fixed
1000ms waits in the simple long-press flow with wait: idle at all four
referenced steps, removing the obsolete TODO comments while preserving the
existing action sequence.
.github/actions/argent-server/action.yml (2)

29-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

The comment contradicts the code.

Lines 29-32 state the server runs "In the foreground". Line 48 starts it with nohup ... &, which is the background. The relevant distinction is --detach versus a plain background process, not foreground versus background. Reword the comment.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/actions/argent-server/action.yml around lines 29 - 32, Update the
comment near the server startup command to remove the claim that the process
runs in the foreground. Describe the relevant behavior as using a plain
backgrounded process without Docker’s --detach mode, preserving the explanation
about timeout handling and server output.

21-23: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Pin the Argent CLI version.

npx @swmansion/argent init --yes resolves the latest published package version on each run. A new release can change CLI behavior and break CI without any repository change. Pin an explicit version.

</validation_result>

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/actions/argent-server/action.yml around lines 21 - 23, Pin the
Argent CLI invocation in the “Install Argent” step to an explicit
`@swmansion/argent` package version instead of resolving the latest release, while
preserving the existing init --yes arguments.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.argent/flows/simple-tap-test.yaml:
- Around line 42-44: Update the echo step in the tap test near the long-press
action to describe that the tap count remains at 2, matching the subsequent
assert for “Tap count: 2”; leave the long-press and assertion steps unchanged.

In @.github/workflows/android-e2e.yml:
- Around line 31-32: Disable credential persistence on the actions/checkout@v4
step in both .github/workflows/android-e2e.yml lines 31-32 and
.github/workflows/ios-e2e.yml lines 24-25 by setting persist-credentials to
false under with.

In @.github/workflows/ios-e2e.yml:
- Around line 32-38: Remove the fallback logic in the Xcode selection step
around XCODE_APP. When the requested XCODE_VERSION directory is missing, print
the existing diagnostic information and fail the step immediately with a nonzero
exit status; do not select another installed Xcode or continue the workflow.

In `@apps/common-app/src/new_api/simple/tap/index.tsx`:
- Around line 36-39: Replace the stale count update in onActivate with a
scheduled callback that invokes setCount using a functional increment, so rapid
activations are accumulated correctly. Apply this change in
apps/common-app/src/new_api/simple/tap/index.tsx lines 36-39 and
apps/common-app/src/new_api/simple/longPress/index.tsx lines 41-47.

---

Nitpick comments:
In @.argent/flows/simple-long-press-test.yaml:
- Around line 48-49: Reset useIndexedLogger’s messageCounter when the console is
cleared so subsequent logs start at index 1. In
.argent/flows/simple-long-press-test.yaml lines 48-49 and
.argent/flows/simple-tap-test.yaml lines 48-49, update the final assertions from
9. onBegin/10. onFinalize to 1. onBegin/2. onFinalize.
- Line 11: Replace the fixed 1000ms waits in the simple long-press flow with
wait: idle at all four referenced steps, removing the obsolete TODO comments
while preserving the existing action sequence.

In @.github/actions/argent-server/action.yml:
- Around line 29-32: Update the comment near the server startup command to
remove the claim that the process runs in the foreground. Describe the relevant
behavior as using a plain backgrounded process without Docker’s --detach mode,
preserving the explanation about timeout handling and server output.
- Around line 21-23: Pin the Argent CLI invocation in the “Install Argent” step
to an explicit `@swmansion/argent` package version instead of resolving the latest
release, while preserving the existing init --yes arguments.

In @.github/workflows/android-e2e.yml:
- Around line 146-147: Remove the temporary simulator-server-log: debug setting
and its associated reminder comment from the Android E2E workflow before
merging.
- Around line 16-19: Update the e2e job configuration to add an explicit
permissions block granting only contents: read, while preserving its existing
runner and timeout settings.
- Around line 134-139: Update the APK discovery assignment in the Android E2E
workflow to avoid the `find | head -1` pipeline under `pipefail`; use a
deterministic single-result selection that does not cause `find` to receive
SIGPIPE, while preserving the existing empty-APK validation and error handling.

In @.github/workflows/ios-e2e.yml:
- Around line 18-21: Add an explicit permissions block to the e2e job, setting
contents access to read only while preserving the existing runner and timeout
configuration.

In @.github/workflows/ios.yml:
- Around line 33-45: Add an empty permissions declaration to the config job
containing the Pin versions step, granting it no GitHub token scopes while
preserving its existing output behavior.

In `@apps/common-app/src/common.tsx`:
- Around line 144-160: Update useIndexedLogger to wrap both logMessage and
logMessageWorklet in useCallback with appropriate dependencies, preserving the
existing counter and scheduling behavior while keeping the returned worklet
identity stable across renders.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a360b7af-7694-42a6-9338-8ff0f937c372

📥 Commits

Reviewing files that changed from the base of the PR and between 4e05838 and 4f80277.

📒 Files selected for processing (12)
  • .argent/flows/simple-long-press-test.yaml
  • .argent/flows/simple-tap-test.yaml
  • .github/actions/argent-server/action.yml
  • .github/workflows/android-e2e.yml
  • .github/workflows/android.yml
  • .github/workflows/ios-e2e.yml
  • .github/workflows/ios.yml
  • apps/common-app/src/common.tsx
  • apps/common-app/src/console/ConsoleModal.tsx
  • apps/common-app/src/new_api/index.tsx
  • apps/common-app/src/new_api/simple/longPress/index.tsx
  • apps/common-app/src/new_api/simple/tap/index.tsx

Comment thread .argent/flows/simple-tap-test.yaml Outdated
Comment thread .github/workflows/android-e2e.yml
Comment thread .github/workflows/ios-e2e.yml
Comment thread apps/common-app/src/new_api/simple/tap/index.tsx
@j-piasecki
j-piasecki marked this pull request as draft August 11, 2026 06:40

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ios.yml (1)

33-45: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Remove inherited token permissions from config.

This job only writes a local step output. It does not require GitHub API access. Set permissions: {} on the job to prevent repository defaults from granting unused token permissions.

Proposed fix
   config:
     if: github.repository == 'software-mansion/react-native-gesture-handler'
+    permissions: {}
 
     runs-on: ubuntu-latest
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ios.yml around lines 33 - 45, Add a job-level permissions:
{} setting to the config job, alongside its existing if, runs-on, and outputs
configuration, so the Pin versions step retains local output behavior without
inheriting GitHub token permissions.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.github/workflows/ios.yml:
- Around line 33-45: Add a job-level permissions: {} setting to the config job,
alongside its existing if, runs-on, and outputs configuration, so the Pin
versions step retains local output behavior without inheriting GitHub token
permissions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c87e10e2-ef6e-4cbb-be51-4f248c1fa75d

📥 Commits

Reviewing files that changed from the base of the PR and between 5d0dfbb and d29f378.

📒 Files selected for processing (4)
  • .argent/flows/simple-long-press-test.yaml
  • .argent/flows/simple-tap-test.yaml
  • .github/workflows/ios-e2e.yml
  • .github/workflows/ios.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .argent/flows/simple-tap-test.yaml

@j-piasecki
j-piasecki force-pushed the @jpiasecki/tap-e2e branch 2 times, most recently from 4dc7a32 to 94ed13e Compare August 11, 2026 08:49
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