Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
6e5921c6
Commit
6e5921c6
authored
Feb 11, 2020
by
Alexander Lercher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/AutomatingTesting' into develop
parents
ec6dca7c
c611935d
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
75 additions
and
27 deletions
+75
-27
build.py
bin/build.py
+8
-6
testing.py
bin/testing.py
+42
-0
test_cluster.py
...ommunity-detection-microservice/app/tests/test_cluster.py
+2
-2
test_clusterer.py
...munity-detection-microservice/app/tests/test_clusterer.py
+2
-2
Dockerfile
src/data-hub/semantic-linking-microservice/Dockerfile
+2
-3
requirements.txt
...ta-hub/semantic-linking-microservice/app/requirements.txt
+3
-0
manage_sys_paths.py
...mantic-linking-microservice/app/tests/manage_sys_paths.py
+1
-2
test_HyperGraph.py
...emantic-linking-microservice/app/tests/test_HyperGraph.py
+0
-0
Dockerfile
src/rest-gateway/Dockerfile
+2
-4
requirements.txt
src/rest-gateway/app/requirements.txt
+4
-0
manage_sys_paths.py
src/rest-gateway/app/tests/manage_sys_paths.py
+1
-1
test_blockchain_trace.py
src/rest-gateway/app/tests/test_blockchain_trace.py
+0
-0
Dockerfile
...ransaction-hub-in/trace-retrieval-microservice/Dockerfile
+2
-5
requirements.txt
...-hub-in/trace-retrieval-microservice/app/requirements.txt
+5
-0
manage_sys_paths.py
...race-retrieval-microservice/app/tests/manage_sys_paths.py
+1
-2
test_MessageHandler.py
...e-retrieval-microservice/app/tests/test_MessageHandler.py
+0
-0
No files found.
bin/build.py
View file @
6e5921c6
...
@@ -35,9 +35,11 @@ for command_arg in command_args:
...
@@ -35,9 +35,11 @@ for command_arg in command_args:
os
.
remove
(
os
.
path
.
join
(
ROOT
,
DOCKER_COMPOSE_NAME
))
os
.
remove
(
os
.
path
.
join
(
ROOT
,
DOCKER_COMPOSE_NAME
))
res_str
.
append
(
f
"{image_name} built with exit code {exit_val}"
)
res_str
.
append
(
f
"{image_name} built with exit code {exit_val}"
)
if
exit_val
!=
0
:
if
exit_val
!=
0
:
error
=
exit_val
error
=
exit_val
else
:
# push created Docker image
# push created Docker image
exit_val
=
os
.
system
(
f
"docker push {image_name}"
)
exit_val
=
os
.
system
(
f
"docker push {image_name}"
)
...
...
bin/testing.py
0 → 100644
View file @
6e5921c6
import
os
import
sys
import
importlib.util
import
pathlib
ROOT
=
pathlib
.
Path
(
__file__
)
.
parent
.
parent
.
absolute
()
TESTS_FOLDER_NAME
=
"/tests"
print
(
"
\n
Searching for tests at the path: "
+
str
(
ROOT
))
count
=
0
resultCodeList
=
[]
for
(
dirname
,
dirs
,
files
)
in
os
.
walk
(
ROOT
):
#I assume all the tests are placed in a folder named "tests"
if
(
TESTS_FOLDER_NAME
in
str
(
dirname
))
\
and
not
(
f
"{TESTS_FOLDER_NAME}/"
in
str
(
dirname
))
\
and
not
(
"venv"
in
str
(
dirname
)):
try
:
print
(
f
"Executing tests in {dirname}"
)
os
.
chdir
(
os
.
path
.
normpath
(
dirname
))
# TODO do this during docker image setup
exit_val
=
os
.
system
(
"python3.7 -m pip install -r ../requirements.txt"
)
# install pip dependencies
exit_val
=
os
.
system
(
"python3.7 -m unittest discover"
)
# execute the tests
resultCodeList
.
append
(
exit_val
)
#once per folder i.e if 3 tests are in a folder and crash, there will be just one exit val
except
Exception
as
e
:
print
(
e
)
continue
firstError
=
-
1
i
=
0
while
i
<
len
(
resultCodeList
):
if
resultCodeList
[
i
]
!=
0
:
# print("\nA test failed with code: "+ str(resultCodeList[i]))
if
(
firstError
<
0
):
firstError
=
i
i
+=
1
if
(
firstError
<
0
):
#no errors found
sys
.
exit
(
0
)
else
:
sys
.
exit
(
1
)
#return code>0
\ No newline at end of file
src/data-hub/community-detection-microservice/app/tests/test_cluster.py
View file @
6e5921c6
import
unittest
import
unittest
import
sys
import
sys
sys
.
path
.
insert
(
1
,
'./'
)
sys
.
path
.
insert
(
1
,
'.
.
/'
)
# python -m unittest discover
-v tests
# python -m unittest discover
from
db.entities.cluster
import
Cluster
from
db.entities.cluster
import
Cluster
from
db.entities
import
TimeCluster
,
LocationCluster
from
db.entities
import
TimeCluster
,
LocationCluster
...
...
src/data-hub/community-detection-microservice/app/tests/test_clusterer.py
View file @
6e5921c6
import
unittest
import
unittest
import
sys
import
sys
sys
.
path
.
insert
(
1
,
'./'
)
sys
.
path
.
insert
(
1
,
'.
.
/'
)
# python -m unittest discover
-v tests
# python -m unittest discover
from
processing.clusterer
import
Clusterer
from
processing.clusterer
import
Clusterer
class
TestClusterer
(
unittest
.
TestCase
):
class
TestClusterer
(
unittest
.
TestCase
):
...
...
src/data-hub/semantic-linking-microservice/Dockerfile
View file @
6e5921c6
...
@@ -5,15 +5,14 @@ ENV http_proxy http://proxy.uni-klu.ac.at:3128/
...
@@ -5,15 +5,14 @@ ENV http_proxy http://proxy.uni-klu.ac.at:3128/
ENV
https_proxy http://proxy.uni-klu.ac.at:3128/
ENV
https_proxy http://proxy.uni-klu.ac.at:3128/
RUN
apt-get update
RUN
apt-get update
RUN
pip
install
flask
RUN
pip
install
connexion[swagger-ui]
RUN
pip
install
pika
EXPOSE
5000
EXPOSE
5000
WORKDIR
/app
WORKDIR
/app
COPY
src/data-hub/semantic-linking-microservice/app/ /app/
COPY
src/data-hub/semantic-linking-microservice/app/ /app/
COPY
src/modules/ /app/
COPY
src/modules/ /app/
RUN
pip
install
-r
requirements.txt
RUN
chmod
a+x main.py
RUN
chmod
a+x main.py
CMD
["python", "./main.py"]
CMD
["python", "./main.py"]
\ No newline at end of file
src/data-hub/semantic-linking-microservice/app/requirements.txt
0 → 100644
View file @
6e5921c6
flask
connexion[swagger-ui]
pika
src/data-hub/semantic-linking-microservice/tests/manage_sys_paths.py
→
src/data-hub/semantic-linking-microservice/
app/
tests/manage_sys_paths.py
View file @
6e5921c6
# add modules folder to interpreter path
# add modules folder to interpreter path
import
sys
import
sys
import
os
import
os
modules_paths
=
[
'../
app/'
,
'
../../../modules/'
]
modules_paths
=
[
'../
'
,
'../
../../../modules/'
]
for
path
in
modules_paths
:
for
path
in
modules_paths
:
if
os
.
path
.
exists
(
path
):
if
os
.
path
.
exists
(
path
):
sys
.
path
.
insert
(
1
,
path
)
sys
.
path
.
insert
(
1
,
path
)
print
(
f
"added {path}"
)
src/data-hub/semantic-linking-microservice/tests/test_HyperGraph.py
→
src/data-hub/semantic-linking-microservice/
app/
tests/test_HyperGraph.py
View file @
6e5921c6
File moved
src/rest-gateway/Dockerfile
View file @
6e5921c6
...
@@ -5,16 +5,14 @@ ENV http_proxy http://proxy.uni-klu.ac.at:3128/
...
@@ -5,16 +5,14 @@ ENV http_proxy http://proxy.uni-klu.ac.at:3128/
ENV
https_proxy http://proxy.uni-klu.ac.at:3128/
ENV
https_proxy http://proxy.uni-klu.ac.at:3128/
RUN
apt-get update
RUN
apt-get update
RUN
pip
install
flask
RUN
pip
install
connexion[swagger-ui]
RUN
pip
install
pika
RUN
pip
install
deprecated
EXPOSE
5000
EXPOSE
5000
WORKDIR
/app
WORKDIR
/app
COPY
src/rest-gateway/app/ /app/
COPY
src/rest-gateway/app/ /app/
COPY
src/modules/ /app/
COPY
src/modules/ /app/
RUN
pip
install
-r
requirements.txt
RUN
chmod
a+x main.py
RUN
chmod
a+x main.py
CMD
["python", "./main.py"]
CMD
["python", "./main.py"]
\ No newline at end of file
src/rest-gateway/app/requirements.txt
0 → 100644
View file @
6e5921c6
flask
connexion[swagger-ui]
pika
deprecated
src/rest-gateway/tests/manage_sys_paths.py
→
src/rest-gateway/
app/
tests/manage_sys_paths.py
View file @
6e5921c6
# add modules folder to interpreter path
# add modules folder to interpreter path
import
sys
import
sys
import
os
import
os
modules_paths
=
[
'../
app/'
,
'
../../modules/'
]
modules_paths
=
[
'../
'
,
'../
../../modules/'
]
for
path
in
modules_paths
:
for
path
in
modules_paths
:
if
os
.
path
.
exists
(
path
):
if
os
.
path
.
exists
(
path
):
sys
.
path
.
insert
(
1
,
path
)
sys
.
path
.
insert
(
1
,
path
)
src/rest-gateway/tests/test_blockchain_trace.py
→
src/rest-gateway/
app/
tests/test_blockchain_trace.py
View file @
6e5921c6
File moved
src/transaction-hub-in/trace-retrieval-microservice/Dockerfile
View file @
6e5921c6
...
@@ -5,17 +5,14 @@ ENV http_proxy http://proxy.uni-klu.ac.at:3128/
...
@@ -5,17 +5,14 @@ ENV http_proxy http://proxy.uni-klu.ac.at:3128/
ENV
https_proxy http://proxy.uni-klu.ac.at:3128/
ENV
https_proxy http://proxy.uni-klu.ac.at:3128/
RUN
apt-get update
RUN
apt-get update
RUN
pip
install
flask
RUN
pip
install
connexion[swagger-ui]
RUN
pip
install
pika
RUN
pip
install
pymongo
RUN
pip
install
deprecated
EXPOSE
5000
EXPOSE
5000
WORKDIR
/app
WORKDIR
/app
COPY
src/transaction-hub-in/trace-retrieval-microservice/app/ /app/
COPY
src/transaction-hub-in/trace-retrieval-microservice/app/ /app/
COPY
src/modules/ /app/
COPY
src/modules/ /app/
RUN
pip
install
-r
requirements.txt
RUN
chmod
a+x main.py
RUN
chmod
a+x main.py
CMD
["python", "./main.py"]
CMD
["python", "./main.py"]
\ No newline at end of file
src/transaction-hub-in/trace-retrieval-microservice/app/requirements.txt
0 → 100644
View file @
6e5921c6
flask
connexion[swagger-ui]
pika
pymongo
deprecated
src/transaction-hub-in/trace-retrieval-microservice/tests/manage_sys_paths.py
→
src/transaction-hub-in/trace-retrieval-microservice/
app/
tests/manage_sys_paths.py
View file @
6e5921c6
# add modules folder to interpreter path
# add modules folder to interpreter path
import
sys
import
sys
import
os
import
os
modules_paths
=
[
'../
app/'
,
'
../../../modules/'
]
modules_paths
=
[
'../
'
,
'../
../../../modules/'
]
for
path
in
modules_paths
:
for
path
in
modules_paths
:
if
os
.
path
.
exists
(
path
):
if
os
.
path
.
exists
(
path
):
sys
.
path
.
insert
(
1
,
path
)
sys
.
path
.
insert
(
1
,
path
)
print
(
f
"added {path}"
)
src/transaction-hub-in/trace-retrieval-microservice/tests/test_MessageHandler.py
→
src/transaction-hub-in/trace-retrieval-microservice/
app/
tests/test_MessageHandler.py
View file @
6e5921c6
File moved
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