Skip to content

Commit

Permalink
add phantomjs to docker && circleci (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uunnamed authored Aug 5, 2020
1 parent e236ed1 commit 6e321fc
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
25 changes: 24 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,30 @@ jobs:
# due to Selenium compatibility. Since we don't use Selenium, we take
# care of installing a recent firefox and geckodriver (see below).
- image: circleci/clojure:lein-2.9.3-browsers

environment:
# PhantomJS requires an OpenSSL config even if it's an empty one,
# else it'll complain about "libssl_conf.so: cannot open shared object file"
# which seems to be a recent bug.
OPENSSL_CONF: /opt/openssl.cnf

steps:
- checkout
- run:
name: Install phantomjs
command: |
PHANTOMJS_VERSION=phantomjs-2.1.1-linux-x86_64 && \
wget --quiet --content-disposition https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOMJS_VERSION.tar.bz2 && \
sudo tar xf $PHANTOMJS_VERSION.tar.bz2 -C /usr/local && \
sudo ln -s /usr/local/$PHANTOMJS_VERSION/bin/phantomjs /usr/local/bin/phantomjs && \
rm $PHANTOMJS_VERSION.tar.bz2
- run:
name: Environment information
command: |
firefox --version
google-chrome --version
chromedriver --version
phantomjs --version
# We want to share the results of "lein deps" between runs.
# We assume that the maven cache can change only if "project.clj"
Expand Down Expand Up @@ -50,12 +66,19 @@ jobs:
command: lein test2junit etaoin.api-test

- run:
name: lein test2junit etaoin.api-test (all but firefox)
name: lein test2junit etaoin.api-test (chrome)
when: always
environment:
ETAOIN_TEST_DRIVERS: "[:chrome]"
command: lein test2junit etaoin.api-test

- run:
name: lein test2junit etaoin.api-test (phantom)
when: always
environment:
ETAOIN_TEST_DRIVERS: "[:phantom]"
command: lein test2junit etaoin.api-test

- run:
when: always
command: lein test2junit etaoin.api-test2
Expand Down
16 changes: 14 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN apt-get -yqq update && \
apt-get -yqq install gnupg2 && \
apt-get -yqq install curl unzip && \
apt-get -yqq install fonts-ipafont-gothic xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic && \
apt-get install -y jq libgconf-2-4 && \
apt-get install -y ca-certificates jq libfontconfig libgconf-2-4 && \
rm -rf /var/lib/apt/lists/*

# Install Chrome WebDriver
Expand Down Expand Up @@ -40,11 +40,23 @@ RUN GECKODRIVER_META="https://api.github.com/repos/mozilla/geckodriver/releases/
chmod +x geckodriver && \
mv geckodriver /usr/local/bin/

# Install PhantomJS
RUN PHANTOMJS_VERSION=phantomjs-2.1.1-linux-x86_64 && \
wget --quiet --content-disposition https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOMJS_VERSION.tar.bz2 && \
tar xf $PHANTOMJS_VERSION.tar.bz2 -C /usr/local && \
ln -s /usr/local/$PHANTOMJS_VERSION/bin/phantomjs /usr/local/bin/phantomjs && \
rm $PHANTOMJS_VERSION.tar.bz2

# PhantomJS requires an OpenSSL config even if it's an empty one,
# else it'll complain about "libssl_conf.so: cannot open shared object file"
# which seems to be a recent bug.
ENV OPENSSL_CONF=/opt/openssl.cnf

WORKDIR /etaoin
COPY ./ ./
RUN lein deps

WORKDIR /
RUN rm -rf /etaoin

ENV ETAOIN_TEST_DRIVERS="[:firefox :chrome]"
ENV ETAOIN_TEST_DRIVERS="[:firefox :chrome :phantom]"

0 comments on commit 6e321fc

Please sign in to comment.