From 86a490ffe878eeb97393ef762a5cd1ee7df1a61d Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Wed, 5 Apr 2017 12:23:21 -0700 Subject: [PATCH] Tracked skipped tests in technical debt benchmark (#9206) --- dev/devicelab/bin/tasks/technical_debt__cost.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dev/devicelab/bin/tasks/technical_debt__cost.dart b/dev/devicelab/bin/tasks/technical_debt__cost.dart index 14af90134f6..4a7f822cb71 100644 --- a/dev/devicelab/bin/tasks/technical_debt__cost.dart +++ b/dev/devicelab/bin/tasks/technical_debt__cost.dart @@ -13,7 +13,8 @@ import 'package:path/path.dart' as path; // the numbers below are odd, so that the totals don't seem round. :-) const double todoCost = 1009.0; // about two average SWE days, in dollars const double ignoreCost = 2003.0; // four average SWE days, in dollars -const double pythonCost = 3001.0; // six average SWE days, in dollars +const double pythonCost = 3001.0; // six average SWE days, in dollars +const double skipCost = 2473.0; // 20 hours: 5 to fix the issue we're ignoring, 15 to fix the bugs we missed because the test was off final RegExp todoPattern = new RegExp(r'(?://|#) *TODO'); final RegExp ignorePattern = new RegExp(r'// *ignore:'); @@ -25,12 +26,15 @@ Future findCostsForFile(File file) async { path.extension(file.path) != '.yaml' && path.extension(file.path) != '.sh') return 0.0; + final bool isTest = file.path.endsWith('_test.dart'); double total = 0.0; for (String line in await file.readAsLines()) { if (line.contains(todoPattern)) total += todoCost; if (line.contains(ignorePattern)) total += ignoreCost; + if (isTest && line.contains('skip:')) + total += skipCost; } return total; }