Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
variety
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-gitdep
variety
Commits
e8f29c3b
Commit
e8f29c3b
authored
Feb 11, 2016
by
Tomas Dvorak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dockerized tests
parent
42324df2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
10 deletions
+75
-10
.gitignore
.gitignore
+3
-2
.travis.yml
.travis.yml
+12
-7
Dockerfile.template
Dockerfile.template
+33
-0
test.sh
test.sh
+24
-0
pom.xml
test/pom.xml
+1
-1
LimitedAccessTest.java
.../test/java/com/github/variety/test/LimitedAccessTest.java
+2
-0
No files found.
.gitignore
View file @
e8f29c3b
...
...
@@ -2,4 +2,5 @@
# intellij idea project files
*.iml
*.ipr
\ No newline at end of file
*.ipr
.idea/
\ No newline at end of file
.travis.yml
View file @
e8f29c3b
language
:
java
jdk
:
-
oraclejdk8
sudo
:
false
services
:
mongodb
language
:
node_js
sudo
:
required
services
:
docker
install
:
-
npm install jshint -g
env
:
matrix
:
-
MONGODB_VERSION=2.4
-
MONGODB_VERSION=2.6
-
MONGODB_VERSION=2.8
-
MONGODB_VERSION=3.0
-
MONGODB_VERSION=3.2
script
:
-
jshint variety.js
-
cd test && mvn test
\ No newline at end of file
-
./test.sh
\ No newline at end of file
Dockerfile.template
0 → 100644
View file @
e8f29c3b
FROM mongo:{MONGODB_VERSION}
## Java installation
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
RUN echo 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main' | tee /etc/apt/sources.list.d/webupd8team-java-trusty.list
RUN echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes --no-install-recommends oracle-java8-installer && apt-get clean all
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
RUN java -version
## Maven installation
RUN apt-get install -y --force-yes --no-install-recommends curl
RUN apt-get install -y --force-yes --no-install-recommends ca-certificates
ENV MAVEN_VERSION 3.3.9
RUN apt-get install -y --force-yes --no-install-recommends curl
RUN curl -fsSL https://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - -C /usr/share \
&& mv /usr/share/apache-maven-$MAVEN_VERSION /usr/share/maven \
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
ENV MAVEN_HOME /usr/share/maven
RUN mvn --version
## Prepare entrypoint script (start MongoDB, switch to test dir, execute maven)
RUN mkdir /opt/variety-test
WORKDIR /opt/variety-test/
RUN echo "#!/bin/sh" > run.sh
RUN echo "mongod --logpath /var/log/mongod.log &" >> run.sh
RUN echo "cd /opt/variety/test" >> run.sh
RUN echo "mvn test" >> run.sh
RUN chmod +x /opt/variety-test/run.sh
ENTRYPOINT ["/opt/variety-test/run.sh"]
\ No newline at end of file
test.sh
0 → 100755
View file @
e8f29c3b
#!/bin/bash
set
-e
# location of this script
DIR
=
$(
readlink
-f
$(
dirname
$0
))
VERSION
=
${
MONGODB_VERSION
:
=2.6
}
echo
echo
"****************************************"
echo
"* "
echo
"* Testing Variety.js with MongoDB
$VERSION
"
echo
"*
$(
docker
--version
)
"
echo
"* "
echo
"****************************************"
echo
sed
-e
"s/{MONGODB_VERSION}/
$VERSION
/g"
Dockerfile.template
>
Dockerfile_
$VERSION
docker build
-t
variety-
$VERSION
-f
Dockerfile_
$VERSION
.
docker run
-t
-v
$DIR
:/opt/variety variety-
$VERSION
rm Dockerfile_
$VERSION
\ No newline at end of file
test/pom.xml
View file @
e8f29c3b
...
...
@@ -16,7 +16,7 @@
<dependency>
<groupId>
org.mongodb
</groupId>
<artifactId>
mongo-java-driver
</artifactId>
<version>
2.12.4
</version>
<version>
3.2.1
</version>
</dependency>
<dependency>
...
...
test/src/test/java/com/github/variety/test/LimitedAccessTest.java
View file @
e8f29c3b
...
...
@@ -9,6 +9,7 @@ import com.mongodb.ServerAddress;
import
org.junit.After
;
import
org.junit.Assert
;
import
org.junit.Before
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
java.io.IOException
;
...
...
@@ -18,6 +19,7 @@ import java.util.Arrays;
* Tests, if variety can return results for user with read only access to analyzed database (without permission to list
* all other dbs / collections, without permission to persist results).
*/
@Ignore
public
class
LimitedAccessTest
{
private
Variety
variety
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment