Skip to content

Commit 1266870

Browse files
authored
Deprecate PhantomJS (#1149)
1 parent d30c16f commit 1266870

File tree

6 files changed

+43
-26
lines changed

6 files changed

+43
-26
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,31 @@ jobs:
2525
env: PKGS="pkgs/test pkgs/test_api pkgs/test_core"
2626
script: ./tool/travis.sh dartfmt dartanalyzer_0
2727
- stage: unit_test
28-
name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run test --preset travis --total-shards 5 --shard-index 0`"
28+
name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 0`"
2929
dart: dev
3030
os: linux
3131
env: PKGS="pkgs/test"
3232
script: ./tool/travis.sh command_0
3333
- stage: unit_test
34-
name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run test --preset travis --total-shards 5 --shard-index 1`"
34+
name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 1`"
3535
dart: dev
3636
os: linux
3737
env: PKGS="pkgs/test"
3838
script: ./tool/travis.sh command_1
3939
- stage: unit_test
40-
name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run test --preset travis --total-shards 5 --shard-index 2`"
40+
name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 2`"
4141
dart: dev
4242
os: linux
4343
env: PKGS="pkgs/test"
4444
script: ./tool/travis.sh command_2
4545
- stage: unit_test
46-
name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run test --preset travis --total-shards 5 --shard-index 3`"
46+
name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 3`"
4747
dart: dev
4848
os: linux
4949
env: PKGS="pkgs/test"
5050
script: ./tool/travis.sh command_3
5151
- stage: unit_test
52-
name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run test --preset travis --total-shards 5 --shard-index 4`"
52+
name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 4`"
5353
dart: dev
5454
os: linux
5555
env: PKGS="pkgs/test"

pkgs/test/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
## 1.11.2-dev
22

33
* Bump minimum SDK to `2.4.0` for safer usage of for-loop elements.
4+
* Deprecate `PhantomJS` and provide warning when used. Support for `PhantomJS`
5+
will be removed in version `2.0.0`.
46

57
## 1.11.1
68

pkgs/test/mono_pkg.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ stages:
1111
- dartanalyzer: --fatal-warnings .
1212
dart: 2.4.0
1313
- unit_test:
14-
- command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 0
15-
- command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 1
16-
- command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 2
17-
- command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 3
18-
- command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 4
14+
- command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 0
15+
- command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 1
16+
- command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 2
17+
- command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 3
18+
- command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 4

pkgs/test_core/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
## 0.2.19-dev
22

33
* Bump minimum SDK to `2.4.0` for safer usage of for-loop elements.
4+
* Deprecate `PhantomJS` and provide warning when used. Support for `PhantomJS`
5+
will be removed in version `2.0.0`.
46

57
## 0.2.18
68

pkgs/test_core/lib/src/runner/configuration/args.dart

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ import 'dart:math';
77

88
import 'package:args/args.dart';
99
import 'package:boolean_selector/boolean_selector.dart';
10-
1110
import 'package:test_api/src/backend/runtime.dart'; // ignore: implementation_imports
1211
import 'package:test_api/src/frontend/timeout.dart'; // ignore: implementation_imports
13-
import '../runtime_selection.dart';
12+
13+
import '../../util/io.dart';
1414
import '../configuration.dart';
15+
import '../runtime_selection.dart';
1516
import 'reporters.dart';
1617
import 'values.dart';
1718

@@ -225,6 +226,20 @@ class _Parser {
225226
return seed;
226227
});
227228

229+
var color = _ifParsed<bool>('color') ?? canUseSpecialChars;
230+
231+
var platform = _ifParsed<List<String>>('platform')
232+
?.map((runtime) => RuntimeSelection(runtime))
233+
?.toList();
234+
if (platform
235+
?.any((runtime) => runtime.name == Runtime.phantomJS.identifier) ??
236+
false) {
237+
var yellow = color ? '\u001b[33m' : '';
238+
var noColor = color ? '\u001b[0m' : '';
239+
print('${yellow}Warning:$noColor '
240+
'PhatomJS is deprecated and will be removed in version ^2.0.0');
241+
}
242+
228243
return Configuration(
229244
help: _ifParsed('help'),
230245
version: _ifParsed('version'),
@@ -233,7 +248,7 @@ class _Parser {
233248
jsTrace: _ifParsed('js-trace'),
234249
pauseAfterLoad: _ifParsed('pause-after-load'),
235250
debug: _ifParsed('debug'),
236-
color: _ifParsed('color'),
251+
color: color,
237252
configurationPath: _ifParsed('configuration'),
238253
dart2jsPath: _ifParsed('dart2js-path'),
239254
dart2jsArgs: _ifParsed('dart2js-args'),
@@ -247,9 +262,7 @@ class _Parser {
247262
totalShards: totalShards,
248263
timeout: _parseOption('timeout', (value) => Timeout.parse(value)),
249264
patterns: patterns,
250-
runtimes: _ifParsed<List<String>>('platform')
251-
?.map((runtime) => RuntimeSelection(runtime))
252-
?.toList(),
265+
runtimes: platform,
253266
runSkipped: _ifParsed('run-skipped'),
254267
chosenPresets: _ifParsed('preset'),
255268
paths: _options.rest.isEmpty ? null : _options.rest,

tool/travis.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,24 @@ for PKG in ${PKGS}; do
5555
echo -e "\033[1mPKG: ${PKG}; TASK: ${TASK}\033[22m"
5656
case ${TASK} in
5757
command_0)
58-
echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 0'
59-
xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 0 || EXIT_CODE=$?
58+
echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 0'
59+
xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 0 || EXIT_CODE=$?
6060
;;
6161
command_1)
62-
echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 1'
63-
xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 1 || EXIT_CODE=$?
62+
echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 1'
63+
xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 1 || EXIT_CODE=$?
6464
;;
6565
command_2)
66-
echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 2'
67-
xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 2 || EXIT_CODE=$?
66+
echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 2'
67+
xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 2 || EXIT_CODE=$?
6868
;;
6969
command_3)
70-
echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 3'
71-
xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 3 || EXIT_CODE=$?
70+
echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 3'
71+
xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 3 || EXIT_CODE=$?
7272
;;
7373
command_4)
74-
echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 4'
75-
xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 4 || EXIT_CODE=$?
74+
echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 4'
75+
xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 4 || EXIT_CODE=$?
7676
;;
7777
dartanalyzer_0)
7878
echo 'dartanalyzer --fatal-infos --fatal-warnings .'

0 commit comments

Comments
 (0)