Skip to content

Commit 0ef7672

Browse files
committed
pivot strategy: visual testing will only be run on ubuntu via docker (and travis)
1 parent 052f044 commit 0ef7672

274 files changed

Lines changed: 394 additions & 315 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,13 @@ matrix:
88
include:
99
- r: devel
1010
- r: release
11-
env: USE_VDIFFR=true
11+
env: VDIFFR=true
1212
- r: oldrel
13-
- os: osx
14-
r: release
15-
env: USE_VDIFFR=true
1613

17-
1814
env:
1915
global:
2016
# don't treat missing suggested packages as error
2117
- _R_CHECK_FORCE_SUGGESTS_=false
22-
# switch off vdiffr by default
23-
- USE_VDIFFR=false
2418
# plotly_api_key (for posting to plot.ly)
2519
- secure: "WsvmMHN4YVhnk0bLRE04APcLbs5s4vWKSHjEdU0bPXd0xdMTzZeP5D7pxyF1983C+P5LpSnGHv4dgwLMBkNzxJwBR7/Ta7lfO1akYILWwxib+1DVbCqUH5Z4Ba1FSCQptIrLNGR3P7+0Lem4hEhqKdPKltFnxhnXO0Y+MeG71IQ="
2620
# MAPBOX_TOKEN (for testing `plot_mapbox()`)
@@ -29,24 +23,22 @@ env:
2923
before_install:
3024
- echo "Sys.setenv('plotly_username' = 'cpsievert')" > ~/.Rprofile
3125
# sf system dependencies
32-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable --yes; fi
33-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get --yes --force-yes update -qq; fi
34-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --yes libudunits2-dev libproj-dev libgeos-dev libgdal-dev; fi
26+
- sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable --yes
27+
- sudo apt-get --yes --force-yes update -qq
28+
- sudo apt-get install --yes libudunits2-dev libproj-dev libgeos-dev libgdal-dev
3529
# orca system dependencies -- https://github.com/plotly/orca/#linux-troubleshooting-cannot-open-shared-object
36-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -; fi
37-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'; fi
38-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; fi
39-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --yes libgtk2.0-0 libgconf-2-4 google-chrome-stable desktop-file-utils; fi
30+
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
31+
- sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
32+
- sudo apt-get update
33+
- sudo apt-get install --yes libgtk2.0-0 libgconf-2-4 google-chrome-stable desktop-file-utils
4034
# Setup orca AppImage as a executable binary on linux
41-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/plotly/orca/releases/download/v1.1.1/orca-1.1.1-x86_64.AppImage -P $HOME; fi
42-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then chmod 777 $HOME/orca-1.1.1-x86_64.AppImage ; fi
43-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir /home/travis/.orca; fi
44-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir /home/travis/.orca/bin; fi
45-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then printf '#!/bin/bash \nxvfb-run --auto-servernum --server-args "-screen 0 640x480x24" $HOME/orca-1.1.1-x86_64.AppImage "$@"' > /home/travis/.orca/bin/orca; fi
46-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then chmod 777 /home/travis/.orca/bin/orca; fi
47-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PATH="$PATH:/home/travis/.orca/bin"; fi
48-
# install orca on mac
49-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then npm install -g [email protected] orca; fi
35+
- wget https://github.com/plotly/orca/releases/download/v1.1.1/orca-1.1.1-x86_64.AppImage -P $HOME
36+
- chmod 777 $HOME/orca-1.1.1-x86_64.AppImage
37+
- mkdir /home/travis/.orca
38+
- mkdir /home/travis/.orca/bin
39+
- printf '#!/bin/bash \nxvfb-run --auto-servernum --server-args "-screen 0 640x480x24" $HOME/orca-1.1.1-x86_64.AppImage "$@"' > /home/travis/.orca/bin/orca
40+
- chmod 777 /home/travis/.orca/bin/orca
41+
- export PATH="$PATH:/home/travis/.orca/bin"
5042
# make sure R pkgs are upt-to-date
5143
- Rscript -e 'update.packages(ask = FALSE)'
5244

Dockerfile

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# IMPORTANT: for this to work you need the --privileged
2+
#
3+
# docker build -t plotly-orca .
4+
# docker run --privileged -p 3838:3838 plotly-orca
5+
6+
FROM ubuntu:16.04
7+
MAINTAINER Carson Sievert "[email protected]"
8+
9+
# Don't print "debconf: unable to initialize frontend: Dialog" messages
10+
ARG DEBIAN_FRONTED=noninteractive
11+
12+
# Need this to add R repo
13+
RUN apt-get update && apt-get install -y software-properties-common
14+
15+
# Add R apt repository
16+
RUN add-apt-repository "deb http://cran.r-project.org/bin/linux/ubuntu $(lsb_release -cs)/"
17+
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0x51716619e084dab9
18+
19+
# Install basic stuff and R
20+
RUN apt-get update && apt-get install -y \
21+
sudo \
22+
git \
23+
vim-tiny \
24+
nano \
25+
wget \
26+
r-base \
27+
r-base-dev \
28+
r-recommended \
29+
fonts-texgyre \
30+
texinfo \
31+
locales \
32+
libcurl4-gnutls-dev \
33+
libcairo2-dev \
34+
libxt-dev \
35+
libssl-dev \
36+
libxml2-dev
37+
38+
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
39+
&& locale-gen en_US.utf8 \
40+
&& /usr/sbin/update-locale LANG=en_US.UTF-8
41+
ENV LANG=en_US.UTF-8
42+
43+
# Rprofile
44+
RUN echo 'options(\n\
45+
repos = c(CRAN = "https://cloud.r-project.org/"),\n\
46+
download.file.method = "libcurl",\n\
47+
Ncpus = parallel::detectCores(logical=FALSE),\n\
48+
shiny.host = "0.0.0.0", shiny.port = 3838\n\
49+
)' >> /etc/R/Rprofile.site
50+
51+
# Update R packages
52+
RUN R -e "update.packages(ask = F)"
53+
54+
# Create docker user with empty password (will have uid and gid 1000)
55+
RUN useradd --create-home --shell /bin/bash docker \
56+
&& passwd docker -d \
57+
&& adduser docker sudo
58+
59+
# system dependencies related to running orca
60+
RUN apt-get install -y \
61+
libgtk2.0-0 \
62+
libgconf-2-4 \
63+
xvfb \
64+
fuse \
65+
desktop-file-utils
66+
67+
# google chrome
68+
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
69+
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' && \
70+
apt-get update -y && \
71+
apt-get install -y google-chrome-stable
72+
73+
# Download orca binary and make it executable under xvfb
74+
RUN wget https://github.com/plotly/orca/releases/download/v1.1.1/orca-1.1.1-x86_64.AppImage -P /home
75+
RUN chmod 777 /home/orca-1.1.1-x86_64.AppImage
76+
RUN printf '#!/bin/bash \nxvfb-run --auto-servernum --server-args "-screen 0 640x480x24" /home/orca-1.1.1-x86_64.AppImage "$@"' > /usr/bin/orca
77+
RUN chmod 777 /usr/bin/orca
78+
79+
# other R packages
80+
RUN R -e "install.packages(c('devtools', 'roxygen2', 'testthat'))"
81+
82+
# sf system dependencies
83+
RUN add-apt-repository ppa:ubuntugis/ubuntugis-unstable --yes
84+
RUN apt-get -y update
85+
RUN apt-get install -y libudunits2-dev libproj-dev libgeos-dev libgdal-dev
86+
87+
# install all plotly's dependencies
88+
RUN R -e "install.packages('plotly', dependencies = T)"
89+
90+
# install visual testing packages
91+
RUN R -e "devtools::install_github('cpsievert/vdiffr@diffObj')"
92+
RUN R -e "devtools::install_github('cpsievert/diffobj@css')"
93+
94+
# configure for visual testing
95+
ENV VDIFFR=true
96+
ENV VDIFFR_ARGS="--disable-gpu"
97+
EXPOSE 3838
98+
COPY ./ /home/plotly
99+
RUN cd /home/plotly
100+
101+
102+
CMD R -e "vdiffr::manage_cases(); devtools::test()"

tests/figs/abline/cookbook-axes-multiple-abline.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/figs/abline/cookbook-axes-single-abline.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/figs/area/area-area-fillcolor.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/figs/area/area-simple.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/figs/area/area-traces-order.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/figs/bar/bar-aes-colour-guides-fill-false.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/figs/bar/bar-aes-fill-guides-color-none.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/figs/bar/bar-black-outline.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)