fix(ci): bound critical alarm tests
This commit is contained in:
@@ -30,11 +30,35 @@ jobs:
|
||||
- name: Analizar código
|
||||
run: flutter analyze --no-fatal-infos --no-fatal-warnings
|
||||
|
||||
- name: Ejecutar tests criticos
|
||||
- name: Ejecutar tests críticos
|
||||
run: |
|
||||
flutter test \
|
||||
test/estado/estado_alarmas_test.dart \
|
||||
test/servicios/servicio_programacion_alarmas_test.dart
|
||||
python3 - <<'PY'
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
tests = [
|
||||
'test/servicios/servicio_programacion_alarmas_test.dart',
|
||||
'test/estado/estado_alarmas_test.dart',
|
||||
]
|
||||
|
||||
for test_path in tests:
|
||||
cmd = [
|
||||
'flutter',
|
||||
'test',
|
||||
'--concurrency=1',
|
||||
'--timeout=60s',
|
||||
'--reporter=expanded',
|
||||
test_path,
|
||||
]
|
||||
print('$ ' + ' '.join(cmd), flush=True)
|
||||
try:
|
||||
result = subprocess.run(cmd, timeout=180)
|
||||
except subprocess.TimeoutExpired:
|
||||
print(f'ERROR: timeout ejecutando {test_path}', file=sys.stderr, flush=True)
|
||||
sys.exit(124)
|
||||
if result.returncode != 0:
|
||||
sys.exit(result.returncode)
|
||||
PY
|
||||
|
||||
build:
|
||||
name: Build APK + AAB release
|
||||
|
||||
@@ -22,6 +22,8 @@ void main() {
|
||||
android: android,
|
||||
iniciarAutomaticamente: false,
|
||||
);
|
||||
addTearDown(estado.dispose);
|
||||
addTearDown(android.dispose);
|
||||
await estado.guardarAlarma(
|
||||
const AlarmaMusical(
|
||||
id: 'a1',
|
||||
@@ -55,6 +57,8 @@ void main() {
|
||||
android: android,
|
||||
iniciarAutomaticamente: false,
|
||||
);
|
||||
addTearDown(estado.dispose);
|
||||
addTearDown(android.dispose);
|
||||
await estado.guardarAlarma(
|
||||
AlarmaMusical(
|
||||
id: 'pre1',
|
||||
@@ -80,13 +84,16 @@ void main() {
|
||||
});
|
||||
|
||||
test('finalizar diaria calcula siguiente dia y limpia snooze', () async {
|
||||
final android = FakePuertoAlarmasAndroid();
|
||||
final estado = EstadoAlarmas(
|
||||
servicio: ServicioAlarmas(
|
||||
reloj: () => DateTime(2026, 5, 25, 7, 31),
|
||||
),
|
||||
android: FakePuertoAlarmasAndroid(),
|
||||
android: android,
|
||||
iniciarAutomaticamente: false,
|
||||
);
|
||||
addTearDown(estado.dispose);
|
||||
addTearDown(android.dispose);
|
||||
await estado.guardarAlarma(
|
||||
AlarmaMusical(
|
||||
id: 'a2',
|
||||
@@ -108,13 +115,16 @@ void main() {
|
||||
});
|
||||
|
||||
test('finalizar unica la desactiva y queda sin proxima ejecucion', () async {
|
||||
final android = FakePuertoAlarmasAndroid();
|
||||
final estado = EstadoAlarmas(
|
||||
servicio: ServicioAlarmas(
|
||||
reloj: () => DateTime(2026, 5, 25, 7, 31),
|
||||
),
|
||||
android: FakePuertoAlarmasAndroid(),
|
||||
android: android,
|
||||
iniciarAutomaticamente: false,
|
||||
);
|
||||
addTearDown(estado.dispose);
|
||||
addTearDown(android.dispose);
|
||||
await estado.guardarAlarma(
|
||||
AlarmaMusical(
|
||||
id: 'a3',
|
||||
@@ -193,4 +203,6 @@ class FakePuertoAlarmasAndroid implements PuertoAlarmasAndroid {
|
||||
|
||||
@override
|
||||
Future<bool> solicitarPermisoPantallaCompleta() async => true;
|
||||
|
||||
Future<void> dispose() => _eventos.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user