@@ -12,9 +12,9 @@ function get_test_utls_dir {
12
12
local script_path=" ${BASH_SOURCE[0]} "
13
13
local script_dir
14
14
if [[ -n " $script_path " ]]; then
15
- script_dir=" $( cd " $( dirname " $script_path " ) " > /dev/null && pwd) "
15
+ script_dir=" $( cd " $( dirname " $script_path " ) " > /dev/null && pwd) "
16
16
else
17
- script_dir=" $( cd " $( dirname " $0 " ) " > /dev/null && pwd) "
17
+ script_dir=" $( cd " $( dirname " $0 " ) " > /dev/null && pwd) "
18
18
fi
19
19
echo " $script_dir "
20
20
}
@@ -54,7 +54,7 @@ export CURRENT_VERSION
54
54
export LATEST_STABLE_RELEASE
55
55
56
56
function print_available_releases {
57
- for release in $( jq -r ' .[].tag_name' <<< " $RELEASES" ) ; do
57
+ for release in $( jq -r ' .[].tag_name' <<< " $RELEASES" ) ; do
58
58
echo " $release "
59
59
done
60
60
}
@@ -73,7 +73,7 @@ function get_package_dir {
73
73
exit 1
74
74
fi
75
75
76
- mkdir -p " $package_dir " || exit 1
76
+ mkdir -p " $package_dir " || exit 1
77
77
# Clean up old packages
78
78
find " $package_dir " -type f -mtime +5 -delete || true
79
79
@@ -89,7 +89,7 @@ function nice_time {
89
89
result=$?
90
90
fi
91
91
s=$SECONDS
92
- echo " \" $* \" completed in $(( s/ 60 )) m:$(( s% 60 )) s"
92
+ echo " \" $* \" completed in $(( s / 60 )) m:$(( s % 60 )) s"
93
93
return $result
94
94
}
95
95
# Matches $1 with a build version string and sets the following exported variables:
@@ -122,22 +122,22 @@ function get_app_filename {
122
122
version=" ${BUILD_VERSION}${COMMIT_HASH}${TAG:- } "
123
123
fi
124
124
case $os in
125
- debian* | ubuntu* )
126
- echo " MullvadVPN-${version} _amd64.deb"
127
- ;;
128
- fedora* )
129
- echo " MullvadVPN-${version} _x86_64.rpm"
130
- ;;
131
- windows* )
132
- echo " MullvadVPN-${version} .exe"
133
- ;;
134
- macos* )
135
- echo " MullvadVPN-${version} .pkg"
136
- ;;
137
- * )
138
- echo " Unsupported target: $os " 1>&2
139
- return 1
140
- ;;
125
+ debian* | ubuntu* )
126
+ echo " MullvadVPN-${version} _amd64.deb"
127
+ ;;
128
+ fedora* )
129
+ echo " MullvadVPN-${version} _x86_64.rpm"
130
+ ;;
131
+ windows* )
132
+ echo " MullvadVPN-${version} .exe"
133
+ ;;
134
+ macos* )
135
+ echo " MullvadVPN-${version} .pkg"
136
+ ;;
137
+ * )
138
+ echo " Unsupported target: $os " 1>&2
139
+ return 1
140
+ ;;
141
141
esac
142
142
}
143
143
@@ -177,19 +177,19 @@ function get_e2e_filename {
177
177
version=" ${BUILD_VERSION}${COMMIT_HASH} "
178
178
fi
179
179
case $os in
180
- debian* | ubuntu* | fedora* )
181
- echo " app-e2e-tests-${version} -x86_64-unknown-linux-gnu"
182
- ;;
183
- windows* )
184
- echo " app-e2e-tests-${version} -x86_64-pc-windows-msvc.exe"
185
- ;;
186
- macos* )
187
- echo " app-e2e-tests-${version} -aarch64-apple-darwin"
188
- ;;
189
- * )
190
- echo " Unsupported target: $os " 1>&2
191
- return 1
192
- ;;
180
+ debian* | ubuntu* | fedora* )
181
+ echo " app-e2e-tests-${version} -x86_64-unknown-linux-gnu"
182
+ ;;
183
+ windows* )
184
+ echo " app-e2e-tests-${version} -x86_64-pc-windows-msvc.exe"
185
+ ;;
186
+ macos* )
187
+ echo " app-e2e-tests-${version} -aarch64-apple-darwin"
188
+ ;;
189
+ * )
190
+ echo " Unsupported target: $os " 1>&2
191
+ return 1
192
+ ;;
193
193
esac
194
194
}
195
195
@@ -282,38 +282,38 @@ function run_tests_for_os {
282
282
test_dir=$( get_test_utls_dir) /..
283
283
read -ra test_filters_arg <<< " ${TEST_FILTERS:-}" # Split the string by words into an array
284
284
pushd " $test_dir "
285
- if [ -n " ${TEST_DIST_DIR+x} " ]; then
286
- if [ ! -x " ${TEST_DIST_DIR%/ } /test-manager" ]; then
287
- executable_not_found_in_dist_error test-manager
288
- fi
289
- test_manager=" ${TEST_DIST_DIR%/ } /test-manager"
290
- runner_dir_flag=(" --runner-dir" " $TEST_DIST_DIR " )
291
- else
292
- test_manager=" cargo run --bin test-manager"
293
- runner_dir_flag=()
285
+ if [ -n " ${TEST_DIST_DIR+x} " ]; then
286
+ if [ ! -x " ${TEST_DIST_DIR%/ } /test-manager" ]; then
287
+ executable_not_found_in_dist_error test-manager
294
288
fi
289
+ test_manager=" ${TEST_DIST_DIR%/ } /test-manager"
290
+ runner_dir_flag=(" --runner-dir" " $TEST_DIST_DIR " )
291
+ else
292
+ test_manager=" cargo run --bin test-manager"
293
+ runner_dir_flag=()
294
+ fi
295
295
296
- if [ -n " ${MULLVAD_HOST+x} " ]; then
297
- mullvad_host_arg=(" --mullvad-host" " $MULLVAD_HOST " )
298
- else
299
- mullvad_host_arg=()
300
- fi
296
+ if [ -n " ${MULLVAD_HOST+x} " ]; then
297
+ mullvad_host_arg=(" --mullvad-host" " $MULLVAD_HOST " )
298
+ else
299
+ mullvad_host_arg=()
300
+ fi
301
301
302
- if ! RUST_LOG_STYLE=always $test_manager run-tests \
303
- --account " ${ACCOUNT_TOKEN:? Error: ACCOUNT_TOKEN not set} " \
304
- --app-package " ${APP_PACKAGE:? Error: APP_PACKAGE not set} " \
305
- " ${upgrade_package_arg[@]} " \
306
- " ${test_report_arg[@]} " \
307
- --package-dir " ${package_dir} " \
308
- --vm " $vm " \
309
- --openvpn-certificate " ${OPENVPN_CERTIFICATE:- " assets/openvpn.ca.crt" } " \
310
- " ${mullvad_host_arg[@]} " \
311
- " ${test_filters_arg[@]} " \
312
- " ${runner_dir_flag[@]} " \
313
- 2>&1 | sed -r " s/${ACCOUNT_TOKEN} /\{ACCOUNT_TOKEN\}/g" ; then
314
- echo " Test run failed"
315
- exit 1
316
- fi
302
+ if ! RUST_LOG_STYLE=always $test_manager run-tests \
303
+ --account " ${ACCOUNT_TOKEN:? Error: ACCOUNT_TOKEN not set} " \
304
+ --app-package " ${APP_PACKAGE:? Error: APP_PACKAGE not set} " \
305
+ " ${upgrade_package_arg[@]} " \
306
+ " ${test_report_arg[@]} " \
307
+ --package-dir " ${package_dir} " \
308
+ --vm " $vm " \
309
+ --openvpn-certificate " ${OPENVPN_CERTIFICATE:- " assets/openvpn.ca.crt" } " \
310
+ " ${mullvad_host_arg[@]} " \
311
+ " ${test_filters_arg[@]} " \
312
+ " ${runner_dir_flag[@]} " \
313
+ 2>&1 | sed -r " s/${ACCOUNT_TOKEN} /\{ACCOUNT_TOKEN\}/g" ; then
314
+ echo " Test run failed"
315
+ exit 1
316
+ fi
317
317
popd
318
318
}
319
319
@@ -335,10 +335,10 @@ function build_current_version {
335
335
336
336
if [ ! -f " $app_package " ]; then
337
337
pushd " $app_dir "
338
- if [[ $( git diff --quiet) ]]; then
339
- echo " WARNING: the app repository contains uncommitted changes, this script will only rebuild the app package when the git hash changes"
340
- fi
341
- ./build.sh
338
+ if [[ $( git diff --quiet) ]]; then
339
+ echo " WARNING: the app repository contains uncommitted changes, this script will only rebuild the app package when the git hash changes"
340
+ fi
341
+ ./build.sh
342
342
popd
343
343
echo " Moving '$( realpath " $app_dir /dist/$app_filename " ) ' to '$( realpath " $app_package " ) '"
344
344
mv -n " $app_dir " /dist/" $app_filename " " $app_package "
@@ -348,7 +348,7 @@ function build_current_version {
348
348
349
349
if [ ! -f " $gui_test_bin " ]; then
350
350
pushd " $app_dir " /gui
351
- npm run build-test-executable
351
+ npm run build-test-executable
352
352
popd
353
353
echo " Moving '$( realpath " $app_dir /dist/$gui_test_filename " ) ' to '$( realpath " $gui_test_bin " ) '"
354
354
mv -n " $app_dir " /dist/" $gui_test_filename " " $gui_test_bin "
0 commit comments