diff --git a/build.sh b/build.sh index ea26362103e9..e309cc981c82 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-electron-app/packages/mullvad-vpn npm ci log_header "Packing Mullvad VPN $PRODUCT_VERSION artifact(s)" diff --git a/building/Dockerfile b/building/Dockerfile index 9df2f063d174..6b2f6309374b 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-electron-app/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 055e3ad5bee4..ceeed14721f4 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-electron-app/packages/mullvad-vpn/scripts/build-test-executable.sh \ + "$target" && \ mv "dist/app-e2e-tests-$version"* "$artifact_dir") || \ true } diff --git a/desktop-electron-app/packages/mullvad-vpn/scripts/build-proto.sh b/desktop-electron-app/packages/mullvad-vpn/scripts/build-proto.sh index 8861eb57302d..69023b72ce0e 100755 --- a/desktop-electron-app/packages/mullvad-vpn/scripts/build-proto.sh +++ b/desktop-electron-app/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-electron-app/packages/mullvad-vpn/scripts/build-test-executable.sh b/desktop-electron-app/packages/mullvad-vpn/scripts/build-test-executable.sh index dd2758ebc3b5..9e41c9f18add 100755 --- a/desktop-electron-app/packages/mullvad-vpn/scripts/build-test-executable.sh +++ b/desktop-electron-app/packages/mullvad-vpn/scripts/build-test-executable.sh @@ -15,10 +15,10 @@ ASSETS=( "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" + "../../node_modules/.bin/playwright" + "../../node_modules/playwright" + "../../node_modules/playwright-core" + "../../node_modules/@playwright/test" ) function build_test_executable { @@ -27,7 +27,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)" diff --git a/desktop-electron-app/packages/mullvad-vpn/standalone-tests.ts b/desktop-electron-app/packages/mullvad-vpn/standalone-tests.ts index 176711b1d515..337deb4c65f1 100644 --- a/desktop-electron-app/packages/mullvad-vpn/standalone-tests.ts +++ b/desktop-electron-app/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-electron-app/packages/mullvad-vpn/README.md. const tmpDir = path.join(os.tmpdir(), 'mullvad-standalone-tests'); diff --git a/desktop-electron-app/packages/mullvad-vpn/tasks/assets.js b/desktop-electron-app/packages/mullvad-vpn/tasks/assets.js index 802812418042..686b969e7014 100644 --- a/desktop-electron-app/packages/mullvad-vpn/tasks/assets.js +++ b/desktop-electron-app/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-electron-app/packages/mullvad-vpn/tasks/distribution.js b/desktop-electron-app/packages/mullvad-vpn/tasks/distribution.js index 79e43817e235..81ba0da267b0 100644 --- a/desktop-electron-app/packages/mullvad-vpn/tasks/distribution.js +++ b/desktop-electron-app/packages/mullvad-vpn/tasks/distribution.js @@ -434,15 +434,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 91829b142a98..9d0ffccd7163 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-electron-app/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 87e2c88e58f9..670e00d5b388 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-electron-app/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 c35e7c5ba7d8..ce778081a8c1 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-electron-app/packages/mullvad-vpn/test/e2e` folder in the app repository. +Packaging of these tests is also done from the `desktop-electron-app/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 266624cc68ed..381a919e3944 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-electron-app/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-electron-app/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`.