Skip to content

Commit e987472

Browse files
committed
Start to build out e2e tests for boyter#167
1 parent b5ef67a commit e987472

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed

assets/docker/Dockerfile.test.e2e

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM ubuntu:16.04
2+
ENV http_proxy ${http_proxy}
3+
ENV https_proxy ${https_proxy}
4+
5+
RUN apt-get update && apt-get install -y \
6+
openjdk-8-jdk \
7+
maven \
8+
python-pip \
9+
python-dev \
10+
build-essential \
11+
libffi-dev \
12+
libssl-dev \
13+
subversion \
14+
git \
15+
npm
16+
17+
RUN pip install fabric
18+
19+
COPY ./ /opt/app/
20+
COPY ./searchcode.sqlite.e2e.test /opt/app/searchcode.sqlite
21+
COPY ./searchcode.properties.example /opt/app/searchcode.properties
22+
23+
RUN rm -rf /opt/app/index
24+
RUN rm -rf /opt/app/repo
25+
RUN rm -rf /opt/app/logs
26+
27+
WORKDIR /opt/app/

fabfile.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from fabric.api import prompt
2020
from fabric.utils import warn
2121
from fabric.contrib.files import sed
22-
from fabric.context_managers import settings, hide, cd
22+
from fabric.context_managers import settings, hide, cd, lcd
2323
from fabric.colors import yellow
2424

2525
import platform
@@ -67,6 +67,29 @@ def test_docker():
6767
searchcode-server-test mvn test''')
6868

6969

70+
def test_docker_e2e():
71+
local('mkdir -p e2e_test')
72+
local('mkdir -p ./e2e_test/git_example/')
73+
local('mkdir -p ./e2e_test/svn_example/')
74+
local('mkdir -p ./e2e_test/file_example/')
75+
76+
with lcd('./e2e_test/git_example/'):
77+
local('echo "indextest git_example" > "git_example.py"')
78+
79+
with lcd('./e2e_test/svn_example/'):
80+
local('echo "indextest svn_example" > "svn_example.py"')
81+
82+
with lcd('./e2e_test/file_example/'):
83+
local('echo "indextest file_example" > "file_example.py"')
84+
85+
local('''docker build -t searchcode-server-test -f ./assets/docker/Dockerfile.test.e2e .''')
86+
local('''docker run --rm \
87+
-v ~/.m2/:/root/.m2/ \
88+
-v $(PWD):/opt/app/ \
89+
-w /opt/app/ \
90+
searchcode-server-test mvn test''')
91+
92+
7093
def js_test():
7194
local('node-qunit-phantomjs ./src/test/javascript/index.html')
7295

searchcode.sqlite.e2e.test

7 KB
Binary file not shown.

0 commit comments

Comments
 (0)