Skip to content

Commit

Permalink
Tests exploring #25. RForge version is now default for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dareid committed Mar 5, 2016
1 parent f2f2ddf commit cf98169
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
6 changes: 6 additions & 0 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ func TestConnection(t *testing.T) {
if _, err := NewRClient("localhost", 6311); err != nil {
t.Error("Failed to connect to RServe: " + err.Error())
}
if _, err := NewRClient("localhost", 6313); err != nil {
t.Error("Failed to connect to RServe from CRAN: " + err.Error())
}
}

func TestConnectionFailure(t *testing.T) {
Expand All @@ -21,6 +24,9 @@ func TestSecureConnection(t *testing.T) {
if _, err := NewRClientWithAuth("localhost", 6312, "roger", "testpassword"); err != nil {
t.Error("Failed to connect to secure RServe: " + err.Error())
}
if _, err := NewRClientWithAuth("localhost", 6314, "roger", "testpassword"); err != nil {
t.Error("Failed to connect to secure RServe from CRAN: " + err.Error())
}
}

func TestSecureConnectionFailure(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions test/Dockerfile-R → test/Dockerfile-RServe-Cran
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ RUN apt-get install -y --no-install-recommends \

RUN R -e 'options(repos = c(CRAN = "http://cran.rstudio.com/")); install.packages(c("Rserve"))'

RUN echo "port 6313" >> /etc/Rserv.conf
RUN echo "remote enable" >> /etc/Rserv.conf

RUN echo "port 6312" >> /etc/Rserv-secure.conf
RUN echo "port 6314" >> /etc/Rserv-secure.conf
RUN echo "remote enable" >> /etc/Rserv-secure.conf
RUN echo "auth required" >> /etc/Rserv-secure.conf
RUN echo "pwdfile /etc/Rserve.pwd" >> /etc/Rserv-secure.conf
Expand All @@ -22,4 +23,4 @@ WORKDIR /usr/local/src/senseyeio

CMD nohup R < test.r --no-save & nohup R < test-secure.r --no-save

EXPOSE 6311 6312
EXPOSE 6313 6314
26 changes: 26 additions & 0 deletions test/Dockerfile-RServe-RForge
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM r-base:3.2.1

RUN apt-get update

RUN apt-get install -y --no-install-recommends \
libxml2-dev \
libcurl4-gnutls-dev \
libssl-dev

RUN R -e 'install.packages("Rserve",,"http://rforge.net/")'

RUN echo "port 6311" >> /etc/Rserv.conf
RUN echo "remote enable" >> /etc/Rserv.conf

RUN echo "port 6312" >> /etc/Rserv-secure.conf
RUN echo "remote enable" >> /etc/Rserv-secure.conf
RUN echo "auth required" >> /etc/Rserv-secure.conf
RUN echo "pwdfile /etc/Rserve.pwd" >> /etc/Rserv-secure.conf
RUN echo "roger testpassword" >> /etc/Rserve.pwd

COPY . /usr/local/src/senseyeio
WORKDIR /usr/local/src/senseyeio

CMD nohup R < test.r --no-save & nohup R < test-secure.r --no-save

EXPOSE 6311 6312
11 changes: 9 additions & 2 deletions test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
rserve:
rserve-cran:
build: .
dockerfile: Dockerfile-R
dockerfile: Dockerfile-RServe-Cran
ports:
- "6313:6313"
- "6314:6314"

rserve-rforge:
build: .
dockerfile: Dockerfile-RServe-RForge
ports:
- "6311:6311"
- "6312:6312"

0 comments on commit cf98169

Please sign in to comment.