-
Notifications
You must be signed in to change notification settings - Fork 719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for PhantomJS 2.0 #3225
Comments
We should have PhantomJS 1.9.8 at the moment. What breaking changes does 2.0 bring? |
@BanzaiMan see the release notes; removal of CoffeeScript support is one breaking change listed there. A big plus for 2.0 is that it is based on a much more recent version of WebKit, which I imagine makes it applicable in more scenarios. |
There is no official binary available yet. (ariya/phantomjs#12948) The process is a major resource hog, and it is not feasible to compile it on the fly. If it's still not available for the next update (1st week of April), we can compile a binary separately for our purposes. |
For those brave souls who want to try PhantomJS 2.0.0 now, you can use https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2. The archive expands to the binary |
PhantomJS fails many tests that pass on PhantomJS 1.9.8 for me, due to the reasons outlined in teampoltergeist/poltergeist#574 / ariya/phantomjs#12506 / teampoltergeist/poltergeist#585 File upload doesn't seem to work consistently. |
@parndt In a way, then, these are expected failures with PhantomJS 2.0.0, correct? |
@BanzaiMan yes, I'm just vocalising objection to upgrading the default version until they're worked out. |
@parndt Got it. I'm leaning towards offering both 1.9.8 and 2.0.0. |
👍 |
👍 |
See travis-ci/travis-cookbooks@e38732d. It will be available as |
Sorry about the high hopes, but we have decided to cancel the 2015-04 updates, due to issues unrelated to PhantomJS 2.0. If you want to use it now, you can grab it from S3 as indicated above. |
@BanzaiMan any update? |
@robcolburn I miss this comment. We are working on the next updates, but we don't have the concrete date for them yet. |
Our test suite fails without Phantom 2. To work around this, we do the following: install:
- mkdir travis-phantomjs
- wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2
- tar -xvf $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -C $PWD/travis-phantomjs
- export PATH=$PWD/travis-phantomjs:$PATH |
I ended up packaging PhantomJS 2.0 from source into a debian file (deb package) to make my life easier. Ubuntu 12.04 64-bit (precise) Ubuntu 14.04 64-bit (trusty) Ubuntu 14.10 64-bit (utopic) I hope this helps someone along the way. |
any update on this? |
As described here travis-ci/travis-ci#3225 (comment)
@harianus I observed this, too. I even saw that Then I remembered that the shell has a cache for where it finds commands. |
Thanks, @nathanl, I updated the script to include |
@harianus Whoops, I had used |
If anybody is worried about downloading the phantomjs binary from an unfamiliar site, you could compare the file hash with the original one. Running If anyone else can attest that this is the correct hash value for the original, please do. |
Here's an installation method that automatically checks the downloaded binary's SHA512 against the one of the official package (as seen by me - others can confirm/deny that it's the correct SHA512). sudo: false
cache:
directories:
- "travis_phantomjs"
before_install:
# Ensure we have newer version of PhantomJS to fix weird test failures from 1.9.8
- export TRAVIS_PHANTOMJS_INSTALL_PATH="$PWD/travis_phantomjs"
- export TRAVIS_PHANTOMJS_VERSION_NAME="phantomjs-2.1.1-linux-x86_64"
- export PATH="$TRAVIS_PHANTOMJS_INSTALL_PATH/$TRAVIS_PHANTOMJS_VERSION_NAME/bin:$PATH"
- hash -d phantomjs || true
- echo "phantomjs version is $(phantomjs --version)"
- if [ $(phantomjs --version) != '2.1.1' ]; then $PWD/bin/travis_get_updated_phantomjs; hash -d phantomjs || true; echo "updated phantomjs version is $(phantomjs --version)"; fi It relies on the presence of #!/usr/bin/env bash
# Script to ensure we're using an updated version of PhantomJS when testing on Travis
set -e
if [ -z "$TRAVIS_PHANTOMJS_INSTALL_PATH" ]; then
echo "must set env var TRAVIS_PHANTOMJS_INSTALL_PATH"
exit 1
fi
if [ -z "$TRAVIS_PHANTOMJS_VERSION_NAME" ]; then
echo "must set env var TRAVIS_PHANTOMJS_VERSION_NAME"
exit 1
fi
BINARY_FILENAME="$TRAVIS_PHANTOMJS_VERSION_NAME.tar.bz2"
DOWNLOAD_FILENAME="$TRAVIS_PHANTOMJS_INSTALL_PATH/$BINARY_FILENAME"
BIN_PATH="$TRAVIS_PHANTOMJS_INSTALL_PATH/$TRAVIS_PHANTOMJS_VERSION_NAME/bin"
EXPECTED_SHA512="039b62ecf2fa4196357e129727871a53b046948e17b21900c78a1af4d0b523e41b9d4137e7454b0a638333d7fc27e65d14f4af8c665e982a504c12f828525419"
rm -rf $TRAVIS_PHANTOMJS_INSTALL_PATH
mkdir -p $TRAVIS_PHANTOMJS_INSTALL_PATH
echo "downloading requested phantomjs binary '$BINARY_FILENAME'"
# download from official location, or failing that, a mirror
# wget is availabile on MacOS via `brew install wget`
wget "https://bitbucket.org/ariya/phantomjs/downloads/$BINARY_FILENAME" -O $DOWNLOAD_FILENAME || wget "https://assets.membergetmember.co/software/$BINARY_FILENAME" -O $DOWNLOAD_FILENAME
# gsha512sum is available on MacOS via `brew install coreutils`
DOWNLOADED_SHA512=$((sha512sum $DOWNLOAD_FILENAME || gsha512sum $DOWNLOAD_FILENAME) | cut -d ' ' -f 1)
if [ "$DOWNLOADED_SHA512" == "$EXPECTED_SHA512" ]; then
echo "download SHA confirmed - unpacking"
tar -xvf "$DOWNLOAD_FILENAME" -C $TRAVIS_PHANTOMJS_INSTALL_PATH
echo "sucessfully installed phantomjs in $TRAVIS_PHANTOMJS_INSTALL_PATH"
else
echo "downloaded file had unexpected SHA512 $DOWNLOADED_SHA512"
exit 1
fi
set +e |
@nathanl It looks like Travis is already using 2.1.1 by default on the |
As this issue calls for PhantomJS 2.0, I'm closing this. Please note that 2.1.1 can also be downloaded from bitbucket.org (http://phantomjs.org/download.html), but this is subject to the rate limiting by bitbucket.org, as previously mentioned. For the base image installation of PhantomJS, see travis-ci/travis-cookbooks#910. When it is generally available, it should be announced in https://docs.travis-ci.com/user/build-environment-updates. |
For our build environment we want to start using PhantomJS 2.0 to address stability problems we are encountering with PhantomJS 1.9.7 randomly crashing. Currently only phantomjs 1.9.7 is available in the build environment. Building phantomjs manually as part of our build is not feasible as it requires us running
apt-get
for the necessarily dependencies, and the build takes multiple hours to run in order to compile phantom JS.It would be great if the PhantomJS 2.0 binary was available in the build environment. I think it would make sense to have multiple ver of phantomjs available, where we could set a property in our
.travis.yml
to select the version we want to use.thanks!
The text was updated successfully, but these errors were encountered: