summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2023-02-20 09:55:05 +0100
committerOskar Nyberg <oskar@mullvad.net>2023-02-20 09:55:05 +0100
commit5af2daf6eac19bc567bac3cc0cecd11ed1760e89 (patch)
treeb1694571c78c54a426122fbb5c7c8ee7f294ca1e /gui
parent5d87248c1c052f6f6f338b60ff3ff284dd617bfd (diff)
parentfac93766c97b4600701a4cd2810dc611555436a9 (diff)
downloadmullvadvpn-5af2daf6eac19bc567bac3cc0cecd11ed1760e89.tar.xz
mullvadvpn-5af2daf6eac19bc567bac3cc0cecd11ed1760e89.zip
Merge branch 'automatically-build-test-executable'
Diffstat (limited to 'gui')
-rw-r--r--gui/package.json2
-rwxr-xr-xgui/scripts/build-test-executable.sh39
-rw-r--r--gui/standalone-tests.pkg.json (renamed from gui/test.pkg.json)5
3 files changed, 40 insertions, 6 deletions
diff --git a/gui/package.json b/gui/package.json
index 6ae0282e0f..967dc1b501 100644
--- a/gui/package.json
+++ b/gui/package.json
@@ -90,7 +90,7 @@
"postinstall": "cross-env ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true electron-builder install-app-deps",
"build": "gulp build",
"build-proto": "gulp build-proto",
- "pack-test-executable": "pkg --config test.pkg.json --output ../dist/mullvadvpn-app-e2e-tests build/standalone-tests.js",
+ "pack-test-executable": "pkg --config standalone-tests.pkg.json --output ../dist/mullvadvpn-app-e2e-tests build/standalone-tests.js",
"build-test-executable": "npm run build && npm run pack-test-executable",
"lint": "eslint --ext tsx,ts .",
"format": "prettier \"**/*.{js,css,ts,tsx}\" --write",
diff --git a/gui/scripts/build-test-executable.sh b/gui/scripts/build-test-executable.sh
new file mode 100755
index 0000000000..273e1d4920
--- /dev/null
+++ b/gui/scripts/build-test-executable.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+
+set -eu
+
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+cd "$SCRIPT_DIR/.."
+
+TARGET=${1:-$(rustc -vV | sed -n 's|host: ||p')}
+PRODUCT_VERSION=$(cargo run -q --bin mullvad-version)
+
+function build_test_executable {
+ local pkg_target=$1
+ local suffix=${2:-""}
+ local output="../dist/app-e2e-tests-$PRODUCT_VERSION-$TARGET$suffix"
+
+ npm exec pkg -- \
+ --config standalone-tests.pkg.json \
+ --targets "$pkg_target" \
+ --output "$output" \
+ build/standalone-tests.js
+}
+
+case "$TARGET" in
+ "aarch64-unknown-linux-gnu")
+ build_test_executable linux-arm64
+ ;;
+ "x86_64-unknown-linux-gnu")
+ build_test_executable linux-x64
+ ;;
+ "aarch64-apple-darwin")
+ build_test_executable macos-arm64
+ ;;
+ "x86_64-apple-darwin")
+ build_test_executable macos-x64
+ ;;
+ "x86_64-pc-windows-msvc")
+ build_test_executable win-x64 .exe
+ ;;
+esac
diff --git a/gui/test.pkg.json b/gui/standalone-tests.pkg.json
index 587e05f065..1b91ca8495 100644
--- a/gui/test.pkg.json
+++ b/gui/standalone-tests.pkg.json
@@ -1,9 +1,4 @@
{
- "targets": [
- "linux-x64",
- "macos-x64",
- "win-x64"
- ],
"assets": [
"build/src/config.json",
"build/test/e2e/utils.js",