Skip to content

Commit 51d23c0

Browse files
authored
Temporarily disable widget tests in inspector_service_test (#9396)
1 parent e918e9f commit 51d23c0

File tree

2 files changed

+120
-111
lines changed

2 files changed

+120
-111
lines changed

flutter-candidate.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
52af7a5040254357f2ab98723b51bbd92d4e6337
1+
78df185e5a8da5290246fb25d3c81851834c729a

packages/devtools_app/test/shared/diagnostics/inspector_service_test.dart

Lines changed: 119 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -261,132 +261,141 @@ void main() {
261261
});
262262
});
263263

264-
group('widget trees', () {
265-
test('isSummaryTree = true', () async {
266-
await env.setupEnvironment();
267-
final group = inspectorService!.createObjectGroup('test-group');
268-
final root = (await group.getRoot(
269-
FlutterTreeType.widget,
270-
isSummaryTree: true,
271-
))!;
272-
// Tree only contains widgets from local app.
273-
expect(
274-
treeToDebugString(root),
275-
equals(
276-
equalsGoldenIgnoringHashCodes(
277-
'inspector_service_tree_summary.txt',
264+
group(
265+
'widget trees',
266+
() {
267+
test('isSummaryTree = true', () async {
268+
await env.setupEnvironment();
269+
final group = inspectorService!.createObjectGroup('test-group');
270+
final root = (await group.getRoot(
271+
FlutterTreeType.widget,
272+
isSummaryTree: true,
273+
))!;
274+
// Tree only contains widgets from local app.
275+
expect(
276+
treeToDebugString(root),
277+
equals(
278+
equalsGoldenIgnoringHashCodes(
279+
'inspector_service_tree_summary.txt',
280+
),
278281
),
279-
),
280-
);
281-
final nodeInSummaryTree = findNodeMatching(root, 'MaterialApp')!;
282-
expect(nodeInSummaryTree, isNotNull);
282+
);
283+
final nodeInSummaryTree = findNodeMatching(root, 'MaterialApp')!;
284+
expect(nodeInSummaryTree, isNotNull);
283285

284-
expect(
285-
treeToDebugString(nodeInSummaryTree),
286-
equals(
287-
equalsGoldenIgnoringHashCodes(
288-
'inspector_service_node_summary.txt',
286+
expect(
287+
treeToDebugString(nodeInSummaryTree),
288+
equals(
289+
equalsGoldenIgnoringHashCodes(
290+
'inspector_service_node_summary.txt',
291+
),
289292
),
290-
),
291-
);
293+
);
292294

293-
await group.dispose();
294-
});
295+
await group.dispose();
296+
});
295297

296-
test('isSummaryTree = false', () async {
297-
await env.setupEnvironment();
298-
final group = inspectorService!.createObjectGroup('test-group');
299-
final root = (await group.getRoot(FlutterTreeType.widget))!;
300-
// Tree contains all widgets.
301-
expect(
302-
treeToDebugString(root),
303-
equals(
304-
equalsGoldenIgnoringHashCodes(
305-
'inspector_service_tree_no_summary.txt',
298+
test('isSummaryTree = false', () async {
299+
await env.setupEnvironment();
300+
final group = inspectorService!.createObjectGroup('test-group');
301+
final root = (await group.getRoot(FlutterTreeType.widget))!;
302+
// Tree contains all widgets.
303+
expect(
304+
treeToDebugString(root),
305+
equals(
306+
equalsGoldenIgnoringHashCodes(
307+
'inspector_service_tree_no_summary.txt',
308+
),
306309
),
307-
),
308-
);
309-
final nodeInTree = findNodeMatching(root, 'MaterialApp')!;
310-
expect(nodeInTree, isNotNull);
311-
expect(
312-
treeToDebugString(nodeInTree),
313-
equals(
314-
equalsGoldenIgnoringHashCodes(
315-
'inspector_service_node_no_summary.txt',
310+
);
311+
final nodeInTree = findNodeMatching(root, 'MaterialApp')!;
312+
expect(nodeInTree, isNotNull);
313+
expect(
314+
treeToDebugString(nodeInTree),
315+
equals(
316+
equalsGoldenIgnoringHashCodes(
317+
'inspector_service_node_no_summary.txt',
318+
),
316319
),
317-
),
318-
);
320+
);
319321

320-
await group.dispose();
321-
});
322+
await group.dispose();
323+
});
322324

323-
test('details tree', () async {
324-
await env.setupEnvironment();
325+
test('details tree', () async {
326+
await env.setupEnvironment();
325327

326-
// First get a node in the summary tree:
327-
final group = inspectorService!.createObjectGroup('test-group');
328-
final root = (await group.getRoot(
329-
FlutterTreeType.widget,
330-
isSummaryTree: true,
331-
))!;
332-
RemoteDiagnosticsNode nodeInSummaryTree = findNodeMatching(
333-
root,
334-
'MaterialApp',
335-
)!;
336-
expect(nodeInSummaryTree, isNotNull);
337-
338-
// Then get the details tree for the node in the summary tree:
339-
RemoteDiagnosticsNode nodeInDetailsTree = (await group
340-
.getDetailsSubtree(nodeInSummaryTree))!;
341-
342-
// When flutter rolls, this string may sometimes change due to
343-
// implementation details.
344-
expect(
345-
treeToDebugStringTruncated(nodeInDetailsTree, 30),
346-
equalsGoldenIgnoringHashCodes('inspector_service_details_tree.txt'),
347-
);
328+
// First get a node in the summary tree:
329+
final group = inspectorService!.createObjectGroup('test-group');
330+
final root = (await group.getRoot(
331+
FlutterTreeType.widget,
332+
isSummaryTree: true,
333+
))!;
334+
RemoteDiagnosticsNode nodeInSummaryTree = findNodeMatching(
335+
root,
336+
'MaterialApp',
337+
)!;
338+
expect(nodeInSummaryTree, isNotNull);
339+
340+
// Then get the details tree for the node in the summary tree:
341+
RemoteDiagnosticsNode nodeInDetailsTree = (await group
342+
.getDetailsSubtree(nodeInSummaryTree))!;
343+
344+
// When flutter rolls, this string may sometimes change due to
345+
// implementation details.
346+
expect(
347+
treeToDebugStringTruncated(nodeInDetailsTree, 30),
348+
equalsGoldenIgnoringHashCodes(
349+
'inspector_service_details_tree.txt',
350+
),
351+
);
348352

349-
nodeInSummaryTree = findNodeMatching(root, 'Text')!;
350-
expect(nodeInSummaryTree, isNotNull);
351-
expect(
352-
treeToDebugString(nodeInSummaryTree),
353-
equalsIgnoringHashCodes('Text\n'),
354-
);
353+
nodeInSummaryTree = findNodeMatching(root, 'Text')!;
354+
expect(nodeInSummaryTree, isNotNull);
355+
expect(
356+
treeToDebugString(nodeInSummaryTree),
357+
equalsIgnoringHashCodes('Text\n'),
358+
);
355359

356-
nodeInDetailsTree = (await group.getDetailsSubtree(
357-
nodeInSummaryTree,
358-
))!;
360+
nodeInDetailsTree = (await group.getDetailsSubtree(
361+
nodeInSummaryTree,
362+
))!;
359363

360-
expect(
361-
treeToDebugString(nodeInDetailsTree),
362-
equalsGoldenIgnoringHashCodes(
363-
'inspector_service_text_details_tree.txt',
364-
),
365-
);
364+
expect(
365+
treeToDebugString(nodeInDetailsTree),
366+
equalsGoldenIgnoringHashCodes(
367+
'inspector_service_text_details_tree.txt',
368+
),
369+
);
366370

367-
expect(
368-
nodeInDetailsTree.valueRef,
369-
equals(nodeInSummaryTree.valueRef),
370-
);
371+
expect(
372+
nodeInDetailsTree.valueRef,
373+
equals(nodeInSummaryTree.valueRef),
374+
);
371375

372-
await group.setSelectionInspector(nodeInDetailsTree.valueRef, true);
373-
final selection = (await group.getSelection(
374-
null,
375-
FlutterTreeType.widget,
376-
))!;
377-
expect(selection, isNotNull);
378-
expect(selection.valueRef, equals(nodeInDetailsTree.valueRef));
379-
expect(
380-
treeToDebugString(selection),
381-
equalsIgnoringHashCodes(
382-
'Text\n'
383-
' └─RichText\n',
384-
),
385-
);
376+
await group.setSelectionInspector(nodeInDetailsTree.valueRef, true);
377+
final selection = (await group.getSelection(
378+
null,
379+
FlutterTreeType.widget,
380+
))!;
381+
expect(selection, isNotNull);
382+
expect(selection.valueRef, equals(nodeInDetailsTree.valueRef));
383+
expect(
384+
treeToDebugString(selection),
385+
equalsIgnoringHashCodes(
386+
'Text\n'
387+
' └─RichText\n',
388+
),
389+
);
386390

387-
await group.dispose();
388-
});
389-
});
391+
await group.dispose();
392+
});
393+
},
394+
// TODO(https://github.com/flutter/devtools/issues/9395): Tests should be
395+
// re-enabled once they are no longer dependant on widget ordering in the
396+
// framework.
397+
skip: true,
398+
);
390399

391400
test('enables hover eval mode by default', () async {
392401
await env.setupEnvironment();

0 commit comments

Comments
 (0)