Files
fn_registry/bash/functions/infra/gradle_instrumented_test.md

1.7 KiB

name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path, params, output, notes
name kind lang domain version purity signature description tags uses_functions uses_types returns returns_optional error_type imports tested tests test_file_path file_path params output notes
gradle_instrumented_test function bash infra 1.0.0 impure gradle_instrumented_test(project_dir: string, module: string) -> int Corre instrumented tests Compose en emulador/device Android conectado.
android
gradle
test
compose
emulator
gradle_run_bash_infra
adb_wsl_bash_infra
false error_go_core
false
bash/functions/infra/gradle_instrumented_test.sh
name desc
project_dir Raiz del proyecto Gradle
name desc
module Modulo. Default app
Stdout con resultados. Linea final 'REPORT: <path>'. Exit: 0=OK, 3=no device, otro=fallos tests. Requiere emulador corriendo. Lanzar antes con android_emulator_start. connectedAndroidTest corre en TODOS los devices conectados.

Ejemplo

# Correr instrumented tests del modulo app
gradle_instrumented_test /home/user/MyAndroidProject

# Correr instrumented tests de un modulo especifico
gradle_instrumented_test /home/user/MyAndroidProject feature_login

Notas

Requiere emulador corriendo. Lanzar antes con android_emulator_start. connectedAndroidTest corre en TODOS los devices conectados.

El script verifica que haya al menos un emulador o device conectado antes de lanzar Gradle. Si no hay ninguno, imprime un mensaje descriptivo a stderr y sale con exit code 3, permitiendo al llamador distinguir "no device" de "tests fallaron".

La linea REPORT: <path> se imprime siempre al final (incluso si los tests fallan), para que el llamador pueda abrir el reporte HTML independientemente del resultado.