-
-
Notifications
You must be signed in to change notification settings - Fork 766
test: mobile e2e instance + emulator/simulator device suite #3029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
YousefED
wants to merge
4
commits into
mobile/focus-api
Choose a base branch
from
mobile/test-infra
base: mobile/focus-api
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1f433f5
chore: blank the cache token in .env.sample
YousefED 0e4deed
test: run the mobile e2e suites on an emulated-android browser instance
YousefED 796e884
test(device): a local emulator/simulator suite behind one session int…
YousefED eaa37d0
ci: run the device suite on the emulator and simulator as normal CI
YousefED File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| export NX_SELF_HOSTED_REMOTE_CACHE_SERVER=https://cache.nickthesick.com | ||
| export NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN=g8@ucL8em4*Z9TKXDY9OEX@!upf^Nz9 | ||
| export NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| name: Emulator tests | ||
|
|
||
| # The OS-emulator layer of the device suite (tests/device/): real Chrome and | ||
| # real Gboard on an Android emulator, and real iOS Safari on a simulator via | ||
| # Appium/XCUITest — driving flows no browser emulation can, including pressing | ||
| # the on-screen keyboard's IME action key. Free minutes, no credentials, so it | ||
| # runs as normal CI. See tests/device/README.md. | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: emulator-tests-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | ||
|
|
||
| jobs: | ||
| android-emulator: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 45 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: voidzero-dev/setup-vp@313600b80b104eadebb9111787d37a2e83e014ca # v1.17.0 | ||
| with: | ||
| node-version-file: ".node-version" | ||
| cache: true | ||
|
|
||
| - name: Install dependencies | ||
| run: vp install | ||
|
|
||
| - name: Enable KVM group perms | ||
| run: | | ||
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
| sudo udevadm control --reload-rules | ||
| sudo udevadm trigger --name-match=kvm | ||
|
|
||
| - name: Start playground dev server | ||
| run: | | ||
| vp run dev & | ||
| for _ in $(seq 1 120); do | ||
| if curl -sf http://127.0.0.1:5173/ > /dev/null; then exit 0; fi | ||
| sleep 2 | ||
| done | ||
| echo "playground dev server never came up" >&2 | ||
| exit 1 | ||
|
|
||
| - name: Run device suite on the emulator | ||
| uses: reactivecircus/android-emulator-runner@a421e43855164a8197daf9d8d40fe71c6996bb0d # v2.38.0 | ||
| with: | ||
| api-level: 35 | ||
| arch: x86_64 | ||
| target: google_apis | ||
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -no-audio -no-boot-anim | ||
| disable-animations: true | ||
| script: DEVICE_FILTER=local-android vp run test:device | ||
|
|
||
| - name: Upload screenshots | ||
| if: always() | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | ||
| with: | ||
| name: emulator-test-screenshots | ||
| path: tests/device/.artifacts/ | ||
| if-no-files-found: ignore | ||
|
|
||
| ios-simulator: | ||
| runs-on: macos-15 | ||
| timeout-minutes: 45 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: voidzero-dev/setup-vp@313600b80b104eadebb9111787d37a2e83e014ca # v1.17.0 | ||
| with: | ||
| node-version-file: ".node-version" | ||
| cache: true | ||
|
|
||
| - name: Install dependencies | ||
| run: vp install | ||
|
|
||
| - name: Start playground dev server | ||
| run: | | ||
| vp run dev & | ||
| for _ in $(seq 1 120); do | ||
| if curl -sf http://127.0.0.1:5173/ > /dev/null; then exit 0; fi | ||
| sleep 2 | ||
| done | ||
| echo "playground dev server never came up" >&2 | ||
| exit 1 | ||
|
|
||
| # A cold xcrun on a fresh runner can take long enough to trip the | ||
| # suite's availability probe; the first invocation pays the | ||
| # initialization cost here, visibly. | ||
| - name: Warm the simulator toolchain | ||
| run: xcrun simctl list devices available | ||
|
|
||
| - name: Run device suite on the simulator | ||
| run: DEVICE_FILTER=local-ios vp run test:device | ||
|
|
||
| - name: Upload screenshots | ||
| if: always() | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | ||
| with: | ||
| name: simulator-test-screenshots | ||
| path: tests/device/.artifacts/ | ||
| if-no-files-found: ignore | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait so this runs on an "actual" android & ios. This is asking for reproducibility issues in the future between CI and local dev. I'm not sure that I like this direction.