feat: Add Android+Skia+NativeAOT startup instrumentation test to CI#1244
feat: Add Android+Skia+NativeAOT startup instrumentation test to CI#1244
Conversation
Co-authored-by: jonpryor <155958+jonpryor@users.noreply.github.com> Agent-Logs-Url: https://github.com/unoplatform/Uno.Gallery/sessions/425ca194-89dd-45f6-83d0-750534424d9d
|
|
|
|
||
| mkdir -p $BUILD_ARTIFACTSTAGINGDIRECTORY | ||
|
|
||
| install_android_sdk() { |
There was a problem hiding this comment.
@copilot: this function is also defined in android-uitest-run.sh. You should split out this function into a common script, then source that script from both android-naot-instrumentation-run.sh and android-uitest-run.sh.
There was a problem hiding this comment.
Done in d49f7d3. Extracted the SDK setup variables, cmdline-tools download, and install_android_sdk function into a new build/scripts/android-emulator-common.sh script. Both android-uitest-run.sh and android-naot-instrumentation-run.sh now source it before their respective emulator setup.
| # Wait for the emulator to finish booting | ||
| source $BUILD_SOURCESDIRECTORY/build/scripts/android-uitest-wait-systemui.sh 500 | ||
|
|
||
| $ANDROID_HOME/platform-tools/adb devices |
There was a problem hiding this comment.
@copilot: everything involving environment variables should be always be quoted: "$ANDROID_HOME/platform-tools/adb"
There was a problem hiding this comment.
Fixed in c0d1090 — all $ANDROID_HOME, $LATEST_CMDLINE_TOOLS_PATH, $BUILD_SOURCESDIRECTORY, $BUILD_ARTIFACTSTAGINGDIRECTORY, and other env-var-based paths are now quoted throughout the script.
Co-authored-by: jonpryor <155958+jonpryor@users.noreply.github.com> Agent-Logs-Url: https://github.com/unoplatform/Uno.Gallery/sessions/bb6f9c6d-ce75-4473-85e7-e5f1e07d3787
| IFS=$'\n\t' | ||
|
|
||
| # echo commands | ||
| set -x |
|
|
||
| - job: Android_Tests_NativeAOT | ||
| displayName: 'Run Android+NativeAOT UI Tests' | ||
| displayName: 'Run Android+Skia+NativeAOT Instrumentation Test' |
There was a problem hiding this comment.
@copilot: stage-uitests-android.yml SHOULD NOT BE CHANGED.
New Instrumentation-related tests should be done in either a new .yml file or within azure-pipelines.yml.
There was a problem hiding this comment.
Done in 81b7b5a. Reverted stage-uitests-android.yml to its original state. Created a new build/stage-uitests-android-naot.yml with the instrumentation build and run jobs, and added an Android_NativeAOT_Instrumentation_Tests stage in azure-pipelines.yml that references it.
…on-run.sh Co-authored-by: jonpryor <155958+jonpryor@users.noreply.github.com> Agent-Logs-Url: https://github.com/unoplatform/Uno.Gallery/sessions/6be1dffd-5c3e-4b2c-b8d7-99ee179cc921
…naot.yml and azure-pipelines.yml stage Co-authored-by: jonpryor <155958+jonpryor@users.noreply.github.com> Agent-Logs-Url: https://github.com/unoplatform/Uno.Gallery/sessions/d8bfa5f9-fb10-4120-b280-1e9ae6400392
|
|
|
@copilot: rename |
Co-authored-by: jonpryor <155958+jonpryor@users.noreply.github.com> Agent-Logs-Url: https://github.com/unoplatform/Uno.Gallery/sessions/a08f68de-fbcd-42a6-b122-fda1d1daf750
|
|
| # Build the sample with Skia+NativeAOT enabled (no native rendering) | ||
| publish_extra+=("-m:1" "-p:SkiaPublishAot=true" "-p:ApplicationTitleVendorSuffix= (NAOT)" "-p:ApplicationIdVendorSuffix=.naot") | ||
| BINLOG_SUFFIX="-naot" | ||
| USE_NATIVE_RENDERING=false |
There was a problem hiding this comment.
@copilot: USE_NATIVE_RENDERING cannot be within this if [ "${NAOT:-0}" = "1" ] block, because we require Android native to do UI tests, and commit f31954e tests Android+Native+NativeAOT for UI tests.
Instead, the USE_NATIVE_RENDERING initialize, above, should instead provide an overridable default:
USE_NATIVE_RENDERING=${USE_NATIVE_RENDERING:-true}Then build/stage-tests-android.yml can do:
NAOT=1 USE_NATIVE_RENDERING=false $(build.sourcesdirectory)/build/scripts/android-uitest-build.shThere was a problem hiding this comment.
Fixed in 7543269 — USE_NATIVE_RENDERING is now initialized with ${USE_NATIVE_RENDERING:-true} before the if block, and build/stage-tests-android.yml passes USE_NATIVE_RENDERING=false alongside NAOT=1.
Agent-Logs-Url: https://github.com/unoplatform/Uno.Gallery/sessions/46e7cf37-9c66-476a-8156-5afc4e45d7d2 Co-authored-by: jonpryor <155958+jonpryor@users.noreply.github.com>
| # Requires BUILD_SOURCESDIRECTORY to be set by the caller. | ||
|
|
||
| # Override Android SDK tooling | ||
| export ANDROID_HOME=$BUILD_SOURCESDIRECTORY/build/android-sdk |
There was a problem hiding this comment.
@copilot: as mentioned before, all use of environment variables must be quoted. This is so that if the environment variable value contains a space , it doesn't blow everything up.
export ANDROID_HOME="$BUILD_SOURCESDIRECTORY/build/android-sdk"
export ANDROID_SDK_ROOT="$BUILD_SOURCESDIRECTORY/build/android-sdk"
export LATEST_CMDLINE_TOOLS_PATH="$ANDROID_SDK_ROOT/cmdline-tools/latest"
export CMDLINETOOLS=commandlinetools-mac-8512546_latest.zip
mkdir -p "$ANDROID_HOME"ALL ENVIRONMENT VARIABLE USAGE MUST BE QUOTED.
There was a problem hiding this comment.
Fixed in 8d18e85 — all environment variable usages in android-emulator-common.sh are now quoted, including the export assignments, mkdir, wget, unzip, rm, mv, conditionals, touch, and sdkmanager invocations.
Agent-Logs-Url: https://github.com/unoplatform/Uno.Gallery/sessions/7d1b4334-dbaa-4fbe-8112-7d800c642830 Co-authored-by: jonpryor <155958+jonpryor@users.noreply.github.com>
|
Superseded by #1245. |
Uno.Gallery/Platforms/Android/MainInstrumentation.Android.csbuild/scripts/android-uitest-build.shto not useUseNativeRendering=truein NAOT mode (uses Skia rendering instead)build/scripts/android-naot-instrumentation-run.shfor instrumentation testing (installs APK, runs instrumentation, checksINSTRUMENTATION_CODE: -1)install_android_sdkfunction and SDK setup intobuild/scripts/android-emulator-common.sh; source it from bothandroid-uitest-run.shandandroid-naot-instrumentation-run.shset -xintoset -euox pipefailinandroid-naot-instrumentation-run.shandroid-naot-instrumentation-run.shbuild/stage-uitests-android.ymlto its original state (no changes)build/stage-uitests-android-naot.yml→build/stage-tests-android.yml(not "UI" tests; on-device tests)Android_NativeAOT_Instrumentation_Testsstage inazure-pipelines.ymlreferencing the new templateUSE_NATIVE_RENDERINGoverridable via environment (USE_NATIVE_RENDERING=${USE_NATIVE_RENDERING:-true}) and passUSE_NATIVE_RENDERING=falsefromstage-tests-android.ymlandroid-emulator-common.shOriginal prompt
⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.