Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/test-manager-fixes' into figure-…
Browse files Browse the repository at this point in the history
…out-windows10-crash
  • Loading branch information
MarkusPettersson98 committed Jul 25, 2024
2 parents 989c4bf + 4ce7747 commit eceada0
Show file tree
Hide file tree
Showing 20 changed files with 583 additions and 364 deletions.
8 changes: 4 additions & 4 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,27 @@ Currently, only `x86_64` platforms are supported for Windows/Linux and `ARM64` (
For example, building `test-runner` for Windows would look like this:

``` bash
./container-run.sh ./build-runner.sh windows
./scripts/container-run.sh ./scripts/build-runner.sh windows
```

## Linux
Using `podman` is the recommended way to build the `test-runner`. See the [Linux section under Prerequisities](#Prerequisities) for more details.

``` bash
./container-run.sh ./build-runner.sh linux
./scripts/container-run.sh ./scripts/build-runner.sh linux
```

## macOS

``` bash
./build-runner.sh macos
./scripts/build-runner.sh macos
```

## Windows
The `test-runner` binary for Windows may be cross-compiled from a Linux host.

``` bash
./container-run.sh ./build-runner.sh windows
./scripts/container-run.sh ./scripts/build-runner.sh windows
```

# Building base images
Expand Down
246 changes: 0 additions & 246 deletions test/ci-runtests.sh

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion test/scripts/build-runner-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ case $TARGET in
-i "${TEST_RUNNER_IMAGE_PATH}" \
"${SCRIPT_DIR}/../target/$TARGET/release/test-runner.exe" \
"${SCRIPT_DIR}/../target/$TARGET/release/connection-checker.exe" \
"${PACKAGES_DIR}/"*.exe \
"${PACKAGE_FOLDER}/"*.exe \
"${SCRIPT_DIR}/../openvpn.ca.crt" \
"::"
mdir -i "${TEST_RUNNER_IMAGE_PATH}"
Expand Down
4 changes: 2 additions & 2 deletions test/build-runner.sh → test/scripts/build-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -eu

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
REPO_DIR="$SCRIPT_DIR/.."
REPO_DIR="$SCRIPT_DIR/../.."
cd "$SCRIPT_DIR"

source "$REPO_DIR/scripts/utils/log"
Expand Down Expand Up @@ -34,5 +34,5 @@ cargo build \

# Only build runner image for Windows
if [[ $TARGET == x86_64-pc-windows-gnu ]]; then
TARGET="$TARGET" ./scripts/build-runner-image.sh
TARGET="$TARGET" ./build-runner-image.sh
fi
68 changes: 68 additions & 0 deletions test/scripts/ci-runtests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env bash

set -eu

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPT_DIR"
TEST_DIR="$SCRIPT_DIR/.."

if [[ "$#" -lt 1 ]]; then
echo "usage: $0 TEST_OS" 1>&2
exit 1
fi

TEST_OS=$1

PACKAGE_FOLDER="${CACHE_FOLDER}"

source "$SCRIPT_DIR/test-utils.sh"

echo "**********************************"
echo "* Version to upgrade from: $LATEST_STABLE_RELEASE"
echo "* Version to test: $CURRENT_VERSION"
echo "**********************************"


if [[ -z "${ACCOUNT_TOKENS+x}" ]]; then
echo "'ACCOUNT_TOKENS' must be specified" 1>&2
exit 1
fi
if ! readarray -t tokens < "${ACCOUNT_TOKENS}"; then
echo "Specify account tokens in 'ACCOUNT_TOKENS' file" 1>&2
exit 1
fi

mkdir -p "$SCRIPT_DIR/.ci-logs"
echo "$CURRENT_VERSION" > "$SCRIPT_DIR/.ci-logs/last-version.log"


echo "**********************************"
echo "* Downloading app packages"
echo "**********************************"

# Clean up old packages
find "$PACKAGE_FOLDER" -type f -mtime +5 -delete || true


nice_time download_app_package "$LATEST_STABLE_RELEASE" "$TEST_OS"
nice_time download_app_package "$CURRENT_VERSION" "$TEST_OS"
nice_time download_e2e_executable "$CURRENT_VERSION" "$TEST_OS"

echo "**********************************"
echo "* Building test manager"
echo "**********************************"

cargo build -p test-manager

echo "**********************************"
echo "* Running tests"
echo "**********************************"

mkdir -p "$TEST_DIR/.ci-logs/os/"
rm -f "$TEST_DIR/.ci-logs/${TEST_OS}_report"

set -o pipefail

APP_PACKAGE=$(get_app_filename "$CURRENT_VERSION" "$TEST_OS")
APP_PACKAGE_TO_UPGRADE_FROM=$(get_app_filename "$LATEST_STABLE_RELEASE" "$TEST_OS")
ACCOUNT_TOKEN=${tokens[0]} RUST_LOG=debug nice_time run_tests_for_os "${TEST_OS}"
Loading

0 comments on commit eceada0

Please sign in to comment.