Skip to content

Commit 20031a9

Browse files
committed
Added detox tests for ios.
1 parent 5bd9e84 commit 20031a9

File tree

69 files changed

+8044
-728
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+8044
-728
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Ensures certain packages work on simulators
2+
name: Test Simulators
3+
4+
on:
5+
push:
6+
7+
jobs:
8+
test:
9+
name: Test Simulators
10+
runs-on: macOS-15
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
persist-credentials: false
16+
17+
- name: CocoaPods Cache
18+
uses: actions/cache@v3
19+
id: cocoapods-cache
20+
with:
21+
path: |
22+
tools/powersynctests/ios/Pods/*
23+
key: ${{ runner.os }}-${{ hashFiles('tools/powersynctests/ios/Podfile.lock') }}
24+
25+
- name: Setup NodeJS
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version-file: '.nvmrc'
29+
30+
- uses: pnpm/action-setup@v2
31+
name: Install pnpm
32+
with:
33+
version: 9
34+
run_install: false
35+
36+
- name: Get pnpm store directory
37+
shell: bash
38+
run: |
39+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
40+
41+
- uses: actions/cache@v3
42+
name: Setup pnpm cache
43+
with:
44+
path: ${{ env.STORE_PATH }}
45+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
46+
restore-keys: |
47+
${{ runner.os }}-pnpm-store-
48+
49+
- name: Install dependencies
50+
run: pnpm install
51+
52+
- name: Build
53+
run: pnpm build:packages
54+
55+
- name: Install Detox dependencies
56+
run: |
57+
brew tap wix/brew
58+
brew install applesimutils
59+
npm install -g detox-cli
60+
detox clean-framework-cache && detox build-framework-cache
61+
62+
- name: Install CocoaPods dependencies
63+
working-directory: tools/powersynctests/ios
64+
run: pod install
65+
66+
- name: iOS Simulator Build
67+
working-directory: ./tools/powersynctests
68+
run: pnpx detox build --configuration ios.sim.release
69+
70+
- name: iOS Simulator Test
71+
working-directory: ./tools/powersynctests
72+
run: pnpx detox test --configuration ios.sim.release --cleanup

pnpm-lock.yaml

Lines changed: 2541 additions & 728 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

tools/powersynctests/.detoxrc.js

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/** @type {Detox.DetoxConfig} */
2+
module.exports = {
3+
testRunner: {
4+
args: {
5+
$0: 'jest',
6+
config: 'e2e/jest.config.js',
7+
},
8+
jest: {
9+
setupTimeout: 120000,
10+
},
11+
},
12+
apps: {
13+
'ios.debug': {
14+
type: 'ios.app',
15+
binaryPath:
16+
'ios/build/Build/Products/Debug-iphonesimulator/powersynctests.app',
17+
build:
18+
'xcodebuild -workspace ios/powersynctests.xcworkspace -scheme powersynctests -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build',
19+
},
20+
'ios.release': {
21+
type: 'ios.app',
22+
binaryPath:
23+
'ios/build/Build/Products/Release-iphonesimulator/powersynctests.app',
24+
build:
25+
'xcodebuild -workspace ios/powersynctests.xcworkspace -scheme powersynctests -configuration Release -sdk iphonesimulator -derivedDataPath ios/build',
26+
},
27+
'android.debug': {
28+
type: 'android.apk',
29+
binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk',
30+
build:
31+
'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug',
32+
reversePorts: [8081],
33+
},
34+
'android.release': {
35+
type: 'android.apk',
36+
binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',
37+
build:
38+
'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release',
39+
},
40+
},
41+
devices: {
42+
simulator: {
43+
type: 'ios.simulator',
44+
device: {
45+
type: 'iPhone 16',
46+
},
47+
},
48+
attached: {
49+
type: 'android.attached',
50+
device: {
51+
adbName: '.*',
52+
},
53+
},
54+
emulator: {
55+
type: 'android.emulator',
56+
device: {
57+
avdName: 'Pixel_3a_API_30_x86',
58+
},
59+
},
60+
},
61+
configurations: {
62+
'ios.sim.debug': {
63+
device: 'simulator',
64+
app: 'ios.debug',
65+
},
66+
'ios.sim.release': {
67+
device: 'simulator',
68+
app: 'ios.release',
69+
},
70+
'android.att.debug': {
71+
device: 'attached',
72+
app: 'android.debug',
73+
},
74+
'android.att.release': {
75+
device: 'attached',
76+
app: 'android.release',
77+
},
78+
'android.emu.debug': {
79+
device: 'emulator',
80+
app: 'android.debug',
81+
},
82+
'android.emu.release': {
83+
device: 'emulator',
84+
app: 'android.release',
85+
},
86+
},
87+
};

tools/powersynctests/.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native',
4+
};

tools/powersynctests/.gitignore

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
**/.xcode.env.local
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
*.hprof
33+
.cxx/
34+
*.keystore
35+
!debug.keystore
36+
.kotlin/
37+
38+
# node.js
39+
#
40+
node_modules/
41+
npm-debug.log
42+
yarn-error.log
43+
44+
# fastlane
45+
#
46+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47+
# screenshots whenever they are needed.
48+
# For more information about the recommended setup visit:
49+
# https://docs.fastlane.tools/best-practices/source-control/
50+
51+
**/fastlane/report.xml
52+
**/fastlane/Preview.html
53+
**/fastlane/screenshots
54+
**/fastlane/test_output
55+
56+
# Bundle artifact
57+
*.jsbundle
58+
59+
# Ruby / CocoaPods
60+
**/Pods/
61+
/vendor/bundle/
62+
63+
# Temporary files created by Metro to check the health of the file watcher
64+
.metro-health-check*
65+
66+
# testing
67+
/coverage
68+
69+
# Yarn
70+
.yarn/*
71+
!.yarn/patches
72+
!.yarn/plugins
73+
!.yarn/releases
74+
!.yarn/sdks
75+
!.yarn/versions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: false,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

tools/powersynctests/Gemfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby ">= 2.6.10"
5+
6+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9+
gem 'xcodeproj', '< 1.26.0'
10+
gem 'concurrent-ruby', '< 1.3.4'

tools/powersynctests/Gemfile.lock

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.7)
5+
base64
6+
nkf
7+
rexml
8+
activesupport (6.1.7.10)
9+
concurrent-ruby (~> 1.0, >= 1.0.2)
10+
i18n (>= 1.6, < 2)
11+
minitest (>= 5.1)
12+
tzinfo (~> 2.0)
13+
zeitwerk (~> 2.3)
14+
addressable (2.8.7)
15+
public_suffix (>= 2.0.2, < 7.0)
16+
algoliasearch (1.27.5)
17+
httpclient (~> 2.8, >= 2.8.3)
18+
json (>= 1.5.1)
19+
atomos (0.1.3)
20+
base64 (0.2.0)
21+
claide (1.1.0)
22+
cocoapods (1.15.2)
23+
addressable (~> 2.8)
24+
claide (>= 1.0.2, < 2.0)
25+
cocoapods-core (= 1.15.2)
26+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
27+
cocoapods-downloader (>= 2.1, < 3.0)
28+
cocoapods-plugins (>= 1.0.0, < 2.0)
29+
cocoapods-search (>= 1.0.0, < 2.0)
30+
cocoapods-trunk (>= 1.6.0, < 2.0)
31+
cocoapods-try (>= 1.1.0, < 2.0)
32+
colored2 (~> 3.1)
33+
escape (~> 0.0.4)
34+
fourflusher (>= 2.3.0, < 3.0)
35+
gh_inspector (~> 1.0)
36+
molinillo (~> 0.8.0)
37+
nap (~> 1.0)
38+
ruby-macho (>= 2.3.0, < 3.0)
39+
xcodeproj (>= 1.23.0, < 2.0)
40+
cocoapods-core (1.15.2)
41+
activesupport (>= 5.0, < 8)
42+
addressable (~> 2.8)
43+
algoliasearch (~> 1.0)
44+
concurrent-ruby (~> 1.1)
45+
fuzzy_match (~> 2.0.4)
46+
nap (~> 1.0)
47+
netrc (~> 0.11)
48+
public_suffix (~> 4.0)
49+
typhoeus (~> 1.0)
50+
cocoapods-deintegrate (1.0.5)
51+
cocoapods-downloader (2.1)
52+
cocoapods-plugins (1.0.0)
53+
nap
54+
cocoapods-search (1.0.1)
55+
cocoapods-trunk (1.6.0)
56+
nap (>= 0.8, < 2.0)
57+
netrc (~> 0.11)
58+
cocoapods-try (1.2.0)
59+
colored2 (3.1.2)
60+
concurrent-ruby (1.3.3)
61+
escape (0.0.4)
62+
ethon (0.16.0)
63+
ffi (>= 1.15.0)
64+
ffi (1.17.1)
65+
fourflusher (2.3.1)
66+
fuzzy_match (2.0.4)
67+
gh_inspector (1.1.3)
68+
httpclient (2.9.0)
69+
mutex_m
70+
i18n (1.14.7)
71+
concurrent-ruby (~> 1.0)
72+
json (2.7.6)
73+
minitest (5.25.4)
74+
molinillo (0.8.0)
75+
mutex_m (0.3.0)
76+
nanaimo (0.3.0)
77+
nap (1.1.0)
78+
netrc (0.11.0)
79+
nkf (0.2.0)
80+
public_suffix (4.0.7)
81+
rexml (3.4.1)
82+
ruby-macho (2.5.1)
83+
typhoeus (1.4.1)
84+
ethon (>= 0.9.0)
85+
tzinfo (2.0.6)
86+
concurrent-ruby (~> 1.0)
87+
xcodeproj (1.25.1)
88+
CFPropertyList (>= 2.3.3, < 4.0)
89+
atomos (~> 0.1.3)
90+
claide (>= 1.0.2, < 2.0)
91+
colored2 (~> 3.1)
92+
nanaimo (~> 0.3.0)
93+
rexml (>= 3.3.6, < 4.0)
94+
zeitwerk (2.6.18)
95+
96+
PLATFORMS
97+
ruby
98+
99+
DEPENDENCIES
100+
activesupport (>= 6.1.7.5, != 7.1.0)
101+
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
102+
concurrent-ruby (< 1.3.4)
103+
xcodeproj (< 1.26.0)
104+
105+
RUBY VERSION
106+
ruby 2.6.10p210
107+
108+
BUNDLED WITH
109+
1.17.2

0 commit comments

Comments
 (0)