Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 50ac154

Browse files
authoredMar 27, 2024··
Merge branch 'develop' into 19188
2 parents f04cf2e + 7de1f95 commit 50ac154

19 files changed

+100
-108
lines changed
 

‎Makefile

+13-13
Original file line numberDiff line numberDiff line change
@@ -375,25 +375,25 @@ test-contract: export SHADOW_NS_REGEXP := ^tests\.contract-test.*$$
375375
test-contract: ##@test Run contract tests
376376
test-contract: _test-clojure
377377

378-
android-test: jsbundle
379-
android-test: export TARGET := android
380-
android-test:
378+
test-android: jsbundle
379+
test-android: export TARGET := android
380+
test-android: ##@test Android Gradle test
381381
cd android && ./gradlew test
382382

383-
component-test-watch: export TARGET := clojure
384-
component-test-watch: export COMPONENT_TEST := true
385-
component-test-watch: export BABEL_ENV := test
386-
component-test-watch: export JEST_USE_SILENT_REPORTER := false
387-
component-test-watch: ##@ Watch tests and re-run no changes to cljs files
383+
test-component-watch: export TARGET := clojure
384+
test-component-watch: export COMPONENT_TEST := true
385+
test-component-watch: export BABEL_ENV := test
386+
test-component-watch: export JEST_USE_SILENT_REPORTER := false
387+
test-component-watch: ##@ Watch tests and re-run no changes to cljs files
388388
@scripts/check-metro-shadow-process.sh
389389
rm -rf ./component-spec
390390
nodemon --exec 'yarn shadow-cljs compile component-test && jest --config=test/jest/jest.config.js --testEnvironment node ' -e cljs
391391

392-
component-test: export TARGET := clojure
393-
component-test: export COMPONENT_TEST := true
394-
component-test: export BABEL_ENV := test
395-
component-test: export JEST_USE_SILENT_REPORTER := false
396-
component-test: ##@test Run component tests once in NodeJS
392+
test-component: export TARGET := clojure
393+
test-component: export COMPONENT_TEST := true
394+
test-component: export BABEL_ENV := test
395+
test-component: export JEST_USE_SILENT_REPORTER := false
396+
test-component: ##@test Run component tests once in NodeJS
397397
@scripts/check-metro-shadow-process.sh
398398
rm -rf ./component-spec
399399
yarn shadow-cljs compile component-test && \

‎ci/Jenkinsfile.android

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library 'status-jenkins-lib@v1.8.7'
2+
library 'status-jenkins-lib@v1.8.11'
33

44
/* Options section can't access functions in objects. */
55
def isPRBuild = utils.isPRBuild()
@@ -34,10 +34,10 @@ pipeline {
3434
}
3535

3636
environment {
37-
LANG = "en_US.UTF-8"
38-
LC_ALL = "en_US.UTF-8"
39-
LANGUAGE = "en_US.UTF-8"
40-
TARGET = "android${utils.isE2EBuild() ? "-e2e" : ""}"
37+
LANG = 'en_US.UTF-8'
38+
LC_ALL = 'en_US.UTF-8'
39+
LANGUAGE = 'en_US.UTF-8'
40+
PLATFORM = "android${utils.isE2EBuild() ? "-e2e" : ""}"
4141
BUILD_ENV = 'prod'
4242
NIX_CONF_DIR = "${env.WORKSPACE}/nix"
4343
FASTLANE_DISABLE_COLORS = 1

‎ci/Jenkinsfile.combined

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library 'status-jenkins-lib@v1.8.7'
2+
library 'status-jenkins-lib@v1.8.11'
33

44
pipeline {
55
agent { label 'linux' }

‎ci/Jenkinsfile.e2e-nightly

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library 'status-jenkins-lib@v1.8.7'
2+
library 'status-jenkins-lib@v1.8.11'
33

44
pipeline {
55
agent { label 'linux' }

‎ci/Jenkinsfile.ios

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library 'status-jenkins-lib@v1.8.7'
2+
library 'status-jenkins-lib@v1.8.11'
33

44
/* Options section can't access functions in objects. */
55
def isPRBuild = utils.isPRBuild()
@@ -34,10 +34,10 @@ pipeline {
3434
}
3535

3636
environment {
37-
LANG = "en_US.UTF-8"
38-
LC_ALL = "en_US.UTF-8"
39-
LANGUAGE = "en_US.UTF-8"
40-
TARGET = 'ios'
37+
LANG = 'en_US.UTF-8'
38+
LC_ALL = 'en_US.UTF-8'
39+
LANGUAGE = 'en_US.UTF-8'
40+
PLATFORM = 'ios'
4141
NIX_CONF_DIR = "${env.WORKSPACE}/nix"
4242
FASTLANE_DISABLE_COLORS = 1
4343
BUNDLE_PATH = "${HOME}/.bundle"

‎ci/Jenkinsfile.tests

+34-41
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library 'status-jenkins-lib@v1.8.7'
2+
library 'status-jenkins-lib@v1.8.11'
33

44
/* Options section can't access functions in objects. */
55
def isPRBuild = utils.isPRBuild()
@@ -29,61 +29,47 @@ pipeline {
2929
description: 'Specify build type. Values: pr / e2e / nightly / release',
3030
defaultValue: 'pr',
3131
)
32+
booleanParam(
33+
name: 'RUN_CONTRACT_TESTS',
34+
description: 'Whether to run optional and slow contract tests.',
35+
defaultValue: false,
36+
)
3237
}
3338

3439
environment {
35-
LANG = "en_US.UTF-8"
36-
LC_ALL = "en_US.UTF-8"
37-
LANGUAGE = "en_US.UTF-8"
38-
TARGET = 'tests'
40+
LANG = 'en_US.UTF-8'
41+
LC_ALL = 'en_US.UTF-8'
42+
LANGUAGE = 'en_US.UTF-8'
43+
PLATFORM = 'tests'
3944
BUILD_ENV = 'prod'
4045
NIX_CONF_DIR = "${env.WORKSPACE}/nix"
4146
LOG_FILE = utils.pkgFilename(ext: 'log', arch: 'tests')
47+
CLJ_LINTER_PRINT_WARNINGS = 'true'
4248
}
4349

4450
stages {
45-
stage('Checks') {
51+
stage('Test') {
4652
parallel {
4753
stage('Lint') {
48-
steps {
49-
sh """#!/bin/bash
50-
set -eo pipefail
51-
make lint CLJ_LINTER_PRINT_WARNINGS=true 2>&1 | tee ${LOG_FILE}
52-
"""
53-
}
54+
steps { make('lint') }
5455
}
55-
stage('Unit Tests') {
56-
steps {
57-
sh """#!/bin/bash
58-
set -eo pipefail
59-
make test-unit 2>&1 | tee -a ${LOG_FILE}
60-
"""
61-
}
56+
stage('Unit') {
57+
steps { make('test-unit') }
58+
}
59+
stage('Component') {
60+
steps { make('test-component') }
6261
}
6362
}
6463
}
65-
stage('Contract Tests') {
66-
steps {
67-
sh """#!/bin/bash
68-
set -eo pipefail
69-
make test-contract 2>&1 | tee -a ${LOG_FILE}
70-
"""
71-
}
72-
}
73-
stage('Integration Tests') {
74-
steps {
75-
sh """#!/bin/bash
76-
set -eo pipefail
77-
make test-integration 2>&1 | tee -a ${LOG_FILE}
78-
"""
79-
}
80-
}
81-
stage('Component Tests') {
82-
steps {
83-
sh """#!/bin/bash
84-
set -eo pipefail
85-
make component-test 2>&1 | tee -a ${LOG_FILE}
86-
"""
64+
stage('Heavy Test') {
65+
parallel {
66+
stage('Contract') {
67+
when { expression { params.RUN_CONTRACT_TESTS } }
68+
steps { make('test-contract') }
69+
}
70+
stage('Integration') {
71+
steps { make('test-integration') }
72+
}
8773
}
8874
}
8975
stage('Upload') {
@@ -100,3 +86,10 @@ pipeline {
10086
always { sh 'make purge' }
10187
}
10288
}
89+
90+
def make(target) {
91+
sh """#!/bin/bash
92+
set -eo pipefail
93+
make ${target} 2>&1 | tee -a ${LOG_FILE}
94+
"""
95+
}

‎ci/tests/Jenkinsfile.e2e-nightly

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library 'status-jenkins-lib@v1.8.7'
2+
library 'status-jenkins-lib@v1.8.11'
33

44
pipeline {
55

‎ci/tests/Jenkinsfile.e2e-prs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library 'status-jenkins-lib@v1.8.7'
2+
library 'status-jenkins-lib@v1.8.11'
33

44
pipeline {
55

‎ci/tests/Jenkinsfile.e2e-upgrade

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library 'status-jenkins-lib@v1.8.7'
2+
library 'status-jenkins-lib@v1.8.11'
33

44
pipeline {
55

‎ci/tools/Jenkinsfile.fastlane-clean

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/usr/bin/env groovy
2-
library 'status-jenkins-lib@v1.8.7'
2+
library 'status-jenkins-lib@v1.8.11'
33

44
pipeline {
55
agent { label 'macos' }
66

77
environment {
8-
LANG = 'en_US.UTF-8'
9-
LANGUAGE = 'en_US.UTF-8'
10-
LC_ALL = 'en_US.UTF-8'
11-
TARGET = 'ios'
8+
LANG = 'en_US.UTF-8'
9+
LANGUAGE = 'en_US.UTF-8'
10+
LC_ALL = 'en_US.UTF-8'
11+
PLATFORM = 'ios'
1212
FASTLANE_DISABLE_COLORS = 1
1313
/* avoid writing to r/o /nix */
1414
GEM_HOME = '~/.rubygems'

‎ci/tools/Jenkinsfile.nix-cache

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library 'status-jenkins-lib@v1.8.7'
2+
library 'status-jenkins-lib@v1.8.11'
33

44
pipeline {
55
agent { label params.AGENT_LABEL }

‎ci/tools/Jenkinsfile.playstore-meta

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/usr/bin/env groovy
2-
library 'status-jenkins-lib@v1.8.7'
2+
library 'status-jenkins-lib@v1.8.11'
33

44
pipeline {
55
agent { label 'linux' }
66

77
environment {
8-
LANG = 'en_US.UTF-8'
9-
LANGUAGE = 'en_US.UTF-8'
10-
LC_ALL = 'en_US.UTF-8'
11-
TARGET = 'ios'
8+
LANG = 'en_US.UTF-8'
9+
LANGUAGE = 'en_US.UTF-8'
10+
LC_ALL = 'en_US.UTF-8'
11+
PLATFORM = 'ios'
1212
FASTLANE_DISABLE_COLORS = 1
1313
/* avoid writing to r/o /nix */
1414
GEM_HOME = '~/.rubygems'

‎ci/tools/Jenkinsfile.xcode-clean

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library 'status-jenkins-lib@v1.8.7'
2+
library 'status-jenkins-lib@v1.8.11'
33

44
pipeline {
55
agent {

‎doc/component-tests-overview.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ Both of these links are showing it for React-Testing-Library (not Native) howeve
1616
## Running the tests
1717
To run these tests there are two methods.
1818

19-
`make component-test`
19+
`make test-component`
2020
setups and runs the test suite once.
2121

22-
`make component-test-watch`
22+
`make test-component-watch`
2323
setups and runs the test suite and watches for code changes will then retrigger the test suite.
2424

2525
## Writing Tests
@@ -38,7 +38,7 @@ There is a file of utility functions defined in "src/test_helpers/component.cljs
3838
## Configuration
3939
Status Mobile has a bespoke tech stack, as such there is more complexities to configuring the tests.
4040

41-
### Shadow-CLJS
41+
### Shadow-CLJS
4242
the configuration for compiling our tests are defined in the "shadow-cljs.edn" file.
4343
The three main parts of this are
4444
`:target :npm-module`
@@ -47,9 +47,9 @@ Needed for the configuration we are using
4747
a vector of entry points for the test files.
4848
and the `ns-regexp` to specify what tests to find. Since we have multiple forms of tests we decided that "component-spec" is the least likely to detect the wrong file type.
4949

50-
It's worth knowing that our tests are compiled to JS and then run in the temporary folder `component-tests`.
50+
It's worth knowing that our tests are compiled to JS and then run in the temporary folder `component-tests`.
5151

5252
### Jest
5353
There is also further configuration for Jest in "test/jest". There is a jest config file which has some mostly standard configuration pieces, where the tests live, what environment variables are set etc. This is documented by Jest here: https://jestjs.io/docs/configuration
5454

55-
There is also a setup file which is used to set some global and default values. Additionally this file is used to mock some of the react native (among other) dependencies
55+
There is also a setup file which is used to set some global and default values. Additionally this file is used to mock some of the react native (among other) dependencies.

‎doc/testing.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ Here I'm showing a terminal-only experience using Tmux (left pane Emacs, right p
5454
To run tests:
5555

5656
```
57-
make component-test
57+
make test-component
5858
```
5959

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

6262
```
63-
make component-test-watch
63+
make test-component-watch
6464
```
6565

6666
Check [component tests doc](./component-tests-overview.md) for more.

‎src/quo/components/gradient/gradient_cover/view.cljs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
;; the `:or` destructuring won't work because it's only applied when the
1313
;; `:customization-color` key is non-existent. While deleting an account the key exists
1414
;; and has a `nil` value.
15-
(when customization-color
16-
(let [color-top (colors/resolve-color customization-color 50 20)
17-
color-bottom (colors/resolve-color customization-color 50 0)]
15+
(let [color-top (colors/resolve-color customization-color 50 20)
16+
color-bottom (colors/resolve-color customization-color 50 0)]
17+
(when (and color-top color-bottom)
1818
[linear-gradient/linear-gradient
1919
{:accessibility-label :gradient-cover
2020
:colors [color-top color-bottom]

‎src/quo/components/wallet/account_overview/view.cljs

+12-15
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@
100100
:or {customization-color :blue}}]
101101
(let [time-frame-string (time-string time-frame time-frame-string)
102102
up? (= metrics :positive)]
103-
[rn/view
104-
{:style style/account-overview-wrapper}
103+
[rn/view {:style style/account-overview-wrapper}
105104
(if (= :loading state)
106105
[loading-state (colors/theme-colors colors/neutral-5 colors/neutral-90 theme)]
107106
[rn/view
@@ -113,19 +112,17 @@
113112
:size :heading-1
114113
:style style/current-value}
115114
current-value]
116-
[rn/view
117-
{:style style/row-centered}
118-
[:<>
119-
(when (seq time-frame-string)
120-
[text/text
121-
{:weight :medium
122-
:size :paragraph-2
123-
:style (style/bottom-time-text (and (not= :custom time-frame)
124-
(seq time-frame-to-string)))}
125-
time-frame-string])
126-
(when (and (= :custom time-frame)
127-
(seq time-frame-to-string))
128-
[custom-time-frame time-frame-to-string])]
115+
[rn/view {:style style/row-centered}
116+
(when (seq time-frame-string)
117+
[text/text
118+
{:weight :medium
119+
:size :paragraph-2
120+
:style (style/bottom-time-text (and (not= :custom time-frame)
121+
(seq time-frame-to-string)))}
122+
time-frame-string])
123+
(when (and (= :custom time-frame)
124+
(seq time-frame-to-string))
125+
[custom-time-frame time-frame-to-string])
129126
(when (and (seq percentage-change)
130127
(seq currency-change))
131128
[numeric-changes percentage-change currency-change customization-color theme up?])]])]))

‎src/status_im/contexts/shell/qr_reader/view.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
(load-and-show-profile scanned-text)
8989

9090
(eth-address? scanned-text)
91-
(debounce/debounce-and-dispatch [:navigate-to :wallet-accounts scanned-text] 300)
91+
(debounce/debounce-and-dispatch [:navigate-to :screen/wallet.accounts scanned-text] 300)
9292

9393
(eip681-address? scanned-text)
9494
(do

‎src/status_im/contexts/wallet/share_address/view.cljs

+3-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@
8383
:on-press #(rf/dispatch [:navigate-back])
8484
:background :blur
8585
:right-side [{:icon-name :i/scan
86-
:on-press #(js/alert "To be implemented")}]
86+
:on-press (fn []
87+
(rf/dispatch [:navigate-back])
88+
(rf/dispatch [:open-modal :shell-qr-reader]))}]
8789
:accessibility-label :top-bar}]
8890
[quo/page-top
8991
{:title title

0 commit comments

Comments
 (0)
Please sign in to comment.