Skip to content

Commit c455f8e

Browse files
authored
Move conformance test invocation into package:http (#718)
1 parent 0c22930 commit c455f8e

File tree

8 files changed

+29
-82
lines changed

8 files changed

+29
-82
lines changed

.github/workflows/dart.yml

Lines changed: 12 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkgs/http/pubspec.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ dependencies:
1414

1515
dev_dependencies:
1616
fake_async: ^1.2.0
17+
http_client_conformance_tests:
18+
path: ../http_client_conformance_tests/
1719
lints: ^1.0.0
1820
shelf: ^1.1.0
1921
stream_channel: ^2.1.0

pkgs/http_client_conformance_tests/test/browser_client_test.dart renamed to pkgs/http/test/html/client_conformance_test.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ import 'package:test/test.dart';
1111
void main() {
1212
final client = BrowserClient();
1313

14-
group('testAll', () {
15-
testAll(client,
16-
redirectAlwaysAllowed: true,
17-
canStreamRequestBody: false,
18-
canStreamResponseBody: false);
19-
});
14+
testAll(client,
15+
redirectAlwaysAllowed: true,
16+
canStreamRequestBody: false,
17+
canStreamResponseBody: false);
2018
}

pkgs/http_client_conformance_tests/test/io_client_test.dart renamed to pkgs/http/test/io/client_conformance_test.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
@TestOn('!js')
5+
@TestOn('vm')
66

77
import 'package:http/io_client.dart';
88
import 'package:http_client_conformance_tests/http_client_conformance_tests.dart';
@@ -11,7 +11,5 @@ import 'package:test/test.dart';
1111
void main() {
1212
final client = IOClient();
1313

14-
group('testAll', () {
15-
testAll(client);
16-
});
14+
testAll(client);
1715
}

pkgs/http_client_conformance_tests/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ void main() {
3434
});
3535
}
3636
```
37+
38+
**Note**: This package does not have it's own tests, instead it is
39+
exercised by the tests in `package:http`.
Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import 'dart:isolate';
1+
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
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.
24

35
import 'package:stream_channel/stream_channel.dart';
46
import 'package:test/test.dart';
@@ -7,20 +9,7 @@ import 'package:test/test.dart';
79
/// 'redirect_server.dart'.
810
///
911
/// See [spawnHybridUri].
10-
Future<StreamChannel<Object?>> startServer(String fileName) async {
11-
try {
12-
final fileUri = await Isolate.resolvePackageUri(Uri(
12+
Future<StreamChannel<Object?>> startServer(String fileName) async =>
13+
spawnHybridUri(Uri(
1314
scheme: 'package',
1415
path: 'http_client_conformance_tests/src/$fileName'));
15-
if (fileUri == null) {
16-
throw StateError('The package could not be resolved');
17-
}
18-
return spawnHybridUri(fileUri);
19-
// ignore: avoid_catching_errors
20-
} on UnsupportedError {
21-
// The current runtime environment (probably browser) does not support
22-
// `Isolate.resolvePackageUri` so try to use a relative path. This will
23-
// *not* work if `http_client_conformance_tests` is used as a package.
24-
return spawnHybridUri('../lib/src/$fileName');
25-
}
26-
}

pkgs/http_client_conformance_tests/mono_pkg.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,3 @@ stages:
88
- format:
99
sdk:
1010
- dev
11-
- unit_test:
12-
- test: --platform vm
13-
os:
14-
- linux
15-
- test: --platform chrome
16-
os:
17-
- linux

pkgs/http_client_conformance_tests/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ environment:
1111
dependencies:
1212
async: ^2.8.2
1313
http: ^0.13.4
14-
test: ^1.21.1
14+
test: ^1.21.2
1515

1616
dev_dependencies:
1717
lints: ^1.0.0

0 commit comments

Comments
 (0)