Enable and fix mac and windows CI (#387)
* Fix test_with_coverage on windows and enable mac and win CI
* Fix workflow
* Fix workflow again
* Increase timeout to fix mac CI
* Fix windows test failures
* Another test_with_coverage_test fix
* Skip chrome_test on windows
diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml
index 6251f43..c8cb613 100644
--- a/.github/workflows/test-package.yml
+++ b/.github/workflows/test-package.yml
@@ -37,7 +37,7 @@
if: always() && steps.install.outcome == 'success'
# Run tests on a matrix consisting of two dimensions:
- # 1. OS: ubuntu-latest, (macos-latest, windows-latest)
+ # 1. OS: ubuntu-latest, macos-latest, windows-latest
# 2. release channel: dev
test:
needs: analyze
@@ -45,8 +45,7 @@
strategy:
fail-fast: false
matrix:
- # Add macos-latest and/or windows-latest if relevant for this package.
- os: [ubuntu-latest]
+ os: [ubuntu-latest, macos-latest, windows-latest]
sdk: [2.15.0, dev]
steps:
- uses: actions/checkout@v2
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 65ad06c..9b568d5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,10 @@
+## 1.3.2
+
+* Fix test_with_coverage listening to an unsupported signal on windows.
+* Fix `--reportOn` on windows using incorrect path separators.
+
## 1.3.1
+
* Fix running `dart pub global run coverage:test_with_coverage` or
`dart run coverage:test_with_coverage`
diff --git a/bin/test_with_coverage.dart b/bin/test_with_coverage.dart
index 53e9a7f..c606931 100644
--- a/bin/test_with_coverage.dart
+++ b/bin/test_with_coverage.dart
@@ -157,7 +157,9 @@
watchExitSignal(ProcessSignal.sighup);
watchExitSignal(ProcessSignal.sigint);
- watchExitSignal(ProcessSignal.sigterm);
+ if (!Platform.isWindows) {
+ watchExitSignal(ProcessSignal.sigterm);
+ }
final serviceUriCompleter = Completer<Uri>();
final testProcess = dartRun([
diff --git a/lib/src/formatter.dart b/lib/src/formatter.dart
index 763fb52..318bd5d 100644
--- a/lib/src/formatter.dart
+++ b/lib/src/formatter.dart
@@ -192,6 +192,7 @@
_PathFilter _getPathFilter(List<String>? reportOn) {
if (reportOn == null) return (String path) => true;
- final absolutePaths = reportOn.map(p.absolute).toList();
- return (String path) => absolutePaths.any((item) => path.startsWith(item));
+ final absolutePaths = reportOn.map(p.canonicalize).toList();
+ return (String path) =>
+ absolutePaths.any((item) => p.canonicalize(path).startsWith(item));
}
diff --git a/pubspec.yaml b/pubspec.yaml
index 9d4dfc9..0aae77c 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: coverage
-version: 1.3.1
+version: 1.3.2
description: Coverage data manipulation and formatting
repository: https://github.com/dart-lang/coverage
diff --git a/test/chrome_test.dart b/test/chrome_test.dart
index 2c378e7..c6fae94 100644
--- a/test/chrome_test.dart
+++ b/test/chrome_test.dart
@@ -2,6 +2,9 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// TODO(#388): Fix and re-enable this test.
+@TestOn('!windows')
+
import 'dart:convert';
import 'dart:io';
diff --git a/test/test_with_coverage_test.dart b/test/test_with_coverage_test.dart
index 241f63b..dc570f1 100644
--- a/test/test_with_coverage_test.dart
+++ b/test/test_with_coverage_test.dart
@@ -31,13 +31,12 @@
assert(_wasSuccessful(localPub));
final globalPub =
- _runSync(['pub', 'global', 'activate', '-s', 'git', _pkgDir]);
+ _runSync(['pub', 'global', 'activate', '-s', 'path', _pkgDir]);
assert(_wasSuccessful(globalPub));
});
tearDownAll(() {
for (final entry in [
- Directory(_pubCachePathInTestPkgSubDir),
Directory(p.join(_testPkgDirPath, '.dart_tool')),
Directory(p.join(_testPkgDirPath, 'coverage')),
File(p.join(_testPkgDirPath, '.packages')),
@@ -75,7 +74,8 @@
void _expectSuccessful(ProcessResult result) {
if (!_wasSuccessful(result)) {
fail(
- "Process excited with exit code: ${result.exitCode}. Stderr: ${result.stderr}",
+ 'Process excited with exit code: '
+ '${result.exitCode}. Stderr: ${result.stderr}',
);
}
}
diff --git a/test/util_test.dart b/test/util_test.dart
index 9717dbc..22d53c1 100644
--- a/test/util_test.dart
+++ b/test/util_test.dart
@@ -47,7 +47,7 @@
return 42;
}
- final safeTimoutDuration = _delay * _failCount * 2;
+ final safeTimoutDuration = _delay * _failCount * 10;
final value = await retry(
failCountTimes,
_delay,