Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
disease-associations
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
plugins
disease-associations
Commits
53378b70
Commit
53378b70
authored
4 years ago
by
David Hoksza
Browse files
Options
Downloads
Patches
Plain Diff
tests + ci
parent
ba7ae4cf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#24602
failed
4 years ago
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+67
-0
67 additions, 0 deletions
.gitlab-ci.yml
tests/test.js
+29
-3
29 additions, 3 deletions
tests/test.js
with
96 additions
and
3 deletions
.gitlab-ci.yml
+
67
−
0
View file @
53378b70
...
...
@@ -5,6 +5,7 @@ before_script:
stages
:
-
build
-
test
-
deploy
build
:
...
...
@@ -30,3 +31,69 @@ deploy:
-
echo "mkdir plugins-www/disease-associations" | sftp -P 8022 gitlab-ci@10.240.6.160
-
echo "put dist/plugin.js plugins-www/disease-associations/" | sftp -P 8022 gitlab-ci@10.240.6.160
test
:
image
:
tomcat:9-jdk11
stage
:
test
script
:
-
apt-get update
-
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
-
DEBIAN_FRONTEND=noninteractive apt install -y ./google-chrome-stable_current_amd64.deb
-
DEBIAN_FRONTEND=noninteractive apt-get install -y maven curl unzip
-
curl -sL https://deb.nodesource.com/setup_12.x | bash -
-
DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
-
wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
-
unzip chromedriver_linux64.zip
-
mv chromedriver /usr/bin/chromedriver
-
chown root:root /usr/bin/chromedriver
-
chmod +x /usr/bin/chromedriver
-
npm install
-
npm run build
-
mkdir /usr/local/tomcat/webapps/test
-
cp dist/plugin.js /usr/local/tomcat/webapps/test/
-
PLUGIN_FILE=plugin.js
-
PLUGIN_MD5=($(md5sum dist/plugin.js))
-
echo $PLUGIN_FILE $PLUGIN_MD5
-
PLUGIN_DIR=`pwd`
-
mkdir /etc/minerva/
-
mkdir /etc/minerva/test
#configure database
-
echo "database.driver=org.hsqldb.jdbcDriver" >>/etc/minerva/db.properties
-
echo "database.dialect=org.hibernate.dialect.HSQLDialect" >>/etc/minerva/db.properties
-
echo "database.uri=jdbc:hsqldb:mem:dapi" >>/etc/minerva/db.properties
-
echo "database.username=sa" >>/etc/minerva/db.properties
-
echo "database.password=" >>/etc/minerva/db.properties
-
echo "database.connectionQuery=SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS" >>/etc/minerva/db.properties
-
echo "database.pathToDataScripts=/etc/minerva/test" >>/etc/minerva/db.properties
#download test data (database and images)
-
wget https://git-r3lab.uni.lu/ewa.smula/testing/raw/master/testData/generated_test_data.zip
-
unzip generated_test_data.zip
-
mv *.sql /etc/minerva/test
-
mv map_images /usr/local/tomcat/webapps/
#fetch latest minerva (from master branch)
-
cd /
-
git clone -b 1016-refactor-test-framework --single-branch https://git-r3lab.uni.lu/minerva/core.git
-
cd core
#build minerva and deploy it
-
mvn -Dmaven.test.skip=true clean install -pl web -am
-
mv web/target/*.war /usr/local/tomcat/webapps/minerva.war
-
/usr/local/tomcat/bin/startup.sh
-
sleep
15
-
curl -X POST -d "login=admin&password=admin" --write-out %{http_code} --silent --output /dev/null -c cookie.txt http://localhost:8080/minerva/api/doLogin
-
curl "http://localhost:8080/minerva/api/plugins/" --cookie cookie.txt --data "hash=$PLUGIN_MD5&url=http%3A%2F%2Flocalhost%3A8080%2Ftest%2F$PLUGIN_FILE&name=test&version=0.0.1&isPublic=false"
#run test
-
cd ${PLUGIN_DIR}
-
npm run test
This diff is collapsed.
Click to expand it.
tests/test.js
+
29
−
3
View file @
53378b70
...
...
@@ -117,7 +117,7 @@ describe("disease-association plugin", async function() {
await
driver
.
wait
(
until
.
elementLocated
(
By
.
css
(
`.disease-input-group .input-disease`
)),
5000
);
});
describe
(
"
Parkinson's disease
"
,
function
()
{
describe
(
"
Parkinson's disease
by EFO
"
,
function
()
{
before
(
async
function
()
{
const
input
=
driver
.
findElement
(
By
.
css
(
'
.disease-input-group .input-disease
'
));
input
.
sendKeys
(
'
parkinson
'
);
...
...
@@ -205,12 +205,38 @@ describe("disease-association plugin", async function() {
assert
.
equal
(
cnt
,
2
);
});
});
})
});
})
describe
(
"
Parkinson's disease by OMIM
"
,
function
()
{
before
(
async
function
()
{
await
driver
.
executeScript
(
function
(){
$
(
'
.disease-input-group input.omim
'
).
click
();
});
await
wait
(
500
);
await
driver
.
executeScript
(
function
(){
$
(
'
.disease-input-group .input-disease
'
).
val
(
''
);
});
await
wait
(
100
);
driver
.
findElement
(
By
.
css
(
'
.disease-input-group .input-disease
'
)).
sendKeys
(
'
168601
'
);
await
wait
(
500
);
driver
.
executeScript
(
function
()
{
$
(
'
.disease-associations-container button.btn-search
'
).
click
();
});
await
driver
.
wait
(
until
.
elementLocated
(
By
.
css
(
'
.associations-content .bootstrap-table td
'
)),
10000
);
await
wait
(
500
);
});
describe
(
"
variation
"
,
function
()
{
it
(
"
should have SNCA associated
"
,
async
function
()
{
const
cnt
=
await
driver
.
executeScript
(
function
()
{
return
$
(
'
table.variation-table td:contains("SNCA")
'
).
length
});
assert
.
equal
(
cnt
,
1
);
});
});
});
after
(
async
function
finishWebDriver
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment