Skip to content

Commit

Permalink
Merge branch 'develop' into 17947
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrkhalil authored Jan 8, 2024
2 parents a97fdaa + b4d27d2 commit 7ee5ea9
Show file tree
Hide file tree
Showing 415 changed files with 2,854 additions and 1,867 deletions.
50 changes: 34 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -335,26 +335,44 @@ shadow-server: export TARGET := clojure
shadow-server:##@ Start shadow-cljs in server mode for watching
yarn shadow-cljs server

test-watch: export TARGET := clojure
test-watch: ##@ Watch tests and re-run no changes to cljs files
yarn install
nodemon --exec 'yarn shadow-cljs compile mocks && yarn shadow-cljs compile test && node --require ./test-resources/override.js target/test/test.js' -e cljs
_test-clojure: export TARGET := clojure
_test-clojure: export WATCH ?= false
_test-clojure:
ifeq ($(WATCH), true)
yarn install && \
yarn shadow-cljs compile mocks && \
nodemon --exec "yarn shadow-cljs compile test && node --require ./test-resources/override.js $$SHADOW_OUTPUT_TO" -e cljs
else
yarn install && \
yarn shadow-cljs compile mocks && \
yarn shadow-cljs compile test && \
node --require ./test-resources/override.js "$$SHADOW_OUTPUT_TO"
endif

test-watch-for-repl: export TARGET := clojure
test-watch-for-repl: ##@ Watch tests and support REPL connections
yarn install
rm -f target/test/test.js
concurrently --kill-others --prefix-colors 'auto' --names 'build,repl' \
'yarn shadow-cljs compile mocks && yarn shadow-cljs watch test --verbose' \
'until [ -f ./target/test/test.js ] ; do sleep 1 ; done ; node --require ./test-resources/override.js ./target/test/test.js --repl'
test: export SHADOW_OUTPUT_TO := target/test/test.js
test: export SHADOW_NS_REGEXP := .*-test$$
test: ##@test Run all Clojure tests
test: _test-clojure

test: export TARGET := clojure
test: ##@test Run tests once in NodeJS
# Here we create the gyp bindings for nodejs
test-watch-for-repl: export SHADOW_OUTPUT_TO := target/test/test.js
test-watch-for-repl: export SHADOW_NS_REGEXP := .*-test$$
test-watch-for-repl: ##@test Watch all Clojure tests and support REPL connections
yarn install
rm -f target/test/test.js
yarn shadow-cljs compile mocks && \
yarn shadow-cljs compile test && \
node --require ./test-resources/override.js target/test/test.js
concurrently --kill-others --prefix-colors 'auto' --names 'build,repl' \
'yarn shadow-cljs watch test --verbose' \
"until [ -f $$SHADOW_OUTPUT_TO ] ; do sleep 1 ; done ; node --require ./test-resources/override.js $$SHADOW_OUTPUT_TO --repl"

test-unit: export SHADOW_OUTPUT_TO := target/unit_test/test.js
test-unit: export SHADOW_NS_REGEXP := ^(?!status-im\.integration-test).*-test$$
test-unit: ##@test Run unit tests
test-unit: _test-clojure

test-integration: export SHADOW_OUTPUT_TO := target/integration_test/test.js
test-integration: export SHADOW_NS_REGEXP := ^status-im\.integration-test.*$$
test-integration: ##@test Run integration tests
test-integration: _test-clojure

android-test: jsbundle
android-test: export TARGET := android
Expand Down
2 changes: 1 addition & 1 deletion ci/Jenkinsfile.ios
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ library 'status-jenkins-lib@v1.8.4'
def isPRBuild = utils.isPRBuild()

pipeline {
agent { label 'macos && arm64 && nix-2.14 && xcode-14.3' }
agent { label 'macos && arm64 && nix-2.14 && xcode-15.1' }

parameters {
string(
Expand Down
12 changes: 10 additions & 2 deletions ci/Jenkinsfile.tests
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,24 @@ pipeline {
"""
}
}
stage('Tests') {
stage('Unit Tests') {
steps {
sh """#!/bin/bash
set -eo pipefail
make test 2>&1 | tee -a ${LOG_FILE}
make test-unit 2>&1 | tee -a ${LOG_FILE}
"""
}
}
}
}
stage('Integration Tests') {
steps {
sh """#!/bin/bash
set -eo pipefail
make test-integration 2>&1 | tee -a ${LOG_FILE}
"""
}
}
stage('Component Tests') {
steps {
sh """#!/bin/bash
Expand Down
6 changes: 3 additions & 3 deletions doc/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
To run tests:

```
make test
make test
```



Also test watcher can be launched. It will re-run the entire test suite when any file is modified

```
make test-watch
make test WATCH=true
```

Developers can also manually change the shadow-cljs option `:ns-regex` to control which namespaces the test runner should pick.
Developers can also manually change the shadow-cljs option `:ns-regex` to control which namespaces the test runner should pick.

## Testing with REPL

Expand Down
1 change: 1 addition & 0 deletions modules/react-native-status/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: "org.jetbrains.kotlin.android"

def getStatusGoSHA1 = { ->
def statusgoOverridePath = System.getenv("STATUS_GO_SRC_OVERRIDE")
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package im.status.ethereum.module

import android.view.ActionMode
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
import com.facebook.react.uimanager.NativeViewHierarchyManager
import com.facebook.react.uimanager.UIBlock
import com.facebook.react.uimanager.UIManagerModule
import com.facebook.react.views.textinput.ReactEditText

class RNSelectableTextInputModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {

private var lastActionMode: ActionMode? = null

override fun getName(): String {
return "RNSelectableTextInputManager"
}

@ReactMethod
fun setupMenuItems(selectableTextViewReactTag: Int?, textInputReactTag: Int?) {
val reactContext = reactApplicationContext
val uiManager = reactContext.getNativeModule(UIManagerModule::class.java)
selectableTextViewReactTag?.let { selectableTag ->
textInputReactTag?.let { inputTag ->
uiManager?.addUIBlock(UIBlock { nvhm: NativeViewHierarchyManager ->
val rnSelectableTextManager = nvhm.resolveViewManager(selectableTag) as RNSelectableTextInputViewManager
val reactTextView = nvhm.resolveView(inputTag) as ReactEditText
rnSelectableTextManager.registerSelectionListener(reactTextView)
})
}
}
}

@ReactMethod
fun startActionMode(textInputReactTag: Int?) {
val reactContext = reactApplicationContext
val uiManager = reactContext.getNativeModule(UIManagerModule::class.java)
textInputReactTag?.let { inputTag ->
uiManager?.addUIBlock(UIBlock { nvhm: NativeViewHierarchyManager ->
val reactTextView = nvhm.resolveView(inputTag) as ReactEditText
lastActionMode = reactTextView.startActionMode(reactTextView.customSelectionActionModeCallback, ActionMode.TYPE_FLOATING)
})
}
}

@ReactMethod
fun hideLastActionMode() {
val reactContext = reactApplicationContext
val uiManager = reactContext.getNativeModule(UIManagerModule::class.java)
uiManager?.addUIBlock(UIBlock { _ ->
lastActionMode?.finish()
lastActionMode = null
})
}

@ReactMethod
fun setSelection(textInputReactTag: Int?, start: Int?, end: Int?) {
val reactContext = reactApplicationContext
val uiManager = reactContext.getNativeModule(UIManagerModule::class.java)
textInputReactTag?.let { inputTag ->
start?.let { s ->
end?.let { e ->
uiManager?.addUIBlock(UIBlock { nvhm: NativeViewHierarchyManager ->
val reactTextView = nvhm.resolveView(inputTag) as ReactEditText
reactTextView.setSelection(s, e)
})
}
}
}
}
}

This file was deleted.

Loading

0 comments on commit 7ee5ea9

Please sign in to comment.