fix(ci): exclude chaos_monkey_test from regular CI (#518)

This commit was merged in pull request #518.
This commit is contained in:
Bot of Thomas Güttler
2026-06-07 04:24:10 +02:00
parent f5abe9132b
commit e2bb299300
11 changed files with 35 additions and 99 deletions
+1 -8
View File
@@ -22,14 +22,7 @@ jobs:
created_at=$(curl -sf \ created_at=$(curl -sf \
-H "Authorization: token $FORGEJO_TOKEN" \ -H "Authorization: token $FORGEJO_TOKEN" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \ "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \
| python3 -c " | python3 -c "import sys,json;data=json.load(sys.stdin);rs=[r for r in data.get('workflow_runs',[]) if r.get('run_number')==$RUN_NUMBER];print(rs[0]['created_at'] if rs else '')" 2>/dev/null)
import sys, json
data = json.load(sys.stdin)
for r in data.get('workflow_runs', []):
if r.get('run_number') == $RUN_NUMBER:
print(r['created_at'])
break
" 2>/dev/null)
if [ -n "$created_at" ]; then if [ -n "$created_at" ]; then
queued_epoch=$(date -d "$created_at" +%s) queued_epoch=$(date -d "$created_at" +%s)
wait_seconds=$((runner_start - queued_epoch)) wait_seconds=$((runner_start - queued_epoch))
+5 -40
View File
@@ -24,14 +24,7 @@ jobs:
created_at=$(curl -sf \ created_at=$(curl -sf \
-H "Authorization: token $FORGEJO_TOKEN" \ -H "Authorization: token $FORGEJO_TOKEN" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \ "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \
| python3 -c " | python3 -c "import sys,json;data=json.load(sys.stdin);rs=[r for r in data.get('workflow_runs',[]) if r.get('run_number')==$RUN_NUMBER];print(rs[0]['created_at'] if rs else '')" 2>/dev/null)
import sys, json
data = json.load(sys.stdin)
for r in data.get('workflow_runs', []):
if r.get('run_number') == $RUN_NUMBER:
print(r['created_at'])
break
" 2>/dev/null)
if [ -n "$created_at" ]; then if [ -n "$created_at" ]; then
queued_epoch=$(date -d "$created_at" +%s) queued_epoch=$(date -d "$created_at" +%s)
wait_seconds=$((runner_start - queued_epoch)) wait_seconds=$((runner_start - queued_epoch))
@@ -174,14 +167,7 @@ for r in data.get('workflow_runs', []):
created_at=$(curl -sf \ created_at=$(curl -sf \
-H "Authorization: token $FORGEJO_TOKEN" \ -H "Authorization: token $FORGEJO_TOKEN" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \ "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \
| python3 -c " | python3 -c "import sys,json;data=json.load(sys.stdin);rs=[r for r in data.get('workflow_runs',[]) if r.get('run_number')==$RUN_NUMBER];print(rs[0]['created_at'] if rs else '')" 2>/dev/null)
import sys, json
data = json.load(sys.stdin)
for r in data.get('workflow_runs', []):
if r.get('run_number') == $RUN_NUMBER:
print(r['created_at'])
break
" 2>/dev/null)
if [ -n "$created_at" ]; then if [ -n "$created_at" ]; then
queued_epoch=$(date -d "$created_at" +%s) queued_epoch=$(date -d "$created_at" +%s)
wait_seconds=$((runner_start - queued_epoch)) wait_seconds=$((runner_start - queued_epoch))
@@ -232,14 +218,7 @@ for r in data.get('workflow_runs', []):
created_at=$(curl -sf \ created_at=$(curl -sf \
-H "Authorization: token $FORGEJO_TOKEN" \ -H "Authorization: token $FORGEJO_TOKEN" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \ "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \
| python3 -c " | python3 -c "import sys,json;data=json.load(sys.stdin);rs=[r for r in data.get('workflow_runs',[]) if r.get('run_number')==$RUN_NUMBER];print(rs[0]['created_at'] if rs else '')" 2>/dev/null)
import sys, json
data = json.load(sys.stdin)
for r in data.get('workflow_runs', []):
if r.get('run_number') == $RUN_NUMBER:
print(r['created_at'])
break
" 2>/dev/null)
if [ -n "$created_at" ]; then if [ -n "$created_at" ]; then
queued_epoch=$(date -d "$created_at" +%s) queued_epoch=$(date -d "$created_at" +%s)
wait_seconds=$((runner_start - queued_epoch)) wait_seconds=$((runner_start - queued_epoch))
@@ -284,14 +263,7 @@ for r in data.get('workflow_runs', []):
created_at=$(curl -sf \ created_at=$(curl -sf \
-H "Authorization: token $FORGEJO_TOKEN" \ -H "Authorization: token $FORGEJO_TOKEN" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \ "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \
| python3 -c " | python3 -c "import sys,json;data=json.load(sys.stdin);rs=[r for r in data.get('workflow_runs',[]) if r.get('run_number')==$RUN_NUMBER];print(rs[0]['created_at'] if rs else '')" 2>/dev/null)
import sys, json
data = json.load(sys.stdin)
for r in data.get('workflow_runs', []):
if r.get('run_number') == $RUN_NUMBER:
print(r['created_at'])
break
" 2>/dev/null)
if [ -n "$created_at" ]; then if [ -n "$created_at" ]; then
queued_epoch=$(date -d "$created_at" +%s) queued_epoch=$(date -d "$created_at" +%s)
wait_seconds=$((runner_start - queued_epoch)) wait_seconds=$((runner_start - queued_epoch))
@@ -341,14 +313,7 @@ for r in data.get('workflow_runs', []):
created_at=$(curl -sf \ created_at=$(curl -sf \
-H "Authorization: token $FORGEJO_TOKEN" \ -H "Authorization: token $FORGEJO_TOKEN" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \ "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \
| python3 -c " | python3 -c "import sys,json;data=json.load(sys.stdin);rs=[r for r in data.get('workflow_runs',[]) if r.get('run_number')==$RUN_NUMBER];print(rs[0]['created_at'] if rs else '')" 2>/dev/null)
import sys, json
data = json.load(sys.stdin)
for r in data.get('workflow_runs', []):
if r.get('run_number') == $RUN_NUMBER:
print(r['created_at'])
break
" 2>/dev/null)
if [ -n "$created_at" ]; then if [ -n "$created_at" ]; then
queued_epoch=$(date -d "$created_at" +%s) queued_epoch=$(date -d "$created_at" +%s)
wait_seconds=$((runner_start - queued_epoch)) wait_seconds=$((runner_start - queued_epoch))
+2 -16
View File
@@ -23,14 +23,7 @@ jobs:
created_at=$(curl -sf \ created_at=$(curl -sf \
-H "Authorization: token $FORGEJO_TOKEN" \ -H "Authorization: token $FORGEJO_TOKEN" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \ "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \
| python3 -c " | python3 -c "import sys,json;data=json.load(sys.stdin);rs=[r for r in data.get('workflow_runs',[]) if r.get('run_number')==$RUN_NUMBER];print(rs[0]['created_at'] if rs else '')" 2>/dev/null)
import sys, json
data = json.load(sys.stdin)
for r in data.get('workflow_runs', []):
if r.get('run_number') == $RUN_NUMBER:
print(r['created_at'])
break
" 2>/dev/null)
if [ -n "$created_at" ]; then if [ -n "$created_at" ]; then
queued_epoch=$(date -d "$created_at" +%s) queued_epoch=$(date -d "$created_at" +%s)
wait_seconds=$((runner_start - queued_epoch)) wait_seconds=$((runner_start - queued_epoch))
@@ -83,14 +76,7 @@ for r in data.get('workflow_runs', []):
created_at=$(curl -sf \ created_at=$(curl -sf \
-H "Authorization: token $FORGEJO_TOKEN" \ -H "Authorization: token $FORGEJO_TOKEN" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \ "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \
| python3 -c " | python3 -c "import sys,json;data=json.load(sys.stdin);rs=[r for r in data.get('workflow_runs',[]) if r.get('run_number')==$RUN_NUMBER];print(rs[0]['created_at'] if rs else '')" 2>/dev/null)
import sys, json
data = json.load(sys.stdin)
for r in data.get('workflow_runs', []):
if r.get('run_number') == $RUN_NUMBER:
print(r['created_at'])
break
" 2>/dev/null)
if [ -n "$created_at" ]; then if [ -n "$created_at" ]; then
queued_epoch=$(date -d "$created_at" +%s) queued_epoch=$(date -d "$created_at" +%s)
wait_seconds=$((runner_start - queued_epoch)) wait_seconds=$((runner_start - queued_epoch))
+1 -8
View File
@@ -27,14 +27,7 @@ jobs:
created_at=$(curl -sf \ created_at=$(curl -sf \
-H "Authorization: token $FORGEJO_TOKEN" \ -H "Authorization: token $FORGEJO_TOKEN" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \ "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/tasks?limit=100" \
| python3 -c " | python3 -c "import sys,json;data=json.load(sys.stdin);rs=[r for r in data.get('workflow_runs',[]) if r.get('run_number')==$RUN_NUMBER];print(rs[0]['created_at'] if rs else '')" 2>/dev/null)
import sys, json
data = json.load(sys.stdin)
for r in data.get('workflow_runs', []):
if r.get('run_number') == $RUN_NUMBER:
print(r['created_at'])
break
" 2>/dev/null)
if [ -n "$created_at" ]; then if [ -n "$created_at" ]; then
queued_epoch=$(date -d "$created_at" +%s) queued_epoch=$(date -d "$created_at" +%s)
wait_seconds=$((runner_start - queued_epoch)) wait_seconds=$((runner_start - queued_epoch))
+2 -2
View File
@@ -539,7 +539,7 @@ func (m *Ci) TestBackend(ctx context.Context) (string, error) {
return m.WithStalwart(m.setup(m.backendSrc())). return m.WithStalwart(m.setup(m.backendSrc())).
WithExec([]string{"/bin/bash", "-c", WithExec([]string{"/bin/bash", "-c",
`tmp=$(mktemp); trap 'rm -f "$tmp"' EXIT; ` + `tmp=$(mktemp); trap 'rm -f "$tmp"' EXIT; ` +
`flutter test --concurrency=1 --reporter expanded --no-pub test/backend >"$tmp" 2>&1 || { cat "$tmp"; exit 1; }; ` + `flutter test --concurrency=1 --reporter expanded --no-pub --exclude-tags=nightly test/backend >"$tmp" 2>&1 || { cat "$tmp"; exit 1; }; ` +
`grep -E '^All [0-9]+ tests passed' "$tmp" || tail -1 "$tmp"`}). `grep -E '^All [0-9]+ tests passed' "$tmp" || tail -1 "$tmp"`}).
Stdout(ctx) Stdout(ctx)
} }
@@ -570,7 +570,7 @@ func (m *Ci) ChaosMonkeyBackend(ctx context.Context) (string, error) {
return m.WithStalwart(m.setup(m.backendSrc())). return m.WithStalwart(m.setup(m.backendSrc())).
WithExec([]string{"/bin/bash", "-c", WithExec([]string{"/bin/bash", "-c",
`tmp=$(mktemp); trap 'rm -f "$tmp"' EXIT; ` + `tmp=$(mktemp); trap 'rm -f "$tmp"' EXIT; ` +
`flutter test test/backend/chaos_monkey_test.dart --reporter expanded --concurrency=1 --no-pub >"$tmp" 2>&1 || { cat "$tmp"; exit 1; }; ` + `flutter test test/backend/chaos_monkey_test.dart --reporter expanded --concurrency=1 --no-pub --tags=nightly >"$tmp" 2>&1 || { cat "$tmp"; exit 1; }; ` +
`grep -E '^All [0-9]+ tests passed' "$tmp" || tail -1 "$tmp"`}). `grep -E '^All [0-9]+ tests passed' "$tmp" || tail -1 "$tmp"`}).
Stdout(ctx) Stdout(ctx)
} }
@@ -2952,16 +2952,12 @@ class EmailRepositoryImpl implements EmailRepository {
String? mailboxPath, String? mailboxPath,
String query, String query,
) async { ) async {
final words = query final words =
.trim() query.trim().split(RegExp(r'\s+')).where((w) => w.isNotEmpty).toList();
.split(RegExp(r'\s+'))
.where((w) => w.isNotEmpty)
.toList();
if (words.isEmpty) return []; if (words.isEmpty) return [];
final noteConditions = words.map((_) => 'n.note_text LIKE ?').join(' AND '); final noteConditions = words.map((_) => 'n.note_text LIKE ?').join(' AND ');
final likeVars = final likeVars = words.map((w) => Variable<String>('%$w%')).toList();
words.map((w) => Variable<String>('%$w%')).toList();
final extraConditions = StringBuffer(); final extraConditions = StringBuffer();
final extraVars = <Variable<String>>[]; final extraVars = <Variable<String>>[];
@@ -2980,14 +2976,13 @@ class EmailRepositoryImpl implements EmailRepository {
' WHERE $noteConditions$extraConditions' ' WHERE $noteConditions$extraConditions'
' ORDER BY e.received_at DESC LIMIT 50'; ' ORDER BY e.received_at DESC LIMIT 50';
final rows = await _db final rows = await _db.customSelect(
.customSelect( sql,
sql, variables: [...likeVars, ...extraVars],
variables: [...likeVars, ...extraVars], readsFrom: {_db.emails, _db.emailNotes},
readsFrom: {_db.emails, _db.emailNotes}, ).get();
) final emailRows =
.get(); await Future.wait(rows.map((r) => _db.emails.mapFromRow(r)));
final emailRows = await Future.wait(rows.map((r) => _db.emails.mapFromRow(r)));
return emailRows.map(_toModel).toList(); return emailRows.map(_toModel).toList();
} }
@@ -2997,9 +2992,7 @@ class EmailRepositoryImpl implements EmailRepository {
static String _toFtsQuery(String query) { static String _toFtsQuery(String query) {
final words = query final words = query
.trim() .trim()
.split(RegExp(r'\s+')) .split(RegExp(r'[^\w]+'))
.where((w) => w.isNotEmpty)
.map((w) => w.replaceAll(RegExp(r'[^\w]'), ''))
.where((w) => w.isNotEmpty) .where((w) => w.isNotEmpty)
.toList(); .toList();
if (words.isEmpty) return ''; if (words.isEmpty) return '';
@@ -3126,8 +3119,7 @@ class EmailRepositoryImpl implements EmailRepository {
queryRows.map((r) => _db.emails.mapFromRow(r)), queryRows.map((r) => _db.emails.mapFromRow(r)),
); );
final noteRows = final noteRows = await _searchEmailsByNotes(accountId, mailboxPath, query);
await _searchEmailsByNotes(accountId, mailboxPath, query);
final seen = <String>{}; final seen = <String>{};
final merged = <model.Email>[]; final merged = <model.Email>[];
+2
View File
@@ -109,6 +109,7 @@ class _SharedInboxAppState extends ConsumerState<SharedInboxApp> {
theme: ThemeData( theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.indigo), colorScheme: ColorScheme.fromSeed(seedColor: Colors.indigo),
useMaterial3: true, useMaterial3: true,
splashFactory: NoSplash.splashFactory,
), ),
darkTheme: ThemeData( darkTheme: ThemeData(
colorScheme: ColorScheme.fromSeed( colorScheme: ColorScheme.fromSeed(
@@ -116,6 +117,7 @@ class _SharedInboxAppState extends ConsumerState<SharedInboxApp> {
brightness: Brightness.dark, brightness: Brightness.dark,
), ),
useMaterial3: true, useMaterial3: true,
splashFactory: NoSplash.splashFactory,
), ),
routerConfig: router, routerConfig: router,
); );
+1
View File
@@ -57,6 +57,7 @@ class CrashScreen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
theme: ThemeData(splashFactory: NoSplash.splashFactory),
home: Scaffold( home: Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text('Something went wrong'), title: const Text('Something went wrong'),
+3
View File
@@ -10,6 +10,9 @@
// CHAOS_ROUNDS (default: 30) — number of random operations to perform // CHAOS_ROUNDS (default: 30) — number of random operations to perform
// CHAOS_SEED (default: current epoch ms) — seed for reproducibility // CHAOS_SEED (default: current epoch ms) — seed for reproducibility
@Tags(['nightly'])
library;
import 'dart:io'; import 'dart:io';
import 'dart:math'; import 'dart:math';
+2 -4
View File
@@ -514,8 +514,7 @@ void main() {
), ),
); );
final results = final results = await r.emails.searchEmailsGlobal(null, 'urgent');
await r.emails.searchEmailsGlobal(null, 'urgent');
expect(results, hasLength(1)); expect(results, hasLength(1));
expect(results.first.subject, 'Weekly report'); expect(results.first.subject, 'Weekly report');
}); });
@@ -569,8 +568,7 @@ void main() {
), ),
); );
final results = final results = await r.emails.searchEmails('acc-1', 'INBOX', 'client');
await r.emails.searchEmails('acc-1', 'INBOX', 'client');
expect(results, hasLength(1)); expect(results, hasLength(1));
expect(results.first.subject, 'Project update'); expect(results.first.subject, 'Project update');
expect(results.first.mailboxPath, 'INBOX'); expect(results.first.mailboxPath, 'INBOX');
+4 -1
View File
@@ -50,7 +50,10 @@ Widget _buildScreen({List<Account> accounts = const []}) {
FakeAccountRepository(accounts), FakeAccountRepository(accounts),
), ),
], ],
child: const MaterialApp(home: AboutScreen()), child: MaterialApp(
theme: ThemeData(splashFactory: NoSplash.splashFactory),
home: const AboutScreen(),
),
); );
} }