Skip to content

Commit

Permalink
Fix the failing cupertino_http tests (#949)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianquinlan committed May 30, 2023
1 parent 8a4a4a6 commit 18a43a2
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 10 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/cupertino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ on:
paths:
- 'pkgs/cupertino_http/**'
- 'pkgs/http_client_conformance_tests/**'
- '.github/workflows/cupertino.yml'
pull_request:
paths:
- 'pkgs/cupertino_http/**'
- 'pkgs/http_client_conformance_tests/**'
- '.github/workflows/cupertino.yml'
schedule:
- cron: "0 0 * * 0"

Expand All @@ -29,9 +31,7 @@ jobs:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
# TODO: Change to 'stable' when a release version of flutter
# pins version 1.21.1 or later of 'package:test'
channel: 'master'
channel: 'stable'
- id: install
name: Install dependencies
run: flutter pub get
Expand All @@ -45,7 +45,7 @@ jobs:
test:
# Test package:cupertino_http use flutter integration tests.
needs: analyze
name: "Build and test (disabled!)"
name: "Build and test"
runs-on: macos-latest
defaults:
run:
Expand All @@ -57,10 +57,18 @@ jobs:
model: 'iPhone 8'
- uses: subosito/flutter-action@v2
with:
# TODO: Change to 'stable' when a release version of flutter
# pins version 1.21.1 or later of 'package:test'
channel: 'master'
channel: 'stable'
- name: Run tests
# TODO: Renable tests when https://github.com/dart-lang/http/issues/938
# is fixed.
run: echo flutter test integration_test/
# TODO: Remove the retries when
# https://github.com/flutter/flutter/issues/121231 is fixed.
# See https://github.com/dart-lang/http/issues/938 for context.
run: |
for i in {1..6}
do
flutter test integration_test/main.dart && break
if [ $i -eq 6 ]
then
exit 1
fi
echo "Retry $i"
done
42 changes: 42 additions & 0 deletions pkgs/cupertino_http/example/integration_test/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// 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.

import 'package:integration_test/integration_test.dart';

import 'client_conformance_test.dart' as client_conformance_test;
import 'data_test.dart' as data_test;
import 'error_test.dart' as error_test;
import 'http_url_response_test.dart' as http_url_response_test;
import 'mutable_data_test.dart' as mutable_data_test;
import 'mutable_url_request_test.dart' as mutable_url_request_test;
import 'url_request_test.dart' as url_request_test;
import 'url_response_test.dart' as url_response_test;
import 'url_session_configuration_test.dart' as url_session_configuration_test;
import 'url_session_delegate_test.dart' as url_session_delegate_test;
import 'url_session_task_test.dart' as url_session_task_test;
import 'url_session_test.dart' as url_session_test;
import 'utils_test.dart' as utils_test;

/// Execute all the tests in this directory.
///
/// This is faster than running each test individually using
/// `flutter test integration_test/` because only one compilation step and
/// application launch is required.
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

client_conformance_test.main();
data_test.main();
error_test.main();
http_url_response_test.main();
mutable_data_test.main();
mutable_url_request_test.main();
url_request_test.main();
url_response_test.main();
url_session_configuration_test.main();
url_session_delegate_test.main();
url_session_task_test.main();
url_session_test.main();
utils_test.main();
}

0 comments on commit 18a43a2

Please sign in to comment.