From ac9b06ef66c97542ce95b0cde6d3a603b70efa06 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Fri, 3 Mar 2023 19:12:56 +0000 Subject: [PATCH 1/2] make integration tests intel compatible --- samples/IntegrationTestApp/bundle.sh | 11 +++++++++-- .../macos-clean-build-test.sh | 8 +++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/samples/IntegrationTestApp/bundle.sh b/samples/IntegrationTestApp/bundle.sh index 505991582e..e52968215b 100755 --- a/samples/IntegrationTestApp/bundle.sh +++ b/samples/IntegrationTestApp/bundle.sh @@ -1,5 +1,12 @@ #!/usr/bin/env bash cd $(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) -dotnet restore -r osx-arm64 -dotnet msbuild -t:BundleApp -p:RuntimeIdentifier=osx-arm64 -p:_AvaloniaUseExternalMSBuild=false \ No newline at end of file + +arch="x64" + +if [[ $(uname -m) == 'arm64' ]]; then +arch="arm64" +fi + +dotnet restore -r osx-$arch +dotnet msbuild -t:BundleApp -p:RuntimeIdentifier=osx-$arch -p:_AvaloniaUseExternalMSBuild=false \ No newline at end of file diff --git a/tests/Avalonia.IntegrationTests.Appium/macos-clean-build-test.sh b/tests/Avalonia.IntegrationTests.Appium/macos-clean-build-test.sh index dc4619f35c..0d4a1fa57c 100755 --- a/tests/Avalonia.IntegrationTests.Appium/macos-clean-build-test.sh +++ b/tests/Avalonia.IntegrationTests.Appium/macos-clean-build-test.sh @@ -1,5 +1,11 @@ # Cleans, builds, and runs integration tests on macOS. # Can be used by `git bisect run` to automatically find the commit which introduced a problem. +arch="x64" + +if [[ $(uname -m) == 'arm64' ]]; then +arch="arm64" +fi + SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) cd "$SCRIPT_DIR"/../.. || exit git clean -xdf @@ -10,7 +16,7 @@ pkill IntegrationTestApp rm -rf $(osascript -e "POSIX path of (path to application id \"net.avaloniaui.avalonia.integrationtestapp\")") pkill IntegrationTestApp ./samples/IntegrationTestApp/bundle.sh -open -n ./samples/IntegrationTestApp/bin/Debug/net7.0/osx-arm64/publish/IntegrationTestApp.app +open -n ./samples/IntegrationTestApp/bin/Debug/net7.0/osx-$arch/publish/IntegrationTestApp.app pkill IntegrationTestApp open -b net.avaloniaui.avalonia.integrationtestapp dotnet test tests/Avalonia.IntegrationTests.Appium/ -l "console;verbosity=detailed" From 46b46b2500337460b3e2bb3961ea6717e7ea3656 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Fri, 3 Mar 2023 19:33:32 +0000 Subject: [PATCH 2/2] fix intel --- azure-pipelines-integrationtests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/azure-pipelines-integrationtests.yml b/azure-pipelines-integrationtests.yml index 194367c076..dec94a44d5 100644 --- a/azure-pipelines-integrationtests.yml +++ b/azure-pipelines-integrationtests.yml @@ -18,6 +18,10 @@ jobs: displayName: 'Get Resolution' - script: | + arch="x64" + if [[ $(uname -m) == 'arm64' ]]; then + arch="arm64" + fi sudo xcode-select -s /Applications/Xcode.app/Contents/Developer pkill node appium > appium.out & @@ -26,7 +30,7 @@ jobs: rm -rf $(osascript -e "POSIX path of (path to application id \"net.avaloniaui.avalonia.integrationtestapp\")") pkill IntegrationTestApp ./samples/IntegrationTestApp/bundle.sh - open -n ./samples/IntegrationTestApp/bin/Debug/net7.0/osx-arm64/publish/IntegrationTestApp.app + open -n ./samples/IntegrationTestApp/bin/Debug/net7.0/osx-$arch/publish/IntegrationTestApp.app pkill IntegrationTestApp displayName: 'Build IntegrationTestApp'