summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOskar <oskar@mullvad.net>2024-11-05 09:07:25 +0100
committerOskar <oskar@mullvad.net>2024-11-14 16:43:38 +0100
commitd40ddb0ecc2a41b41d1b96af277e8f34994ccaa8 (patch)
tree41d24919aa752f42cc8e44cac2a2268337d4c6d7
parent56d5c5d9bc5064014c1afbecca7e2a67ccb6509e (diff)
downloadmullvadvpn-d40ddb0ecc2a41b41d1b96af277e8f34994ccaa8.tar.xz
mullvadvpn-d40ddb0ecc2a41b41d1b96af277e8f34994ccaa8.zip
Update script and code references to gui-directory
-rwxr-xr-xbuild.sh2
-rw-r--r--building/Dockerfile2
-rwxr-xr-xci/buildserver-build.sh3
-rwxr-xr-xdesktop/packages/mullvad-vpn/scripts/build-proto.sh4
-rwxr-xr-xdesktop/packages/mullvad-vpn/scripts/build-test-executable.sh7
-rw-r--r--desktop/packages/mullvad-vpn/standalone-tests.pkg.json13
-rw-r--r--desktop/packages/mullvad-vpn/standalone-tests.ts2
-rw-r--r--desktop/packages/mullvad-vpn/tasks/assets.js2
-rw-r--r--desktop/packages/mullvad-vpn/tasks/distribution.js6
-rwxr-xr-xprepare-release.sh5
-rw-r--r--test/docs/BUILD_OS_IMAGE.md2
-rw-r--r--test/test-manager/README.md4
-rw-r--r--test/test-manager/src/tests/ui.rs6
13 files changed, 26 insertions, 32 deletions
diff --git a/build.sh b/build.sh
index ea26362103..ffa371f560 100755
--- a/build.sh
+++ b/build.sh
@@ -356,7 +356,7 @@ cargo run --bin relay_list "${CARGO_ARGS[@]}" > build/relays.json
log_header "Installing JavaScript dependencies"
-pushd gui
+pushd desktop/packages/mullvad-vpn
npm ci
log_header "Packing Mullvad VPN $PRODUCT_VERSION artifact(s)"
diff --git a/building/Dockerfile b/building/Dockerfile
index 9df2f063d1..5fd58233c9 100644
--- a/building/Dockerfile
+++ b/building/Dockerfile
@@ -101,7 +101,7 @@ RUN apt-get update -y && \
ENV PATH=/root/.volta/bin:$PATH
# volta seemingly does not have a way to explicitly install the toolchain
# versions from package.json, but `node --version` triggers an install
-COPY gui/package.json .
+COPY desktop/packages/mullvad-vpn/package.json .
RUN curl https://get.volta.sh | bash && node --version && rm package.json
# === Golang ===
diff --git a/ci/buildserver-build.sh b/ci/buildserver-build.sh
index 055e3ad5be..9e63db6a3b 100755
--- a/ci/buildserver-build.sh
+++ b/ci/buildserver-build.sh
@@ -132,7 +132,8 @@ function build {
fi
mv dist/*.{deb,rpm,exe,pkg} "$artifact_dir" || return 1
- (run_in_build_env gui/scripts/build-test-executable.sh "$target" && \
+ (run_in_build_env desktop/packages/mullvad-vpn/scripts/build-test-executable.sh \
+ "$target" && \
mv "dist/app-e2e-tests-$version"* "$artifact_dir") || \
true
}
diff --git a/desktop/packages/mullvad-vpn/scripts/build-proto.sh b/desktop/packages/mullvad-vpn/scripts/build-proto.sh
index 8861eb5730..69023b72ce 100755
--- a/desktop/packages/mullvad-vpn/scripts/build-proto.sh
+++ b/desktop/packages/mullvad-vpn/scripts/build-proto.sh
@@ -8,8 +8,8 @@ cd "$SCRIPT_DIR"
ARCH="$(uname -m)"
PLATFORM="$(uname -s)"
MANAGEMENT_INTERFACE_PROTO_BUILD_DIR=${MANAGEMENT_INTERFACE_PROTO_BUILD_DIR:-}
-NODE_MODULES_DIR="$(cd ../node_modules/.bin && pwd)"
-PROTO_DIR="../../mullvad-management-interface/proto"
+NODE_MODULES_DIR="$(cd ../../../node_modules/.bin && pwd)"
+PROTO_DIR="../../../../mullvad-management-interface/proto"
PROTO_FILENAME="management_interface.proto"
DESTINATION_DIR="../build/src/main/management_interface"
TYPES_DESTINATION_DIR="../src/main/management_interface"
diff --git a/desktop/packages/mullvad-vpn/scripts/build-test-executable.sh b/desktop/packages/mullvad-vpn/scripts/build-test-executable.sh
index dd2758ebc3..9e79adf91b 100755
--- a/desktop/packages/mullvad-vpn/scripts/build-test-executable.sh
+++ b/desktop/packages/mullvad-vpn/scripts/build-test-executable.sh
@@ -15,6 +15,9 @@ ASSETS=(
"build/test/e2e/shared/*.js"
"build/test/e2e/installed/*.js"
"build/test/e2e/installed/**/*.js"
+)
+
+NODE_MODULES=(
"node_modules/.bin/playwright"
"node_modules/playwright"
"node_modules/playwright-core"
@@ -27,7 +30,7 @@ function build_test_executable {
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 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)"
@@ -35,7 +38,7 @@ function build_test_executable {
# pack assets
cp "$node_path" "$node_copy_path"
# shellcheck disable=SC2068
- tar -czf ./build/test/assets.tar.gz ${ASSETS[@]}
+ tar -czf ./build/test/assets.tar.gz ${ASSETS[@]} -C ../../ ${NODE_MODULES[@]}
cp "$node_copy_path" "$temp_executable"
node --experimental-sea-config standalone-tests.sea.json
diff --git a/desktop/packages/mullvad-vpn/standalone-tests.pkg.json b/desktop/packages/mullvad-vpn/standalone-tests.pkg.json
deleted file mode 100644
index 8be6b53d5a..0000000000
--- a/desktop/packages/mullvad-vpn/standalone-tests.pkg.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "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",
- "node_modules/.bin/playwright",
- "node_modules/playwright",
- "node_modules/playwright-core",
- "node_modules/@playwright/test"
- ]
-}
diff --git a/desktop/packages/mullvad-vpn/standalone-tests.ts b/desktop/packages/mullvad-vpn/standalone-tests.ts
index 176711b1d5..ddba27fb6f 100644
--- a/desktop/packages/mullvad-vpn/standalone-tests.ts
+++ b/desktop/packages/mullvad-vpn/standalone-tests.ts
@@ -7,7 +7,7 @@ import path from 'path';
// This file is bundled into a standalone executable able to run e2e tests against an installed
// version of the app. This file is the entrypoint in the executable and extracts the required
-// assets and performs the tests. More info in /gui/README.md.
+// assets and performs the tests. More info in /desktop/packages/mullvad-vpn/README.md.
const tmpDir = path.join(os.tmpdir(), 'mullvad-standalone-tests');
diff --git a/desktop/packages/mullvad-vpn/tasks/assets.js b/desktop/packages/mullvad-vpn/tasks/assets.js
index 8028124180..686b969e70 100644
--- a/desktop/packages/mullvad-vpn/tasks/assets.js
+++ b/desktop/packages/mullvad-vpn/tasks/assets.js
@@ -21,7 +21,7 @@ function copyLocales() {
}
function copyGeoData() {
- return src('../dist-assets/geo/*.gl').pipe(dest('build/assets/geo'));
+ return src('../../../dist-assets/geo/*.gl').pipe(dest('build/assets/geo'));
}
copyStaticAssets.displayName = 'copy-static-assets';
diff --git a/desktop/packages/mullvad-vpn/tasks/distribution.js b/desktop/packages/mullvad-vpn/tasks/distribution.js
index dab7b9d9e7..c99be22fda 100644
--- a/desktop/packages/mullvad-vpn/tasks/distribution.js
+++ b/desktop/packages/mullvad-vpn/tasks/distribution.js
@@ -435,15 +435,15 @@ function packLinux() {
}
function buildAssets(relativePath) {
- return path.join(path.resolve(__dirname, '../../build'), relativePath);
+ return root(path.join('build', relativePath));
}
function distAssets(relativePath) {
- return path.join(path.resolve(__dirname, '../../dist-assets'), relativePath);
+ return root(path.join('dist-assets', relativePath));
}
function root(relativePath) {
- return path.join(path.resolve(__dirname, '../../'), relativePath);
+ return path.join(path.resolve(__dirname, '../../../../'), relativePath);
}
function getWindowsDistSubdir() {
diff --git a/prepare-release.sh b/prepare-release.sh
index 91829b142a..21627daec5 100755
--- a/prepare-release.sh
+++ b/prepare-release.sh
@@ -45,8 +45,9 @@ if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then
exit 1
fi
-if [[ $DESKTOP == "true" && $(grep "CHANGE THIS BEFORE A RELEASE" gui/changes.txt) != "" ]]; then
- echo "It looks like you did not update gui/changes.txt"
+desktop_changes_path=desktop/packages/mullvad-vpn/changes.txt
+if [[ $DESKTOP == "true" && $(grep "CHANGE THIS BEFORE A RELEASE" $desktop_changes_path) != "" ]]; then
+ echo "It looks like you did not update $desktop_changes_path"
exit 1
fi
diff --git a/test/docs/BUILD_OS_IMAGE.md b/test/docs/BUILD_OS_IMAGE.md
index 87e2c88e58..659eb7d55e 100644
--- a/test/docs/BUILD_OS_IMAGE.md
+++ b/test/docs/BUILD_OS_IMAGE.md
@@ -211,7 +211,7 @@ This can be achieved as follows:
## Windows Security
-Windows Defender ocasionally kills the `test-runner` because it believes it to be a trojan. This can be worked around by excluding `E:` and [the folder containing the standalone e2e GUI test executable](../../gui/README.md) following this guide: https://support.microsoft.com/en-us/windows/add-an-exclusion-to-windows-security-811816c0-4dfd-af4a-47e4-c301afe13b26.
+Windows Defender ocasionally kills the `test-runner` because it believes it to be a trojan. This can be worked around by excluding `E:` and [the folder containing the standalone e2e GUI test executable](../../desktop/packages/mullvad-vpn/README.md) following this guide: https://support.microsoft.com/en-us/windows/add-an-exclusion-to-windows-security-811816c0-4dfd-af4a-47e4-c301afe13b26.
## Finishing setup
diff --git a/test/test-manager/README.md b/test/test-manager/README.md
index c35e7c5ba7..3d69a666ae 100644
--- a/test/test-manager/README.md
+++ b/test/test-manager/README.md
@@ -32,8 +32,8 @@ If a new module is created, make sure to add it in
It is possible to write tests for asserting graphical properties in the app, but
this is a slightly more involved process. GUI tests are written in `Typescript`,
-and reside in the `gui/test/e2e` folder in the app repository. Packaging of
-these tests is also done from the `gui/` folder.
+and reside in the `desktop/packages/mullvad-vpn/test/e2e` folder in the app repository.
+Packaging of these tests is also done from the `desktop/packages/mullvad-vpn/` folder.
Assuming that a graphical test `gui-test.spec` has been bundled correctly, it
can be invoked from any Rust function by calling
diff --git a/test/test-manager/src/tests/ui.rs b/test/test-manager/src/tests/ui.rs
index 266624cc68..53c769a7cc 100644
--- a/test/test-manager/src/tests/ui.rs
+++ b/test/test-manager/src/tests/ui.rs
@@ -154,7 +154,8 @@ async fn test_custom_access_methods_gui(
// * SHADOWSOCKS_SERVER_CIPHER
// * SHADOWSOCKS_SERVER_PASSWORD
//
- // See `gui/test/e2e/installed/state-dependent/api-access-methods.spec.ts`
+ // See
+ // `desktop/packages/mullvad-vpn/test/e2e/installed/state-dependent/api-access-methods.spec.ts`
// for details. The setup should be the same as in
// `test_manager::tests::access_methods::test_shadowsocks`.
//
@@ -223,7 +224,8 @@ async fn test_custom_bridge_gui(
// * SHADOWSOCKS_SERVER_CIPHER
// * SHADOWSOCKS_SERVER_PASSWORD
//
- // See `gui/test/e2e/installed/state-dependent/custom-bridge.spec.ts`
+ // See
+ // `desktop/packages/mullvad-vpn/test/e2e/installed/state-dependent/custom-bridge.spec.ts`
// for details. The setup should be the same as in
// `test_manager::tests::access_methods::test_shadowsocks`.