Skip to content

[MOB-9674] new-fix-integration-tests #587

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

Open
wants to merge 42 commits into
base: 2.0.0-alpha/MOB-9673-fix-unit-tests
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e904cde
Setup detox
lposen Oct 17, 2024
b910908
Remove integration testing files and update .npmignore
lposen Oct 17, 2024
f6d0d8b
Add eslint-plugin-detox and configure testing environment for Detox
lposen Oct 17, 2024
040e669
Add E2E testing workflow and remove integration testing workflow
lposen Oct 17, 2024
252c9b4
Rename E2E test workflow to 'Run Detox Tests' and update installation…
lposen Oct 17, 2024
c862ac9
Update E2E test workflow and improve Detox setup
lposen Oct 17, 2024
70d1059
Refactor E2E testing setup: remove integration testing from Code Clim…
lposen Oct 17, 2024
9ca3ba0
Terminate app before launching in E2E tests to ensure a clean state
lposen Oct 17, 2024
17fe26e
Enhance E2E tests: add verbose synchronization launch arguments and u…
lposen Oct 17, 2024
17f49aa
Refactor E2E tests: import detox in starter.test.js and ensure cleanu…
lposen Oct 17, 2024
5367ec6
Enhance CI test commands: update logging level to 'trace' for better …
lposen Oct 17, 2024
afbce36
Remove detox cleanup call after app termination in E2E tests
lposen Oct 17, 2024
1931173
Enhance Detox configuration: update logging levels, add new domain fo…
lposen Oct 17, 2024
c50fb82
Enhance CI workflow: add step to cancel runs from previous PRs and en…
lposen Oct 17, 2024
2ce48c5
WORKED 2 commits ago! Enhance CI workflow: upgrade macOS runner to '…
lposen Oct 17, 2024
40a24a5
Refactor Detox test configuration: comment out verbose logging option…
lposen Oct 17, 2024
ed059c9
Enhance CI workflows: add cancellation for outdated runs in E2E and u…
lposen Oct 17, 2024
a3a8978
Enhance Detox CI configuration: update build and test commands to use…
lposen Oct 17, 2024
c97f38c
Enhance Detox CI configuration: update build commands for iOS and And…
lposen Oct 17, 2024
b6b511d
Add CircleCI configuration for Detox testing and update package.json …
lposen Oct 17, 2024
76382ba
Update CI workflows: disable fail-fast option and adjust Detox test c…
lposen Oct 17, 2024
6d67727
Update E2E test workflow to use Release build for iOS simulator artifact
lposen Oct 17, 2024
44f9e1f
Seeing if reversions will fix failing tests
lposen Oct 17, 2024
45dc7fc
Remove legacy E2E test workflow and add new Android-specific workflow…
lposen Oct 17, 2024
5ae0af6
Remove free disk space step from CI workflow
lposen Oct 17, 2024
9d2add1
Update Yarn install commands to use --immutable flag for consistency
lposen Oct 17, 2024
429e5b3
Update CI workflow to use Ubuntu for Android E2E tests and add KVM setup
lposen Oct 17, 2024
a47972a
Rename E2E workflow file to e2e-android.yml and update job name for c…
lposen Oct 17, 2024
a579f89
Add Detox script to package.json for example project testing
lposen Oct 17, 2024
713693d
Add detox installation step and enable AVD force creation in E2E work…
lposen Oct 17, 2024
c57526f
Remove Detox build caching step and add new Detox scripts for Android…
lposen Oct 17, 2024
62350ae
Update E2E workflow to enable CI environment and refine Detox test co…
lposen Oct 17, 2024
4e0fc5a
Update E2E workflow to downgrade action versions and improve script f…
lposen Oct 18, 2024
4bae81f
Refine Detox test script in E2E workflow by removing unnecessary options
lposen Oct 18, 2024
f88bffa
Update Detox test script in E2E workflow to record all videos and scr…
lposen Oct 18, 2024
9ab7b86
Remove E2E workflow for Android
lposen Oct 18, 2024
d9082c4
Add E2E workflow for iOS and Android with Detox test integration
lposen Oct 18, 2024
590568b
Add E2E workflow for Android with Detox test integration
lposen Oct 18, 2024
43b1f67
Enhance Android E2E workflow with new emulator configuration and scri…
lposen Oct 18, 2024
d397ee6
Update Detox configuration and E2E test settings for improved stability
lposen Oct 18, 2024
e853ec6
Add conditional execution for device name retrieval in Android E2E wo…
lposen Oct 18, 2024
e7b2b23
Enhance Android E2E workflow with Test Butler integration and configu…
lposen Oct 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# # Tests should be moved here in the future.
# version: 2.1

# references:
# machine_config: &machine_config
# machine:
# image: default

# defaults: &defaults
# resource_class: large
# working_directory: ~/react-native-sdk
# docker:
# - image: cimg/node:20.10

# orbs:
# node: circleci/[email protected]
# android: circleci/[email protected]
# rn: react-native-community/[email protected]
# ruby: circleci/[email protected]

# jobs:
# install:
# <<: *defaults
# steps:
# - checkout
# workflows:
# build:
# jobs:
# - install

version: 2.1

orbs:
node: circleci/[email protected]

references:
machine_config: &machine_config
machine:
image: default

defaults: &defaults
resource_class: large
working_directory: ~/react-native-sdk
docker:
- image: cimg/node:20.10

executors:
detox-executor:
macos:
xcode: "14.3.1" # Use the appropriate Xcode version for your project
working_directory: ~/react-native-sdk

jobs:
detox:
<<: *defaults
executor: detox-executor
steps:
- checkout

- run:
name: Install Node.js
command: |
node -v
npm -v

- run:
name: Install Yarn
command: |
npm install -g yarn
yarn -v

- run:
name: Install Detox CLI
command: |
npm install -g detox-cli

- run:
name: Install Project Dependencies
command: |
yarn install

- run:
name: Install Example Dependencies
command: |
cd example
yarn install
cd ..

- run:
name: Install iOS Dependencies
command: |
cd example/ios
pod install
cd ../..

- run:
name: Build the App for Detox
command: |
cd example
detox build --configuration ios.sim.release
cd ..

- run:
name: Run Detox Tests
command: |
cd example
detox test --configuration ios.sim.release
cd ..

workflows:
detox-tests:
jobs:
- detox
1 change: 0 additions & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ version: "2"
exclude_patterns:
- ".*/"
- "docs/"
- "integration-testing/"
- "**/node_modules/"
- "scripts/"
- "**/__mocks__/"
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ runs:

- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --immutable --frozen-lockfile
run: yarn install --immutable
shell: bash
257 changes: 257 additions & 0 deletions .github/workflows/corrected-e2d.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
# name: E2E Tests
# on: [pull_request]

# jobs:
# find-test-files:
# name: Find Detox test files
# runs-on: macos-latest
# outputs:
# test-files: ${{ steps.set-test-files.outputs.test-files }}
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4

# - name: Find test files
# id: set-test-files
# run: |
# TEST_FILES=$(find example/e2e -name '*.test.js' | sed 's|example/e2e/||g' | jq -R -s -c 'split("\n")[:-1]')
# echo "test-files=$TEST_FILES" >> $GITHUB_OUTPUT

# build-ios:
# name: iOS - Build app for Detox tests
# runs-on: macos-latest

# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# fetch-depth: 1

# - name: Setup
# uses: ./.github/actions/setup
# with:
# setup-config: ios

# - name: Setup Ruby (bundle)
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: 2.6.10
# bundler-cache: true

# - name: Install ios-deploy, detox, react-native-cli
# run: npm install -g ios-deploy detox-cli react-native-cli

# - name: Install Applesimutils
# run: |
# brew tap wix/brew
# brew install applesimutils

# - name: Example App Yarn install
# run: |
# cd example
# yarn install --frozen-lockfile
# cd ..

# - uses: actions/cache@v4
# id: cache
# with:
# path: |
# example/ios/Pods
# ~/Library/Caches/CocoaPods
# ~/.cocoapods
# key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock') }}
# restore-keys: |
# ${{ runner.os }}-pods-

# - name: Pod install
# run: |
# cd example/ios
# pod install
# cd ../..

# - name: Build Detox
# run: yarn example detox:ios:build

# - name: Upload iOS app
# uses: actions/upload-artifact@v4
# with:
# name: ios-app-artifact
# path: example/ios/build/Build/Products/Debug-iphonesimulator/ReactNativeSdkExample.app
# retention-days: 1

# build-android:
# name: Android - Build app for Detox tests
# runs-on: ubuntu-latest

# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# fetch-depth: 1

# - name: Free Disk Space (Ubuntu)
# uses: jlumbroso/free-disk-space@main
# with:
# tool-cache: true
# android: false

# - name: Setup
# uses: ./.github/actions/setup
# with:
# setup-config: android

# - name: Setup Java
# uses: actions/setup-java@v4
# with:
# distribution: zulu
# java-version: 17

# - name: Setup Gradle
# uses: gradle/actions/setup-gradle@v3
# with:
# gradle-version: wrapper
# cache-read-only: false

# - name: Example App Yarn install
# run: |
# cd example
# yarn install
# cd ..

# - name: Build Detox
# run: yarn example detox:android:build

# - name: Upload Android app
# uses: actions/upload-artifact@v4
# with:
# name: android-app-artifact
# path: example/android/app/build/outputs/apk
# retention-days: 1

# run-ios-detox-tests:
# needs: [build-ios, find-test-files]
# name: iOS - Run Detox tests
# runs-on: macos-latest

# strategy:
# fail-fast: false
# matrix:
# test-file: ${{ fromJson(needs.find-test-files.outputs.test-files) }}

# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# fetch-depth: 1

# - name: Download iOS app
# uses: actions/download-artifact@v4
# with:
# name: ios-app-artifact
# path: example/ios/build/Build/Products/Debug-iphonesimulator/ReactNativeSdkExample.app

# - name: Setup
# uses: ./.github/actions/setup
# with:
# setup-config: ios

# - name: Install ios-deploy, detox, react-native-cli
# run: npm install -g ios-deploy detox-cli react-native-cli

# - name: Install Applesimutils
# run: |
# brew tap wix/brew
# brew install applesimutils

# - name: Rebuild Detox
# run: |
# cd example
# yarn detox rebuild-framework-cache
# cd ..

# - name: Start Metro Server
# env:
# ITBL_API_KEY: ${{secrets.ITERABLE_API_KEY}}
# ITBL_ID: ${{secrets.ITBL_ID}}
# run: cd example && yarn detox:start &

# - name: Run Detox tests
# env:
# ITBL_API_KEY: ${{secrets.ITERABLE_API_KEY}}
# ITBL_ID: ${{secrets.ITBL_ID}}
# run: yarn detox:ios:test:ci -- ${{ matrix.test-file }}

# - name: Upload Test Artifact - GitHub Action
# if: failure()
# uses: actions/upload-artifact@v4
# with:
# name: detox-ios-artifacts-${{ matrix.test-file }}
# path: example/artifacts
# retention-days: 1

# run-android-detox-tests:
# needs: [build-android, find-test-files]
# name: Android - Run Detox tests
# runs-on: ubuntu-latest

# strategy:
# fail-fast: false
# matrix:
# test-file: ${{ fromJson(needs.find-test-files.outputs.test-files) }}

# steps:
# - name: Free Disk Space (Ubuntu)
# uses: jlumbroso/free-disk-space@main
# with:
# tool-cache: true
# android: false

# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# fetch-depth: 1

# - name: Download Android app
# uses: actions/download-artifact@v4
# with:
# name: android-app-artifact
# path: example/android/app/build/outputs/apk

# - name: Setup
# uses: ./.github/actions/setup
# with:
# setup-config: android

# - name: Start Metro Server
# env:
# ITBL_API_KEY: ${{secrets.ITERABLE_API_KEY}}
# ITBL_ID: ${{secrets.ITBL_ID}}
# run: yarn detox:start &

# - name: Enable KVM
# 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: Run Detox tests
# uses: reactivecircus/android-emulator-runner@v2
# env:
# ITBL_API_KEY: ${{secrets.ITERABLE_API_KEY}}
# ITBL_ID: ${{secrets.ITBL_ID}}
# with:
# api-level: 31
# arch: x86_64
# avd-name: Pixel_3a_API_34
# force-avd-creation: false
# emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-metrics
# disable-animations: false
# script: yarn detox:android:test:ci -- ${{ matrix.test-file }}

# - name: Upload Test Artifact - GitHub Action
# if: failure()
# uses: actions/upload-artifact@v4
# with:
# name: detox-android-artifacts-${{ matrix.test-file }}
# path: example/artifacts
# retention-days: 1
Loading
Loading