From 8f1041a06a64c21dcf01ee0f6a21255995b865ab Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 11:09:20 -0800 Subject: [PATCH 01/17] Create dart.yml --- .github/workflows/dart.yml | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/dart.yml diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml new file mode 100644 index 0000000..372827d --- /dev/null +++ b/.github/workflows/dart.yml @@ -0,0 +1,41 @@ +name: Dart + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + # Note that this workflow uses the latest stable version of the Dart SDK. + # Docker images for other release channels - like dev and beta - are also + # available. See https://hub.docker.com/r/google/dart/ for the available + # images. + container: + image: google/dart:latest + + steps: + - uses: actions/checkout@v2 + + - name: Print Dart SDK version + run: dart --version + + - name: Install dependencies + run: dart pub get + + # Uncomment this step to verify the use of 'dart format' on each commit. + # - name: Verify formatting + # run: dart format --output=none --set-exit-if-changed . + + # Consider passing '--fatal-infos' for slightly stricter analysis. + - name: Analyze project source + run: dart analyze + + # Your project will need to have tests in test/ and a dependency on + # package:test for this step to succeed. Note that Flutter projects will + # want to change this to 'flutter test'. + - name: Run tests + run: dart test From d3c2a11773d0b10cf3218ccdf522b3371a343820 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 11:41:01 -0800 Subject: [PATCH 02/17] fix runs on --- .github/workflows/dart.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 372827d..4e2d79e 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: [ ubuntu-latest ] # Note that this workflow uses the latest stable version of the Dart SDK. # Docker images for other release channels - like dev and beta - are also From 8144bdc2997b069937f7646ddfa39e1e474a85f3 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 11:52:32 -0800 Subject: [PATCH 03/17] windows --- .github/workflows/dart.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 4e2d79e..44f5b1c 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: [ ubuntu-latest ] + runs-on: [ ubuntu-latest, windows-latest ] # Note that this workflow uses the latest stable version of the Dart SDK. # Docker images for other release channels - like dev and beta - are also From 47e3c8ee5954b1f76064c998fa4050344b645018 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 12:00:07 -0800 Subject: [PATCH 04/17] windows --- .github/workflows/dart.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 44f5b1c..735f06e 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: [ ubuntu-latest, windows-latest ] + runs-on: windows-latest # Note that this workflow uses the latest stable version of the Dart SDK. # Docker images for other release channels - like dev and beta - are also From e74c755b7acf39778bcd2b4fe29ce0ef790ab8a8 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 12:06:33 -0800 Subject: [PATCH 05/17] set up --- .github/workflows/dart.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 735f06e..3395b92 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -8,17 +8,14 @@ on: jobs: build: - runs-on: windows-latest - - # Note that this workflow uses the latest stable version of the Dart SDK. - # Docker images for other release channels - like dev and beta - are also - # available. See https://hub.docker.com/r/google/dart/ for the available - # images. - container: - image: google/dart:latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: cedx/setup-dart@v2 + with: + release-channel: stable + version: latest - name: Print Dart SDK version run: dart --version From 93d57ad0443ee034cd3728f541eb794ef4f8464b Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 12:09:04 -0800 Subject: [PATCH 06/17] windows --- .github/workflows/dart.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 3395b92..bf6eec2 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v2 From af80e236880ea91a861f2b42c4009f39b6d8f921 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 12:10:46 -0800 Subject: [PATCH 07/17] windows --- .github/workflows/dart.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index bf6eec2..2df453b 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: [ubuntu-latest, windows-latest] + runs-on: windows-latest steps: - uses: actions/checkout@v2 From bcac009984b10f73c38d8657527a1481e1523562 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 12:15:58 -0800 Subject: [PATCH 08/17] linux and debug --- .github/workflows/dart.yml | 2 +- lib/src/chrome.dart | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 2df453b..a231950 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: windows-latest + runs-on: linux-latest steps: - uses: actions/checkout@v2 diff --git a/lib/src/chrome.dart b/lib/src/chrome.dart index 2a8b3de..056f752 100644 --- a/lib/src/chrome.dart +++ b/lib/src/chrome.dart @@ -95,13 +95,21 @@ class Chrome { final process = await _startProcess(urls, args: args); // Wait until the DevTools are listening before trying to connect. - await process.stderr - .transform(utf8.decoder) - .transform(const LineSplitter()) - .firstWhere((line) => line.startsWith('DevTools listening')) - .timeout(Duration(seconds: 60), - onTimeout: () => - throw Exception('Unable to connect to Chrome DevTools.')); + var _errorLines = []; + try { + await process.stderr + .transform(utf8.decoder) + .transform(const LineSplitter()) + .firstWhere((line) { + _errorLines.add(line); + return line.startsWith('DevTools listening'); + }).timeout(Duration(seconds: 60), + onTimeout: () => + throw Exception('Unable to connect to Chrome DevTools.')); + } catch (_) { + print(_errorLines); + rethrow; + } return _connect(Chrome._( port, From 174a5a6ce4a33b9fd6b616697dfc84a8bffbe628 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 12:17:28 -0800 Subject: [PATCH 09/17] ubuntu --- .github/workflows/dart.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index a231950..3395b92 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: linux-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From fa7557c69a9dffe163c96d04d5ecfef282af79fe Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 12:24:13 -0800 Subject: [PATCH 10/17] xvfb --- .github/workflows/dart.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 3395b92..8ab1c87 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -31,6 +31,9 @@ jobs: - name: Analyze project source run: dart analyze + - run: sudo apt-get install xvfb + - run: nohup xvfb :99 > /dev/null 2>&1 & + # Your project will need to have tests in test/ and a dependency on # package:test for this step to succeed. Note that Flutter projects will # want to change this to 'flutter test'. From 673376b32d85d3e19a0f9516679ae045fdba92e0 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 12:25:14 -0800 Subject: [PATCH 11/17] fix --- .github/workflows/dart.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 8ab1c87..6288aed 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -31,8 +31,10 @@ jobs: - name: Analyze project source run: dart analyze - - run: sudo apt-get install xvfb - - run: nohup xvfb :99 > /dev/null 2>&1 & + - name: Install XVFB + run: sudo apt-get install xvfb + - name: Run XVFB + run: nohup xvfb :99 > /dev/null 2>&1 & # Your project will need to have tests in test/ and a dependency on # package:test for this step to succeed. Note that Flutter projects will From 1e82fbb549571d3b0bdc15700a2ae405de666d5e Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 12:26:01 -0800 Subject: [PATCH 12/17] syntax --- .github/workflows/dart.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 6288aed..6c38887 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -31,10 +31,10 @@ jobs: - name: Analyze project source run: dart analyze - - name: Install XVFB - run: sudo apt-get install xvfb - - name: Run XVFB - run: nohup xvfb :99 > /dev/null 2>&1 & + - name: Install XVFB + run: sudo apt-get install xvfb + - name: Run XVFB + run: nohup xvfb :99 > /dev/null 2>&1 & # Your project will need to have tests in test/ and a dependency on # package:test for this step to succeed. Note that Flutter projects will From 00d73fe55bf751ff2ec5345863f61d1c9876c9b3 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 12:30:06 -0800 Subject: [PATCH 13/17] run --- .github/workflows/dart.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 6c38887..4ededaf 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -34,7 +34,7 @@ jobs: - name: Install XVFB run: sudo apt-get install xvfb - name: Run XVFB - run: nohup xvfb :99 > /dev/null 2>&1 & + run: nohup xvfb-run :99 > /dev/null 2>&1 & # Your project will need to have tests in test/ and a dependency on # package:test for this step to succeed. Note that Flutter projects will From 0fab33e229a48b267d6fdd909cf3a34b64aba672 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 12:35:06 -0800 Subject: [PATCH 14/17] xvfb --- .github/workflows/dart.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 4ededaf..edadc0a 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -7,9 +7,12 @@ on: branches: [ master ] jobs: - build: + test: runs-on: ubuntu-latest + env: + DISPLAY: ':99' + steps: - uses: actions/checkout@v2 - uses: cedx/setup-dart@v2 @@ -31,10 +34,8 @@ jobs: - name: Analyze project source run: dart analyze - - name: Install XVFB - run: sudo apt-get install xvfb - - name: Run XVFB - run: nohup xvfb-run :99 > /dev/null 2>&1 & + - name: Run Xvfb + run: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & # Your project will need to have tests in test/ and a dependency on # package:test for this step to succeed. Note that Flutter projects will From 5d2111a4fcf4cdbd34f53a74f64b51a6be24b6e7 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 12:36:52 -0800 Subject: [PATCH 15/17] window --- .github/workflows/dart.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index edadc0a..71fb1ea 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -8,7 +8,7 @@ on: jobs: test: - runs-on: ubuntu-latest + runs-on: window-latest env: DISPLAY: ':99' From ddb02f43464fc93ba5c5b5abb8c479f2760c6b21 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 12:37:34 -0800 Subject: [PATCH 16/17] window --- .github/workflows/dart.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 71fb1ea..7d5f08b 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -8,7 +8,7 @@ on: jobs: test: - runs-on: window-latest + runs-on: windows-latest env: DISPLAY: ':99' From 6ace68eab021208fb54fb04e489c584ccd9d7e63 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 3 Dec 2020 14:30:13 -0800 Subject: [PATCH 17/17] remove travis and better error --- .github/workflows/dart.yml | 10 +--------- .travis.yml | 23 ----------------------- CHANGELOG.md | 4 ++++ lib/src/chrome.dart | 9 ++++----- pubspec.yaml | 2 +- 5 files changed, 10 insertions(+), 38 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 7d5f08b..d667bc8 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -8,7 +8,7 @@ on: jobs: test: - runs-on: windows-latest + runs-on: ubuntu-latest env: DISPLAY: ':99' @@ -26,19 +26,11 @@ jobs: - name: Install dependencies run: dart pub get - # Uncomment this step to verify the use of 'dart format' on each commit. - # - name: Verify formatting - # run: dart format --output=none --set-exit-if-changed . - - # Consider passing '--fatal-infos' for slightly stricter analysis. - name: Analyze project source run: dart analyze - name: Run Xvfb run: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - # Your project will need to have tests in test/ and a dependency on - # package:test for this step to succeed. Note that Flutter projects will - # want to change this to 'flutter test'. - name: Run tests run: dart test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b4e1991..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: dart - -dart: - - 2.2.0 - - dev - -dart_task: - - test - - dartanalyzer: --fatal-infos --fatal-warnings . - -matrix: - include: - # Only validate formatting using the dev release - - dart: dev - dart_task: dartfmt - -# Only building master means that we don't run two builds for each pull request. -branches: - only: [master] - -cache: - directories: - - $HOME/.pub-cache diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bfd551..9f9759a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.8 + +- Log `STDERR` on Chrome launch failure. + ## 0.1.7 - Widen the dependency range on `package:webkit_inspection_protocol`. diff --git a/lib/src/chrome.dart b/lib/src/chrome.dart index 056f752..bfa4270 100644 --- a/lib/src/chrome.dart +++ b/lib/src/chrome.dart @@ -103,12 +103,11 @@ class Chrome { .firstWhere((line) { _errorLines.add(line); return line.startsWith('DevTools listening'); - }).timeout(Duration(seconds: 60), - onTimeout: () => - throw Exception('Unable to connect to Chrome DevTools.')); + }).timeout(Duration(seconds: 60)); } catch (_) { - print(_errorLines); - rethrow; + throw Exception('Unable to connect to Chrome DevTools.\n\n' + 'Chrome STDERR:\n' + + _errorLines.join('\n')); } return _connect(Chrome._( diff --git a/pubspec.yaml b/pubspec.yaml index 17b8822..1d8367b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: browser_launcher description: Provides a standardized way to launch web browsers for testing and tools. -version: 0.1.7 +version: 0.1.8 homepage: https://github.com/dart-lang/browser_launcher