Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: lib/src/runner/engine.dart

Issue 2091173002: Add metadata to messages emitted by live tests. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/src/backend/message.dart ('k') | lib/src/runner/load_suite.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:collection'; 6 import 'dart:collection';
7 7
8 import 'package:async/async.dart' hide Result; 8 import 'package:async/async.dart' hide Result;
9 import 'package:collection/collection.dart'; 9 import 'package:collection/collection.dart';
10 import 'package:pool/pool.dart'; 10 import 'package:pool/pool.dart';
11 11
12 import '../backend/group.dart'; 12 import '../backend/group.dart';
13 import '../backend/group_entry.dart'; 13 import '../backend/group_entry.dart';
14 import '../backend/invoker.dart'; 14 import '../backend/invoker.dart';
15 import '../backend/live_test.dart'; 15 import '../backend/live_test.dart';
16 import '../backend/live_test_controller.dart'; 16 import '../backend/live_test_controller.dart';
17 import '../backend/message.dart';
17 import '../backend/state.dart'; 18 import '../backend/state.dart';
18 import '../backend/test.dart'; 19 import '../backend/test.dart';
19 import '../util/iterable_set.dart'; 20 import '../util/iterable_set.dart';
20 import 'live_suite.dart'; 21 import 'live_suite.dart';
21 import 'live_suite_controller.dart'; 22 import 'live_suite_controller.dart';
22 import 'load_suite.dart'; 23 import 'load_suite.dart';
23 import 'runner_suite.dart'; 24 import 'runner_suite.dart';
24 25
25 /// An [Engine] manages a run that encompasses multiple test suites. 26 /// An [Engine] manages a run that encompasses multiple test suites.
26 /// 27 ///
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 List<Group> parents) { 366 List<Group> parents) {
366 // The netry name will be `null` for the root group. 367 // The netry name will be `null` for the root group.
367 var test = new LocalTest(entry.name ?? "(suite)", entry.metadata, () {}, 368 var test = new LocalTest(entry.name ?? "(suite)", entry.metadata, () {},
368 trace: entry.trace); 369 trace: entry.trace);
369 370
370 var controller; 371 var controller;
371 controller = new LiveTestController( 372 controller = new LiveTestController(
372 suiteController.liveSuite.suite, test, () { 373 suiteController.liveSuite.suite, test, () {
373 controller.setState(const State(Status.running, Result.success)); 374 controller.setState(const State(Status.running, Result.success));
374 controller.setState(const State(Status.running, Result.skipped)); 375 controller.setState(const State(Status.running, Result.skipped));
376
377 if (entry.metadata.skipReason != null) {
378 controller.message(
379 new Message.skip("Skip: ${entry.metadata.skipReason}"));
380 }
381
375 controller.setState(const State(Status.complete, Result.skipped)); 382 controller.setState(const State(Status.complete, Result.skipped));
376 controller.completer.complete(); 383 controller.completer.complete();
377 }, () {}, groups: parents); 384 }, () {}, groups: parents);
378 385
379 return _runLiveTest(suiteController, controller.liveTest); 386 return _runLiveTest(suiteController, controller.liveTest);
380 } 387 }
381 388
382 /// Closes [liveTest] and tells the engine to re-run it once it's done 389 /// Closes [liveTest] and tells the engine to re-run it once it's done
383 /// running. 390 /// running.
384 /// 391 ///
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 var futures = allLiveTests.map((liveTest) => liveTest.close()).toList(); 488 var futures = allLiveTests.map((liveTest) => liveTest.close()).toList();
482 489
483 // Closing the load pool will close the test suites as soon as their tests 490 // Closing the load pool will close the test suites as soon as their tests
484 // are done. For browser suites this is effectively immediate since their 491 // are done. For browser suites this is effectively immediate since their
485 // tests shut down as soon as they're closed, but for VM suites we may need 492 // tests shut down as soon as they're closed, but for VM suites we may need
486 // to wait for tearDowns or tearDownAlls to run. 493 // to wait for tearDowns or tearDownAlls to run.
487 futures.add(_loadPool.close()); 494 futures.add(_loadPool.close());
488 await Future.wait(futures, eagerError: true); 495 await Future.wait(futures, eagerError: true);
489 } 496 }
490 } 497 }
OLDNEW
« no previous file with comments | « lib/src/backend/message.dart ('k') | lib/src/runner/load_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698