-
Notifications
You must be signed in to change notification settings - Fork 50
feat: Detox simulator test runner #590
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
20031a9
Added detox tests for ios.
Chriztiaan a0ba3b0
Merge branch 'main' into op-sqlite-tests
Chriztiaan 9047ac1
Fixing Android test suite. Prepping for Github workflow.
Chriztiaan 021746b
Testing Android emulator.
Chriztiaan decad66
Fixing detox setup.
Chriztiaan 25354f5
typo
Chriztiaan 5a1a8fd
Added tests pnpm android working directory
Chriztiaan 01c0967
Specifying avd name to workflow avd name.
Chriztiaan 41705fe
Slightly more lenient test timeout.
Chriztiaan 063a59f
Cleanup readme, removed prettier config. Applying prettier formatting…
Chriztiaan ae54fd4
Updated readme.
Chriztiaan 0377d5f
Merged simulator/emulator tests into single workflow file.
Chriztiaan ceae348
Rejecting pending read/write operations when the database is closed f…
Chriztiaan fb97273
Merge branch 'main' into op-sqlite-tests
Chriztiaan d58eecf
Fixed typo in workflow.
Chriztiaan fd87b12
Typos.
Chriztiaan 979d0a4
Added comlink to include list to stabilize web tests.
Chriztiaan a56e8c0
Revert lock file.
Chriztiaan e86c48d
Fewer executions in writeLock test.
Chriztiaan e70b962
Caching derived data for iOS build.
Chriztiaan a3ea29b
Make closing OPSQlite adapter async
stevensJourney b98a193
Add `await` to close test. Test CI command optimisation.
stevensJourney 1924c86
Switching to new gradle action. Added changeset for close change.
Chriztiaan b7f80f5
Merge branch 'op-sqlite-tests' of github.com:powersync-ja/powersync-j…
Chriztiaan 6e70eb7
Merge branch 'main' into op-sqlite-tests
Chriztiaan a028764
Referring to runner tool's Derived data location.
Chriztiaan 50ba5e9
Different DerivedData location.
Chriztiaan 4ca417c
Merge branch 'main' into op-sqlite-tests
Chriztiaan b79b970
Only running sim/emu tests if there are changes made to common or pow…
Chriztiaan 5fecdd3
Added `await db.init()` call.
Chriztiaan 2852194
Trying to cache derived data for iOS again.
Chriztiaan 35ec382
Merge branch 'main' into op-sqlite-tests
Chriztiaan be0069d
Longer waiting indicator timeout for tests to finish.
Chriztiaan c38064c
Merge branch 'op-sqlite-tests' of github.com:powersync-ja/powersync-j…
Chriztiaan 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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Ensures certain packages work on simulators | ||
name: Test Simulators | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
test: | ||
name: Test Simulators | ||
runs-on: macOS-15 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: CocoaPods Cache | ||
uses: actions/cache@v3 | ||
id: cocoapods-cache | ||
with: | ||
path: | | ||
tools/powersynctests/ios/Pods/* | ||
key: ${{ runner.os }}-${{ hashFiles('tools/powersynctests/ios/Podfile.lock') }} | ||
|
||
- name: Setup NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
|
||
- uses: pnpm/action-setup@v2 | ||
name: Install pnpm | ||
with: | ||
version: 9 | ||
run_install: false | ||
|
||
- name: Get pnpm store directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
|
||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build | ||
run: pnpm build:packages | ||
|
||
- name: Install Detox dependencies | ||
run: | | ||
brew tap wix/brew | ||
brew install applesimutils | ||
npm install -g detox-cli | ||
detox clean-framework-cache && detox build-framework-cache | ||
|
||
- name: Install CocoaPods dependencies | ||
working-directory: tools/powersynctests/ios | ||
run: pod install | ||
|
||
- name: iOS Simulator Build | ||
working-directory: ./tools/powersynctests | ||
run: pnpx detox build --configuration ios.sim.release | ||
|
||
- name: iOS Simulator Test | ||
working-directory: ./tools/powersynctests | ||
run: pnpx detox test --configuration ios.sim.release --cleanup |
Large diffs are not rendered by default.
Oops, something went wrong.
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,2 @@ | ||
BUNDLE_PATH: "vendor/bundle" | ||
BUNDLE_FORCE_RUBY_PLATFORM: 1 |
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,87 @@ | ||
/** @type {Detox.DetoxConfig} */ | ||
module.exports = { | ||
testRunner: { | ||
args: { | ||
$0: 'jest', | ||
config: 'e2e/jest.config.js', | ||
}, | ||
jest: { | ||
setupTimeout: 120000, | ||
}, | ||
}, | ||
apps: { | ||
'ios.debug': { | ||
type: 'ios.app', | ||
binaryPath: | ||
'ios/build/Build/Products/Debug-iphonesimulator/powersynctests.app', | ||
build: | ||
'xcodebuild -workspace ios/powersynctests.xcworkspace -scheme powersynctests -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build', | ||
}, | ||
'ios.release': { | ||
type: 'ios.app', | ||
binaryPath: | ||
'ios/build/Build/Products/Release-iphonesimulator/powersynctests.app', | ||
build: | ||
'xcodebuild -workspace ios/powersynctests.xcworkspace -scheme powersynctests -configuration Release -sdk iphonesimulator -derivedDataPath ios/build', | ||
}, | ||
'android.debug': { | ||
type: 'android.apk', | ||
binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk', | ||
build: | ||
'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug', | ||
reversePorts: [8081], | ||
}, | ||
'android.release': { | ||
type: 'android.apk', | ||
binaryPath: 'android/app/build/outputs/apk/release/app-release.apk', | ||
build: | ||
'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release', | ||
}, | ||
}, | ||
devices: { | ||
simulator: { | ||
type: 'ios.simulator', | ||
device: { | ||
type: 'iPhone 16', | ||
}, | ||
}, | ||
attached: { | ||
type: 'android.attached', | ||
device: { | ||
adbName: '.*', | ||
}, | ||
}, | ||
emulator: { | ||
type: 'android.emulator', | ||
device: { | ||
avdName: 'Pixel_3a_API_30_x86', | ||
}, | ||
}, | ||
}, | ||
configurations: { | ||
'ios.sim.debug': { | ||
device: 'simulator', | ||
app: 'ios.debug', | ||
}, | ||
'ios.sim.release': { | ||
device: 'simulator', | ||
app: 'ios.release', | ||
}, | ||
'android.att.debug': { | ||
device: 'attached', | ||
app: 'android.debug', | ||
}, | ||
'android.att.release': { | ||
device: 'attached', | ||
app: 'android.release', | ||
}, | ||
'android.emu.debug': { | ||
device: 'emulator', | ||
app: 'android.debug', | ||
}, | ||
'android.emu.release': { | ||
device: 'emulator', | ||
app: 'android.release', | ||
}, | ||
}, | ||
}; |
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,4 @@ | ||
module.exports = { | ||
root: true, | ||
extends: '@react-native', | ||
}; |
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,75 @@ | ||
# OSX | ||
# | ||
.DS_Store | ||
|
||
# Xcode | ||
# | ||
build/ | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata | ||
*.xccheckout | ||
*.moved-aside | ||
DerivedData | ||
*.hmap | ||
*.ipa | ||
*.xcuserstate | ||
**/.xcode.env.local | ||
|
||
# Android/IntelliJ | ||
# | ||
build/ | ||
.idea | ||
.gradle | ||
local.properties | ||
*.iml | ||
*.hprof | ||
.cxx/ | ||
*.keystore | ||
!debug.keystore | ||
.kotlin/ | ||
|
||
# node.js | ||
# | ||
node_modules/ | ||
npm-debug.log | ||
yarn-error.log | ||
|
||
# fastlane | ||
# | ||
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the | ||
# screenshots whenever they are needed. | ||
# For more information about the recommended setup visit: | ||
# https://docs.fastlane.tools/best-practices/source-control/ | ||
|
||
**/fastlane/report.xml | ||
**/fastlane/Preview.html | ||
**/fastlane/screenshots | ||
**/fastlane/test_output | ||
|
||
# Bundle artifact | ||
*.jsbundle | ||
|
||
# Ruby / CocoaPods | ||
**/Pods/ | ||
/vendor/bundle/ | ||
|
||
# Temporary files created by Metro to check the health of the file watcher | ||
.metro-health-check* | ||
|
||
# testing | ||
/coverage | ||
|
||
# Yarn | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions |
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,7 @@ | ||
module.exports = { | ||
arrowParens: 'avoid', | ||
bracketSameLine: true, | ||
bracketSpacing: false, | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
}; |
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 @@ | ||
{} |
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,10 @@ | ||
source 'https://rubygems.org' | ||
|
||
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version | ||
ruby ">= 2.6.10" | ||
|
||
# Exclude problematic versions of cocoapods and activesupport that causes build failures. | ||
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' | ||
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' | ||
gem 'xcodeproj', '< 1.26.0' | ||
gem 'concurrent-ruby', '< 1.3.4' |
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,109 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
CFPropertyList (3.0.7) | ||
base64 | ||
nkf | ||
rexml | ||
activesupport (6.1.7.10) | ||
concurrent-ruby (~> 1.0, >= 1.0.2) | ||
i18n (>= 1.6, < 2) | ||
minitest (>= 5.1) | ||
tzinfo (~> 2.0) | ||
zeitwerk (~> 2.3) | ||
addressable (2.8.7) | ||
public_suffix (>= 2.0.2, < 7.0) | ||
algoliasearch (1.27.5) | ||
httpclient (~> 2.8, >= 2.8.3) | ||
json (>= 1.5.1) | ||
atomos (0.1.3) | ||
base64 (0.2.0) | ||
claide (1.1.0) | ||
cocoapods (1.15.2) | ||
addressable (~> 2.8) | ||
claide (>= 1.0.2, < 2.0) | ||
cocoapods-core (= 1.15.2) | ||
cocoapods-deintegrate (>= 1.0.3, < 2.0) | ||
cocoapods-downloader (>= 2.1, < 3.0) | ||
cocoapods-plugins (>= 1.0.0, < 2.0) | ||
cocoapods-search (>= 1.0.0, < 2.0) | ||
cocoapods-trunk (>= 1.6.0, < 2.0) | ||
cocoapods-try (>= 1.1.0, < 2.0) | ||
colored2 (~> 3.1) | ||
escape (~> 0.0.4) | ||
fourflusher (>= 2.3.0, < 3.0) | ||
gh_inspector (~> 1.0) | ||
molinillo (~> 0.8.0) | ||
nap (~> 1.0) | ||
ruby-macho (>= 2.3.0, < 3.0) | ||
xcodeproj (>= 1.23.0, < 2.0) | ||
cocoapods-core (1.15.2) | ||
activesupport (>= 5.0, < 8) | ||
addressable (~> 2.8) | ||
algoliasearch (~> 1.0) | ||
concurrent-ruby (~> 1.1) | ||
fuzzy_match (~> 2.0.4) | ||
nap (~> 1.0) | ||
netrc (~> 0.11) | ||
public_suffix (~> 4.0) | ||
typhoeus (~> 1.0) | ||
cocoapods-deintegrate (1.0.5) | ||
cocoapods-downloader (2.1) | ||
cocoapods-plugins (1.0.0) | ||
nap | ||
cocoapods-search (1.0.1) | ||
cocoapods-trunk (1.6.0) | ||
nap (>= 0.8, < 2.0) | ||
netrc (~> 0.11) | ||
cocoapods-try (1.2.0) | ||
colored2 (3.1.2) | ||
concurrent-ruby (1.3.3) | ||
escape (0.0.4) | ||
ethon (0.16.0) | ||
ffi (>= 1.15.0) | ||
ffi (1.17.1) | ||
fourflusher (2.3.1) | ||
fuzzy_match (2.0.4) | ||
gh_inspector (1.1.3) | ||
httpclient (2.9.0) | ||
mutex_m | ||
i18n (1.14.7) | ||
concurrent-ruby (~> 1.0) | ||
json (2.7.6) | ||
minitest (5.25.4) | ||
molinillo (0.8.0) | ||
mutex_m (0.3.0) | ||
nanaimo (0.3.0) | ||
nap (1.1.0) | ||
netrc (0.11.0) | ||
nkf (0.2.0) | ||
public_suffix (4.0.7) | ||
rexml (3.4.1) | ||
ruby-macho (2.5.1) | ||
typhoeus (1.4.1) | ||
ethon (>= 0.9.0) | ||
tzinfo (2.0.6) | ||
concurrent-ruby (~> 1.0) | ||
xcodeproj (1.25.1) | ||
CFPropertyList (>= 2.3.3, < 4.0) | ||
atomos (~> 0.1.3) | ||
claide (>= 1.0.2, < 2.0) | ||
colored2 (~> 3.1) | ||
nanaimo (~> 0.3.0) | ||
rexml (>= 3.3.6, < 4.0) | ||
zeitwerk (2.6.18) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
activesupport (>= 6.1.7.5, != 7.1.0) | ||
cocoapods (>= 1.13, != 1.15.1, != 1.15.0) | ||
concurrent-ruby (< 1.3.4) | ||
xcodeproj (< 1.26.0) | ||
|
||
RUBY VERSION | ||
ruby 2.6.10p210 | ||
|
||
BUNDLED WITH | ||
1.17.2 |
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.
Uh oh!
There was an error while loading. Please reload this page.