-
Notifications
You must be signed in to change notification settings - Fork 3
ci: run Android instrumented tests on the mac-metal queue #471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
710e765
414393b
a2760ca
0e05639
9b4809f
d9329d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,28 @@ android { | |
|
|
||
| testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
|
|
||
| // Buildkite Test Engine: upload per-test results when a token is present in the env. | ||
| // Absent locally → no listener is registered and the collector is fully inert. | ||
| // Build metadata env vars are forwarded so uploaded results link back to the CI job: | ||
| // https://github.com/buildkite/test-collector-android/blob/main/CI_CONFIGURATION.md#buildkite | ||
| System.getenv("BUILDKITE_ANALYTICS_TOKEN_ANDROID_E2E")?.takeIf { it.isNotBlank() }?.let { token -> | ||
| testInstrumentationRunnerArguments["listener"] = | ||
| "com.buildkite.test.collector.android.InstrumentedTestCollector" | ||
| testInstrumentationRunnerArguments["BUILDKITE_ANALYTICS_TOKEN"] = token | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By the way, it's probably also interesting to set these for Buildkite's test collector https://github.com/buildkite/test-collector-android/blob/main/CI_CONFIGURATION.md#buildkite
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice – addressed by 9b4809f There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| listOf( | ||
| "BUILDKITE_BUILD_ID", | ||
| "BUILDKITE_BUILD_URL", | ||
| "BUILDKITE_BRANCH", | ||
| "BUILDKITE_COMMIT", | ||
| "BUILDKITE_BUILD_NUMBER", | ||
| "BUILDKITE_JOB_ID", | ||
| "BUILDKITE_MESSAGE", | ||
| ).forEach { key -> | ||
| System.getenv(key)?.let { value -> testInstrumentationRunnerArguments[key] = value } | ||
| } | ||
| } | ||
|
|
||
| buildConfigField("String", "WP_ENV_SITE_URL", "\"${wpEnvCredentials["siteUrl"] ?: ""}\"") | ||
| buildConfigField("String", "WP_ENV_SITE_API_ROOT", "\"${wpEnvCredentials["siteApiRoot"] ?: ""}\"") | ||
| buildConfigField("String", "WP_ENV_AUTH_HEADER", "\"${wpEnvCredentials["authHeader"] ?: ""}\"") | ||
|
|
@@ -102,4 +124,9 @@ dependencies { | |
| testImplementation(libs.junit) | ||
| androidTestImplementation(libs.androidx.junit) | ||
| androidTestImplementation(libs.androidx.espresso.core) | ||
| androidTestImplementation(libs.androidx.espresso.web) | ||
| androidTestImplementation(platform(libs.androidx.compose.bom)) | ||
| androidTestImplementation(libs.androidx.compose.ui.test.junit4) | ||
| androidTestImplementation(libs.buildkite.test.collector.instrumented) | ||
| debugImplementation(libs.androidx.compose.ui.test.manifest) | ||
| } | ||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker as this is just the initial setup to get it going, but maybe for the long run it might be worth it to add
artifact_pathsto debug test results (stuff from logcat, test reports, etc).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure – added in d9329d2, thanks!