Deprecate PhantomJS (#1149)
diff --git a/.travis.yml b/.travis.yml
index e47a486..2880345 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,31 +25,31 @@
env: PKGS="pkgs/test pkgs/test_api pkgs/test_core"
script: ./tool/travis.sh dartfmt dartanalyzer_0
- stage: unit_test
- name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run test --preset travis --total-shards 5 --shard-index 0`"
+ 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`"
dart: dev
os: linux
env: PKGS="pkgs/test"
script: ./tool/travis.sh command_0
- stage: unit_test
- name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run test --preset travis --total-shards 5 --shard-index 1`"
+ 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`"
dart: dev
os: linux
env: PKGS="pkgs/test"
script: ./tool/travis.sh command_1
- stage: unit_test
- name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run test --preset travis --total-shards 5 --shard-index 2`"
+ 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`"
dart: dev
os: linux
env: PKGS="pkgs/test"
script: ./tool/travis.sh command_2
- stage: unit_test
- name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run test --preset travis --total-shards 5 --shard-index 3`"
+ 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`"
dart: dev
os: linux
env: PKGS="pkgs/test"
script: ./tool/travis.sh command_3
- stage: unit_test
- name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run test --preset travis --total-shards 5 --shard-index 4`"
+ 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`"
dart: dev
os: linux
env: PKGS="pkgs/test"
diff --git a/pkgs/test/CHANGELOG.md b/pkgs/test/CHANGELOG.md
index 71b5c96..f493135 100644
--- a/pkgs/test/CHANGELOG.md
+++ b/pkgs/test/CHANGELOG.md
@@ -1,6 +1,8 @@
## 1.11.2-dev
* Bump minimum SDK to `2.4.0` for safer usage of for-loop elements.
+* Deprecate `PhantomJS` and provide warning when used. Support for `PhantomJS`
+ will be removed in version `2.0.0`.
## 1.11.1
diff --git a/pkgs/test/mono_pkg.yaml b/pkgs/test/mono_pkg.yaml
index 1a84bfa..1848903 100644
--- a/pkgs/test/mono_pkg.yaml
+++ b/pkgs/test/mono_pkg.yaml
@@ -11,8 +11,8 @@
- dartanalyzer: --fatal-warnings .
dart: 2.4.0
- unit_test:
- - command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 0
- - command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 1
- - command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 2
- - command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 3
- - command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 4
+ - command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 0
+ - command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 1
+ - command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 2
+ - command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 3
+ - command: xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 4
diff --git a/pkgs/test_core/CHANGELOG.md b/pkgs/test_core/CHANGELOG.md
index 91aa019..e43f0ab 100644
--- a/pkgs/test_core/CHANGELOG.md
+++ b/pkgs/test_core/CHANGELOG.md
@@ -1,6 +1,8 @@
## 0.2.19-dev
* Bump minimum SDK to `2.4.0` for safer usage of for-loop elements.
+* Deprecate `PhantomJS` and provide warning when used. Support for `PhantomJS`
+ will be removed in version `2.0.0`.
## 0.2.18
diff --git a/pkgs/test_core/lib/src/runner/configuration/args.dart b/pkgs/test_core/lib/src/runner/configuration/args.dart
index a5afb82..ed7dd26 100644
--- a/pkgs/test_core/lib/src/runner/configuration/args.dart
+++ b/pkgs/test_core/lib/src/runner/configuration/args.dart
@@ -7,11 +7,12 @@
import 'package:args/args.dart';
import 'package:boolean_selector/boolean_selector.dart';
-
import 'package:test_api/src/backend/runtime.dart'; // ignore: implementation_imports
import 'package:test_api/src/frontend/timeout.dart'; // ignore: implementation_imports
-import '../runtime_selection.dart';
+
+import '../../util/io.dart';
import '../configuration.dart';
+import '../runtime_selection.dart';
import 'reporters.dart';
import 'values.dart';
@@ -225,6 +226,20 @@
return seed;
});
+ var color = _ifParsed<bool>('color') ?? canUseSpecialChars;
+
+ var platform = _ifParsed<List<String>>('platform')
+ ?.map((runtime) => RuntimeSelection(runtime))
+ ?.toList();
+ if (platform
+ ?.any((runtime) => runtime.name == Runtime.phantomJS.identifier) ??
+ false) {
+ var yellow = color ? '\u001b[33m' : '';
+ var noColor = color ? '\u001b[0m' : '';
+ print('${yellow}Warning:$noColor '
+ 'PhatomJS is deprecated and will be removed in version ^2.0.0');
+ }
+
return Configuration(
help: _ifParsed('help'),
version: _ifParsed('version'),
@@ -233,7 +248,7 @@
jsTrace: _ifParsed('js-trace'),
pauseAfterLoad: _ifParsed('pause-after-load'),
debug: _ifParsed('debug'),
- color: _ifParsed('color'),
+ color: color,
configurationPath: _ifParsed('configuration'),
dart2jsPath: _ifParsed('dart2js-path'),
dart2jsArgs: _ifParsed('dart2js-args'),
@@ -247,9 +262,7 @@
totalShards: totalShards,
timeout: _parseOption('timeout', (value) => Timeout.parse(value)),
patterns: patterns,
- runtimes: _ifParsed<List<String>>('platform')
- ?.map((runtime) => RuntimeSelection(runtime))
- ?.toList(),
+ runtimes: platform,
runSkipped: _ifParsed('run-skipped'),
chosenPresets: _ifParsed('preset'),
paths: _options.rest.isEmpty ? null : _options.rest,
diff --git a/tool/travis.sh b/tool/travis.sh
index 51fad7c..7ac5921 100755
--- a/tool/travis.sh
+++ b/tool/travis.sh
@@ -55,24 +55,24 @@
echo -e "\033[1mPKG: ${PKG}; TASK: ${TASK}\033[22m"
case ${TASK} in
command_0)
- echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 0'
- xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 0 || EXIT_CODE=$?
+ echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 0'
+ xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 0 || EXIT_CODE=$?
;;
command_1)
- echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 1'
- xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 1 || EXIT_CODE=$?
+ echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 1'
+ xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 1 || EXIT_CODE=$?
;;
command_2)
- echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 2'
- xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 2 || EXIT_CODE=$?
+ echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 2'
+ xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 2 || EXIT_CODE=$?
;;
command_3)
- echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 3'
- xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 3 || EXIT_CODE=$?
+ echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 3'
+ xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 3 || EXIT_CODE=$?
;;
command_4)
- echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 4'
- xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis --total-shards 5 --shard-index 4 || EXIT_CODE=$?
+ echo 'xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 4'
+ xvfb-run -s "-screen 0 1024x768x24" pub run test --preset travis -x phantomjs --total-shards 5 --shard-index 4 || EXIT_CODE=$?
;;
dartanalyzer_0)
echo 'dartanalyzer --fatal-infos --fatal-warnings .'