Commit ed2c24ba authored by Adam Barth's avatar Adam Barth Committed by GitHub

Add coveralls support to Travis (#4690)

This patch causes us to upload a coverage report to coveralls.io.
parent 0f2c3dc0
...@@ -6,10 +6,14 @@ addons: ...@@ -6,10 +6,14 @@ addons:
- ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version - ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version
packages: packages:
- libstdc++6 - libstdc++6
install:
- gem install coveralls-lcov
before_script: before_script:
- ./dev/bots/setup.sh - ./dev/bots/setup.sh
script: script:
- ./dev/bots/test.sh - ./dev/bots/test.sh
after_success:
- coveralls-lcov packages/flutter/coverage/lcov.info
cache: cache:
directories: directories:
- $HOME/.pub-cache - $HOME/.pub-cache
...@@ -23,8 +23,13 @@ flutter analyze --flutter-repo ...@@ -23,8 +23,13 @@ flutter analyze --flutter-repo
(cd dev/automated_tests; ! flutter test test_smoke_test/fail_test.dart > /dev/null) (cd dev/automated_tests; ! flutter test test_smoke_test/fail_test.dart > /dev/null)
(cd dev/automated_tests; flutter test test_smoke_test/pass_test.dart > /dev/null) (cd dev/automated_tests; flutter test test_smoke_test/pass_test.dart > /dev/null)
COVERAGE_FLAG=
if [ -n $TRAVIS ]; then
COVERAGE_FLAG=--coverage
fi
# run tests # run tests
(cd packages/flutter; flutter test) (cd packages/flutter; flutter test $COVERAGE_FLAG)
(cd packages/flutter_driver; dart -c test/all.dart) (cd packages/flutter_driver; dart -c test/all.dart)
(cd packages/flutter_sprites; flutter test) (cd packages/flutter_sprites; flutter test)
(cd packages/flutter_test; flutter test) (cd packages/flutter_test; flutter test)
......
...@@ -8,6 +8,7 @@ import 'dart:io'; ...@@ -8,6 +8,7 @@ import 'dart:io';
import 'package:coverage/coverage.dart'; import 'package:coverage/coverage.dart';
import 'package:path/path.dart' as path; import 'package:path/path.dart' as path;
import '../dart/package_map.dart';
import '../globals.dart'; import '../globals.dart';
class CoverageCollector { class CoverageCollector {
...@@ -61,9 +62,7 @@ class CoverageCollector { ...@@ -61,9 +62,7 @@ class CoverageCollector {
assert(enabled); assert(enabled);
await finishPendingJobs(); await finishPendingJobs();
printTrace('formating coverage data'); printTrace('formating coverage data');
// TODO(abarth): Use PackageMap.globalPackagesPath once Resolver resolver = new Resolver(packagesPath: PackageMap.globalPackagesPath);
// https://github.com/dart-lang/coverage/issues/100 is fixed.
Resolver resolver = new Resolver(packageRoot: path.absolute('packages'));
Formatter formater = new LcovFormatter(resolver); Formatter formater = new LcovFormatter(resolver);
List<String> reportOn = <String>[path.join(Directory.current.path, 'lib')]; List<String> reportOn = <String>[path.join(Directory.current.path, 'lib')];
return await formater.format(_globalHitmap, reportOn: reportOn); return await formater.format(_globalHitmap, reportOn: reportOn);
......
...@@ -10,7 +10,7 @@ environment: ...@@ -10,7 +10,7 @@ environment:
dependencies: dependencies:
archive: ^1.0.20 archive: ^1.0.20
args: ^0.13.4 args: ^0.13.4
coverage: ^0.7.7 coverage: ^0.7.8
crypto: '>=1.1.1 <3.0.0' crypto: '>=1.1.1 <3.0.0'
file: ^0.1.0 file: ^0.1.0
http: ^0.11.3 http: ^0.11.3
...@@ -18,7 +18,7 @@ dependencies: ...@@ -18,7 +18,7 @@ dependencies:
json_schema: ^1.0.3 json_schema: ^1.0.3
linter: ^0.1.17 linter: ^0.1.17
mustache4dart: ^1.0.0 mustache4dart: ^1.0.0
package_config: ^0.1.3 package_config: '>=0.1.5 <2.0.0'
path: ^1.3.0 path: ^1.3.0
pub_semver: ^1.0.0 pub_semver: ^1.0.0
stack_trace: ^1.4.0 stack_trace: ^1.4.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment