summaryrefslogtreecommitdiffhomepage
path: root/gui/scripts/build-test-executable.sh
diff options
context:
space:
mode:
authorOskar <oskar@mullvad.net>2024-11-05 07:57:08 +0100
committerOskar <oskar@mullvad.net>2024-11-14 16:43:18 +0100
commit84f14d79c4f0dde73337820ec94ba8ff928a3797 (patch)
treece468658e5ba7b0a74950c7ad1b09b3a4d00520b /gui/scripts/build-test-executable.sh
parente3ce0eb5cd0610dbff6ec98cb8cb388415c74bf6 (diff)
downloadmullvadvpn-84f14d79c4f0dde73337820ec94ba8ff928a3797.tar.xz
mullvadvpn-84f14d79c4f0dde73337820ec94ba8ff928a3797.zip
Move gui directory to desktop/packages/mullvad-vpn
Diffstat (limited to 'gui/scripts/build-test-executable.sh')
-rwxr-xr-xgui/scripts/build-test-executable.sh80
1 files changed, 0 insertions, 80 deletions
diff --git a/gui/scripts/build-test-executable.sh b/gui/scripts/build-test-executable.sh
deleted file mode 100755
index dd2758ebc3..0000000000
--- a/gui/scripts/build-test-executable.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/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)
-
-ASSETS=(
- "build/src/config.json"
- "build/src/renderer/lib/routes.js"
- "build/test/e2e/utils.js"
- "build/test/e2e/shared/*.js"
- "build/test/e2e/installed/*.js"
- "build/test/e2e/installed/**/*.js"
- "node_modules/.bin/playwright"
- "node_modules/playwright"
- "node_modules/playwright-core"
- "node_modules/@playwright/test"
-)
-
-function build_test_executable {
- local pkg_target=$1
- local bin_suffix=${2:-""}
- local temp_dir
- temp_dir="$(mktemp -d)"
- local temp_executable="$temp_dir/temp-test-executable$bin_suffix"
- local output="../dist/app-e2e-tests-$PRODUCT_VERSION-$TARGET$bin_suffix"
- local node_copy_path="$temp_dir/node$bin_suffix"
- local node_path
- node_path="$(volta which node || which node)"
-
- # pack assets
- cp "$node_path" "$node_copy_path"
- # shellcheck disable=SC2068
- tar -czf ./build/test/assets.tar.gz ${ASSETS[@]}
-
- cp "$node_copy_path" "$temp_executable"
- node --experimental-sea-config standalone-tests.sea.json
-
- # Inject SEA blob
- case $pkg_target in
- macos-*)
- codesign --remove-signature "$temp_executable"
- npx postject "$temp_executable" NODE_SEA_BLOB \
- standalone-tests.sea.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \
- --macho-segment-name NODE_SEA
- codesign --sign - "$temp_executable"
- ;;
- *)
- npx postject "$temp_executable" NODE_SEA_BLOB \
- standalone-tests.sea.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
- ;;
- esac
-
- mkdir -p "$(dirname "$output")"
- mv "$temp_executable" "$output"
-
- rm -rf "$temp_dir"
-}
-
-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