Skip to content

Commit 983507e

Browse files
committed
Move screenshot-related utilities to a separate package.
1 parent 5cd7efd commit 983507e

21 files changed

+152
-68
lines changed

.github/workflows/dart.yml

Lines changed: 63 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,16 @@ jobs:
152152
if: "always() && steps.pkg_web_css_pub_get.conclusion == 'success'"
153153
working-directory: pkg/web_css
154154
job_003:
155-
name: "smoke_test; PKG: pkg/indexed_blob; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
155+
name: "smoke_test; PKGS: pkg/indexed_blob, pkg/screenshot_tools; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
156156
runs-on: ubuntu-latest
157157
steps:
158158
- name: Cache Pub hosted dependencies
159159
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf
160160
with:
161161
path: "~/.pub-cache/hosted"
162-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.9.0;packages:pkg/indexed_blob;commands:format-analyze_1"
162+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.9.0;packages:pkg/indexed_blob-pkg/screenshot_tools;commands:format-analyze_1"
163163
restore-keys: |
164-
os:ubuntu-latest;pub-cache-hosted;sdk:3.9.0;packages:pkg/indexed_blob
164+
os:ubuntu-latest;pub-cache-hosted;sdk:3.9.0;packages:pkg/indexed_blob-pkg/screenshot_tools
165165
os:ubuntu-latest;pub-cache-hosted;sdk:3.9.0
166166
os:ubuntu-latest;pub-cache-hosted
167167
os:ubuntu-latest
@@ -185,6 +185,19 @@ jobs:
185185
run: dart analyze --fatal-infos .
186186
if: "always() && steps.pkg_indexed_blob_pub_get.conclusion == 'success'"
187187
working-directory: pkg/indexed_blob
188+
- id: pkg_screenshot_tools_pub_get
189+
name: pkg/screenshot_tools; dart pub get
190+
run: dart pub get
191+
if: "always() && steps.checkout.conclusion == 'success'"
192+
working-directory: pkg/screenshot_tools
193+
- name: "pkg/screenshot_tools; dart format --output=none --set-exit-if-changed ."
194+
run: "dart format --output=none --set-exit-if-changed ."
195+
if: "always() && steps.pkg_screenshot_tools_pub_get.conclusion == 'success'"
196+
working-directory: pkg/screenshot_tools
197+
- name: "pkg/screenshot_tools; dart analyze --fatal-infos ."
198+
run: dart analyze --fatal-infos .
199+
if: "always() && steps.pkg_screenshot_tools_pub_get.conclusion == 'success'"
200+
working-directory: pkg/screenshot_tools
188201
job_004:
189202
name: "smoke_test; PKG: pkg/pub_integration; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos lib/`, `dart analyze --fatal-infos test/`"
190203
runs-on: ubuntu-latest
@@ -872,6 +885,45 @@ jobs:
872885
- job_007
873886
- job_008
874887
job_021:
888+
name: "unit_test; PKG: pkg/screenshot_tools; `dart test --run-skipped`"
889+
runs-on: ubuntu-latest
890+
steps:
891+
- name: Cache Pub hosted dependencies
892+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf
893+
with:
894+
path: "~/.pub-cache/hosted"
895+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.9.0;packages:pkg/screenshot_tools;commands:test_09"
896+
restore-keys: |
897+
os:ubuntu-latest;pub-cache-hosted;sdk:3.9.0;packages:pkg/screenshot_tools
898+
os:ubuntu-latest;pub-cache-hosted;sdk:3.9.0
899+
os:ubuntu-latest;pub-cache-hosted
900+
os:ubuntu-latest
901+
- name: Setup Dart SDK
902+
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
903+
with:
904+
sdk: "3.9.0"
905+
- id: checkout
906+
name: Checkout repository
907+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
908+
- id: pkg_screenshot_tools_pub_get
909+
name: pkg/screenshot_tools; dart pub get
910+
run: dart pub get
911+
if: "always() && steps.checkout.conclusion == 'success'"
912+
working-directory: pkg/screenshot_tools
913+
- name: "pkg/screenshot_tools; dart test --run-skipped"
914+
run: dart test --run-skipped
915+
if: "always() && steps.pkg_screenshot_tools_pub_get.conclusion == 'success'"
916+
working-directory: pkg/screenshot_tools
917+
needs:
918+
- job_001
919+
- job_002
920+
- job_003
921+
- job_004
922+
- job_005
923+
- job_006
924+
- job_007
925+
- job_008
926+
job_022:
875927
name: "unit_test; PKG: pkg/web_app; `dart test --run-skipped`"
876928
runs-on: ubuntu-latest
877929
steps:
@@ -910,7 +962,7 @@ jobs:
910962
- job_006
911963
- job_007
912964
- job_008
913-
job_022:
965+
job_023:
914966
name: "unit_test; PKG: pkg/web_css; `dart test --run-skipped`"
915967
runs-on: ubuntu-latest
916968
steps:
@@ -949,7 +1001,7 @@ jobs:
9491001
- job_006
9501002
- job_007
9511003
- job_008
952-
job_023:
1004+
job_024:
9531005
name: "unit_test; PKG: pkg/pub_integration; `dart test -j1 --run-skipped `find test -name \"*_test\\\\.dart\" | sort | sed -n '0~4p'``"
9541006
runs-on: ubuntu-latest
9551007
steps:
@@ -988,7 +1040,7 @@ jobs:
9881040
- job_006
9891041
- job_007
9901042
- job_008
991-
job_024:
1043+
job_025:
9921044
name: "unit_test; PKG: pkg/pub_integration; `dart test -j1 --run-skipped `find test -name \"*_test\\\\.dart\" | sort | sed -n '1~4p'``"
9931045
runs-on: ubuntu-latest
9941046
steps:
@@ -1027,7 +1079,7 @@ jobs:
10271079
- job_006
10281080
- job_007
10291081
- job_008
1030-
job_025:
1082+
job_026:
10311083
name: "unit_test; PKG: pkg/pub_integration; `dart test -j1 --run-skipped `find test -name \"*_test\\\\.dart\" | sort | sed -n '2~4p'``"
10321084
runs-on: ubuntu-latest
10331085
steps:
@@ -1066,7 +1118,7 @@ jobs:
10661118
- job_006
10671119
- job_007
10681120
- job_008
1069-
job_026:
1121+
job_027:
10701122
name: "unit_test; PKG: pkg/pub_integration; `dart test -j1 --run-skipped `find test -name \"*_test\\\\.dart\" | sort | sed -n '3~4p'``"
10711123
runs-on: ubuntu-latest
10721124
steps:
@@ -1105,7 +1157,7 @@ jobs:
11051157
- job_006
11061158
- job_007
11071159
- job_008
1108-
job_027:
1160+
job_028:
11091161
name: "unit_test; PKG: pkg/pub_worker; `dart test --run-skipped --concurrency=1 `find test -name \"*_test\\\\.dart\" | sort | sed -n '0~3p'``"
11101162
runs-on: ubuntu-latest
11111163
steps:
@@ -1144,7 +1196,7 @@ jobs:
11441196
- job_006
11451197
- job_007
11461198
- job_008
1147-
job_028:
1199+
job_029:
11481200
name: "unit_test; PKG: pkg/pub_worker; `dart test --run-skipped --concurrency=1 `find test -name \"*_test\\\\.dart\" | sort | sed -n '1~3p'``"
11491201
runs-on: ubuntu-latest
11501202
steps:
@@ -1183,7 +1235,7 @@ jobs:
11831235
- job_006
11841236
- job_007
11851237
- job_008
1186-
job_029:
1238+
job_030:
11871239
name: "unit_test; PKG: pkg/pub_worker; `dart test --run-skipped --concurrency=1 `find test -name \"*_test\\\\.dart\" | sort | sed -n '2~3p'``"
11881240
runs-on: ubuntu-latest
11891241
steps:

pkg/pub_integration/README.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

pkg/pub_integration/lib/src/pub_puppeteer_helpers.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import 'dart:async';
55

66
import 'package:puppeteer/puppeteer.dart';
7+
import 'package:screenshot_tools/screenshot_utils.dart';
78

8-
import 'screenshot_utils.dart';
99
import 'test_browser.dart';
1010

1111
const webmastersReadonlyScope =

pkg/pub_integration/lib/src/test_browser.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import 'package:_pub_shared/validation/html/html_validation.dart';
1010
import 'package:path/path.dart' as p;
1111
import 'package:puppeteer/puppeteer.dart';
1212
import 'package:retry/retry.dart';
13-
14-
import 'screenshot_utils.dart';
13+
import 'package:screenshot_tools/screenshot_utils.dart';
1514

1615
/// Creates and tracks the headless Chrome environment, its temp directories and
1716
/// and uncaught exceptions.

pkg/pub_integration/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ dependencies:
1414
pub_semver: ^2.0.0
1515
puppeteer: 3.16.0
1616
retry: ^3.1.2
17+
screenshot_tools:
1718
oauth2: ^2.0.0
1819

1920
dev_dependencies:
2021
coverage: any # test already depends on it
21-
markdown: ^7.3.0
2222
pubspec_parse: ^1.5.0
2323
shelf: ^1.4.0
2424
test: ^1.16.5

pkg/pub_integration/test/browser_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import 'dart:convert';
77
import 'package:http/http.dart' as http;
88
import 'package:pub_integration/src/fake_test_context_provider.dart';
99
import 'package:pub_integration/src/pub_puppeteer_helpers.dart';
10-
import 'package:pub_integration/src/screenshot_utils.dart';
1110
import 'package:pub_integration/src/test_browser.dart';
1211
import 'package:puppeteer/puppeteer.dart';
12+
import 'package:screenshot_tools/screenshot_utils.dart';
1313
import 'package:test/test.dart';
1414

1515
void main() {

pkg/pub_integration/test/dartdoc_search_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import 'dart:convert';
66

77
import 'package:http/http.dart' as http;
88
import 'package:pub_integration/src/fake_test_context_provider.dart';
9-
import 'package:pub_integration/src/screenshot_utils.dart';
109
import 'package:pub_integration/src/test_browser.dart';
1110
import 'package:puppeteer/puppeteer.dart';
11+
import 'package:screenshot_tools/screenshot_utils.dart';
1212
import 'package:test/test.dart';
1313

1414
void main() {

pkg/pub_integration/test/fake_sign_in_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import 'dart:convert';
66

77
import 'package:http/http.dart' as http;
88
import 'package:pub_integration/src/fake_test_context_provider.dart';
9-
import 'package:pub_integration/src/screenshot_utils.dart';
109
import 'package:pub_integration/src/test_browser.dart';
10+
import 'package:screenshot_tools/screenshot_utils.dart';
1111
import 'package:test/test.dart';
1212

1313
void main() {

pkg/pub_integration/test/pkg_admin_page_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import 'dart:io' show Platform;
99
import 'package:http/http.dart' as http;
1010
import 'package:pub_integration/src/fake_test_context_provider.dart';
1111
import 'package:pub_integration/src/pub_puppeteer_helpers.dart';
12-
import 'package:pub_integration/src/screenshot_utils.dart';
1312
import 'package:pub_integration/src/test_browser.dart';
13+
import 'package:screenshot_tools/screenshot_utils.dart';
1414
import 'package:test/test.dart';
1515

1616
void main() {

pkg/pub_integration/test/report_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import 'package:_pub_shared/data/admin_api.dart';
88
import 'package:http/http.dart' as http;
99
import 'package:pub_integration/src/fake_test_context_provider.dart';
1010
import 'package:pub_integration/src/pub_puppeteer_helpers.dart';
11-
import 'package:pub_integration/src/screenshot_utils.dart';
1211
import 'package:pub_integration/src/test_browser.dart';
12+
import 'package:screenshot_tools/screenshot_utils.dart';
1313
import 'package:test/test.dart';
1414

1515
final _caseIdExpr = RegExp(r'[0-9]{8}I[0-9a-f]{10}');

0 commit comments

Comments
 (0)