Files
pipelines/app/test/features/artifacts/domain/artifact_debug_group_test.dart
alan 57f5219628 Artifacts: runner-internal turn files move to a Debugging files group
Each recorded artifact now carries a server group (deliverable or debug).
public/ files are deliverables; input/memory/history/output.md, session
exports and private/ scratch are debugging files. The app's Artifacts tab
lists deliverables and the Debug toggle reveals a separate Debugging files
group (older servers fall back to the filename rule); the TUI lists
deliverables first and marks debug rows; artifact search excludes debug
files unless include_debug / --debug-files is set.
2026-11-04 17:43:47 +00:00

59 lines
1.6 KiB
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/artifacts/domain/artifact_record.dart';
import 'package:pipelines_app/features/artifacts/domain/artifact_selection.dart';
import 'artifact_fixtures.dart';
List<String> _names(List<ArtifactRecord> records) => [
for (final record in records) record.name,
];
void main() {
test('the server group decides deliverable versus debugging file', () {
final records = [
ArtifactRecord.fromJson(
artifact('notes.md', extra: const {'group': 'debug'}),
),
ArtifactRecord.fromJson(
artifact('history.md', extra: const {'group': 'deliverable'}),
),
ArtifactRecord.fromJson(
artifact('public/report.png', extra: const {'group': 'deliverable'}),
),
];
expect(_names(stageArtifactsFrom(records)), [
'history.md',
'public/report.png',
]);
expect(_names(systemArtifactsFrom(records)), ['notes.md']);
});
test('an older server without groups falls back to the filename rule', () {
final records = [
for (final name in [
'input.md',
'memory.md',
'history.md',
'output.md',
'session.html',
'private/shot.png',
'public/report.html',
'legacy-report.txt',
])
ArtifactRecord.fromJson(artifact(name)),
];
expect(_names(stageArtifactsFrom(records)), [
'public/report.html',
'legacy-report.txt',
]);
expect(_names(systemArtifactsFrom(records)), [
'input.md',
'memory.md',
'history.md',
'output.md',
'session.html',
'private/shot.png',
]);
});
}