Skip to content

Commit

Permalink
Merge branch 'develop' into issue-13832
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrkhalil authored Sep 3, 2022
2 parents b160f34 + 6fa1729 commit 4f52d28
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ci/Jenkinsfile.android
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.5.2'
library 'status-jenkins-lib@v1.5.3'

/* Options section can't access functions in objects. */
def isPRBuild = utils.isPRBuild()
Expand Down
4 changes: 2 additions & 2 deletions ci/Jenkinsfile.combined
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.5.2'
library 'status-jenkins-lib@v1.5.3'

pipeline {
agent { label 'linux' }
Expand Down Expand Up @@ -50,7 +50,7 @@ pipeline {
apke2e = jenkins.Build('status-mobile/platforms/android-e2e')
} } }
stage('Tests') { steps { script {
ios = jenkins.Build('status-mobile/platforms/tests')
jenkins.Build('status-mobile/platforms/tests')
} } }
}
}
Expand Down
2 changes: 1 addition & 1 deletion ci/Jenkinsfile.ios
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.5.2'
library 'status-jenkins-lib@v1.5.3'

/* Options section can't access functions in objects. */
def isPRBuild = utils.isPRBuild()
Expand Down
2 changes: 1 addition & 1 deletion ci/Jenkinsfile.nix-cache
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.5.2'
library 'status-jenkins-lib@v1.5.3'

pipeline {
agent { label params.AGENT_LABEL }
Expand Down
2 changes: 1 addition & 1 deletion ci/tests/Jenkinsfile.e2e-prs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.5.2'
library 'status-jenkins-lib@v1.5.3'

pipeline {

Expand Down
2 changes: 1 addition & 1 deletion ci/tools/Jenkinsfile.fastlane-clean
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.5.2'
library 'status-jenkins-lib@v1.5.3'

pipeline {
agent { label 'macos' }
Expand Down
2 changes: 1 addition & 1 deletion ci/tools/Jenkinsfile.playstore-meta
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library 'status-jenkins-lib@v1.5.2'
library 'status-jenkins-lib@v1.5.3'

pipeline {
agent { label 'linux' }
Expand Down
4 changes: 2 additions & 2 deletions nix/nix.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ max-jobs = auto
# Helps avoid removing currently used dependencies via garbage collection
keep-derivations = true
keep-outputs = true
# Extra isolation for network and filesystem, doesn't work on MacOS
build-use-sandbox = false
# Some builds on MacOS have issue with sandbox so they are disabled with __noChroot.
sandbox = relaxed
# Enable Nix v2 interface.
experimental-features = nix-command
4 changes: 4 additions & 0 deletions nix/status-go/mobile/build.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ in buildGoPackage {
inherit meta;
inherit (source) src goPackagePath;

# Sandbox causes Xcode issues on MacOS. Requires sandbox=relaxed.
# https://github.com/status-im/status-mobile/pull/13912
__noChroot = (platform == "ios");

extraSrcPaths = [ gomobile ];
nativeBuildInputs = [ gomobile removeReferencesTo ]
++ optional (platform == "android") openjdk
Expand Down
2 changes: 2 additions & 0 deletions src/mocks/js_dependencies.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
:View {}
:RefreshControl {}
:AppState {}
:Alert {:alert (fn [])}
:FlatList {}
:SectionList {}
:Text {}
Expand Down Expand Up @@ -136,6 +137,7 @@
:setDefaultOptions identity
:setRoot identity
:dismissOverlay #(js/Promise.resolve)
:showOverlay identity
:setLazyComponentRegistrator identity
:pop identity
:push identity
Expand Down
29 changes: 29 additions & 0 deletions src/status_im/integration_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[clojure.string :as string]
[re-frame.core :as rf]
status-im.events
[status-im.utils.security :as security]
[status-im.multiaccounts.logout.core :as logout]
[status-im.transport.core :as transport]
status-im.subs ;;so integration tests can run independently
Expand Down Expand Up @@ -174,5 +175,33 @@
(rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not in an inconsistent state between tests
(assert-logout)))))))))

(def multiaccount-name "Narrow Frail Lemming")
(def multiaccount-mnemonic "tattoo ramp health green tongue universe style vapor become tape lava reason")
(def multiaccount-key-uid "0x694b8229524820a3a00a6e211141561d61b251ad99d6b65daf82a73c9a57697b")

(deftest recover-multiaccount-test
(log/info "========= recover-multiaccount-test ==================")
(rf-test/run-test-async
(initialize-app!)
(rf-test/wait-for
[:status-im.init.core/initialize-view]
(rf/dispatch-sync [:init-root :onboarding])
(rf/dispatch-sync [:multiaccounts.recover.ui/recover-multiaccount-button-pressed])
(rf/dispatch-sync [:status-im.multiaccounts.recover.core/enter-phrase-pressed])
(rf/dispatch-sync [:multiaccounts.recover/enter-phrase-input-changed
(security/mask-data multiaccount-mnemonic)])
(rf/dispatch [:multiaccounts.recover/enter-phrase-next-pressed])
(rf-test/wait-for
[:status-im.multiaccounts.recover.core/import-multiaccount-success]
(rf/dispatch-sync [:multiaccounts.recover/re-encrypt-pressed])
(rf/dispatch [:multiaccounts.recover/enter-password-next-pressed password])
(rf-test/wait-for
[:status-im.multiaccounts.recover.core/store-multiaccount-success]
(let [multiaccount @(rf/subscribe [:multiaccount])] ; assert multiaccount is recovered
(is (= multiaccount-key-uid (:key-uid multiaccount)))
(is (= multiaccount-name (:name multiaccount))))
(logout!) (rf-test/wait-for [::logout/logout-method]
(assert-logout)))))))

(comment
(run-tests))
13 changes: 10 additions & 3 deletions src/status_im/utils/test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
settings
config
accounts-data))

:logout (fn []
(.logout native-status))
:generateAliasAndIdenticonAsync (fn [seed callback]
Expand All @@ -60,6 +59,11 @@
(.multiAccountGenerateAndDeriveAddresses
native-status
json)))
:multiAccountImportMnemonic (fn [json callback]
(callback
(.multiAccountImportMnemonic
native-status
json)))
:multiAccountLoadAccount (fn [json callback]
(callback
(.multiAccountLoadAccount
Expand All @@ -75,8 +79,11 @@
(.initKeystore
native-status
(str test-dir "/keystore/" key-uid))))

:identicon (fn [pk]
(.identicon native-status pk))

:validateMnemonic (fn [json callback]
(callback
(.validateMnemonic
native-status
json)))
:startLocalNotifications identity}))

0 comments on commit 4f52d28

Please sign in to comment.