diff options
| -rwxr-xr-x | test/scripts/run/ci.sh | 12 | ||||
| -rwxr-xr-x | test/scripts/utils/lib.sh | 16 |
2 files changed, 18 insertions, 10 deletions
diff --git a/test/scripts/run/ci.sh b/test/scripts/run/ci.sh index 67f87f241c..b7e8c218e4 100755 --- a/test/scripts/run/ci.sh +++ b/test/scripts/run/ci.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# This script is invoked by the GitHub workflow file below to launch the desktop end to end test framwork. +# <https://github.com/mullvad/mullvadvpn-app/blob/main/.github/workflows/desktop-e2e.yml> + # TODO: Break this down into multiple, smaller scripts and compose them in this file. set -eu @@ -28,6 +31,15 @@ fi # shellcheck source=test/scripts/utils/lib.sh source "../utils/lib.sh" +# The `CURRENT_VERSION` variable is set by the workflow file which invokes `mullvad-version` +# We need to add a suffix with tag information to get the current version string +TAG=$(git describe --exact-match HEAD 2>/dev/null || echo "") +if [[ -n "$TAG" && ${CURRENT_VERSION} =~ -dev- ]]; then + # Remove disallowed version characters from the tag + CURRENT_VERSION+="+${TAG//[^0-9a-z_-]/}" +fi +export CURRENT_VERSION + echo "**********************************" echo "* Version to upgrade from: $LATEST_STABLE_RELEASE" echo "* Version to test: $CURRENT_VERSION" diff --git a/test/scripts/utils/lib.sh b/test/scripts/utils/lib.sh index 7b52b48d44..2b260966d7 100755 --- a/test/scripts/utils/lib.sh +++ b/test/scripts/utils/lib.sh @@ -26,14 +26,6 @@ LATEST_STABLE_RELEASE=$(jq -r '[.[] | select(.prerelease==false)] | .[0].tag_nam commit=$(git rev-parse HEAD^\{commit\}) commit=${commit:0:6} -TAG=$(git describe --exact-match HEAD 2>/dev/null || echo "") - -if [[ -n "$TAG" && ${CURRENT_VERSION} =~ -dev- ]]; then - # Remove disallowed version characters from the tag - CURRENT_VERSION+="+${TAG//[^0-9a-z_-]/}" -fi - -export CURRENT_VERSION export LATEST_STABLE_RELEASE function print_available_releases { @@ -250,15 +242,19 @@ function run_tests_for_os { function build_current_version { local app_dir app_dir="$REPO_ROOT" + local current_version + pushd "$app_dir" + current_version=$(cargo run --package mullvad-version) + popd local app_filename # TODO: TEST_OS must be set to local OS manually, should be set automatically - app_filename=$(get_app_filename "$CURRENT_VERSION" "${TEST_OS:?Error: TEST_OS not set}") + app_filename=$(get_app_filename "$current_version" "${TEST_OS:?Error: TEST_OS not set}") local package_dir package_dir=$(get_package_dir) local app_package="$package_dir"/"$app_filename" local gui_test_filename - gui_test_filename=$(get_e2e_filename "$CURRENT_VERSION" "$TEST_OS") + gui_test_filename=$(get_e2e_filename "$current_version" "$TEST_OS") local gui_test_bin="$package_dir"/"$gui_test_filename" if [ ! -f "$app_package" ]; then |
