Skip to content
Snippets Groups Projects
Commit a50594b0 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '1960-fix-install-tests' into 'master'

Resolve "fix install tests"

Closes #1960

See merge request !1655
parents 13c203dc d928798c
No related branches found
No related tags found
2 merge requests!1700Resolve "introduce new frontend to the jar file build process",!1655Resolve "fix install tests"
Pipeline #85477 canceled
......@@ -480,7 +480,7 @@ test_install_debian_package:
- echo "deb http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list
- echo "deb-src http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get install -y ssh software-properties-common dirmngr wget curl postgresql
- DEBIAN_FRONTEND=noninteractive apt-get install -y ssh software-properties-common dirmngr wget curl postgresql screen
- service postgresql start
- debian_file=$(ls debian/*.deb)
- echo debconf minerva/internal/skip-preseed boolean true | debconf-set-selections
......@@ -489,46 +489,15 @@ test_install_debian_package:
- echo debconf minerva/remote/host select localhost | debconf-set-selections
- echo debconf minerva/db/dbname select minerva_db | debconf-set-selections
- echo debconf minerva/db/app-user select minerva_user@localhost | debconf-set-selections
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get install -y ./$debian_file
- java -jar /usr/share/minerva/minerva.jar &
#we need to wait a bit for tomcat start
- screen -d -m java -jar /usr/share/minerva/minerva.jar
#we need to wait a bit - app needs to start
- sleep 15
- wget http://localhost:8080/minerva/
#test if we can login and list projects
- test 200 = $(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)
- test 200 = $(curl --write-out %{http_code} --silent --output /dev/null --cookie cookie.txt http://localhost:8080/minerva/api/projects/)
test_deploy_with_db_without_superadmin_rights:
image: maven:3.8.6-jdk-8
stage: test
services:
- postgres:9.6
dependencies:
- build_jar
tags:
- privileged
only:
- tags
script:
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql-client
- mkdir -p /etc/minerva
- echo "database.uri=jdbc:postgresql://postgres:5432/test" > /etc/minerva/db.properties
- echo "database.username=test" >> /etc/minerva/db.properties
- echo "database.password=test" >> /etc/minerva/db.properties
- echo "CREATE DATABASE test;CREATE USER test WITH ENCRYPTED PASSWORD 'test';GRANT ALL PRIVILEGES ON DATABASE test TO test;" >tmp.sql
- PGPASSWORD=$POSTGRES_PASSWORD psql -h postgres -U $POSTGRES_USER $POSTGRES_DB < tmp.sql
- mkdir -p /usr/share/minerva/data/
- mv minerva.jar /usr/share/minerva/
- java -jar /usr/share/minerva/minerva.jar
- sleep 15
- curl http://localhost:8080/minerva/
#test if we can login and list projects
- test 200 = $(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)
- test 200 = $(curl --write-out %{http_code} --silent --output /dev/null --cookie cookie.txt http://localhost:8080/minerva/api/projects/)
.test_database_template: &test_database_definition
image: maven:3.8.6-jdk-8
stage: test
......
......@@ -7,6 +7,9 @@ minerva (17.0.0~beta.1) unstable; urgency=medium
account disabled (#1635)
* Bug fix (regression): accepting ToS was impossible (#1974)
* Bug fix (regression): export page did not work (#1965)
* Bug fix: refresh of DAPI data did not work properly (#1967)
* Bug fix: download genomes stopped working (http://hgdownload.cse.ucsc.edu/
is down)
* Bug fix: upload of invalid javascript plugin was throwing exception
(#1964)
......
......@@ -64,7 +64,7 @@ public class DapiConnectorImpl extends CachableInterface implements DapiConnecto
}
public DapiConnectorImpl(final ConfigurationDao configurationDao) {
super(DapiConnectorImpl.class);
super(DapiConnector.class);
this.configurationDao = configurationDao;
}
......
package lcsb.mapviewer.annotation.cache;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
......@@ -10,9 +11,14 @@ import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import lcsb.mapviewer.annotation.AnnotationTestFunctions;
import lcsb.mapviewer.annotation.services.ModelAnnotator;
import lcsb.mapviewer.annotation.services.PubmedParser;
import lcsb.mapviewer.annotation.services.dapi.DapiConnector;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.model.cache.CacheType;
import lcsb.mapviewer.model.job.MinervaJob;
import lcsb.mapviewer.model.job.MinervaJobPriority;
import lcsb.mapviewer.model.job.MinervaJobType;
public class GeneralCacheTest extends AnnotationTestFunctions {
......@@ -22,6 +28,9 @@ public class GeneralCacheTest extends AnnotationTestFunctions {
@Autowired
private GeneralCacheInterface databaseLevelCache;
@Autowired
private DapiConnector dapiConnector;
@Before
public void setUp() throws Exception {
}
......@@ -84,4 +93,12 @@ public class GeneralCacheTest extends AnnotationTestFunctions {
}
}
@Test
public void testExecute() throws Exception {
CacheQueryMinervaJob parameters = new CacheQueryMinervaJob("https://google.com/",
((CachableInterface) ModelAnnotator.unwrapProxy(dapiConnector)).getCacheType().getId());
cache.execute(new MinervaJob(MinervaJobType.REFRESH_CACHE, MinervaJobPriority.MEDIUM, parameters));
assertEquals(0, super.getErrors().size());
}
}
......@@ -10,7 +10,7 @@ import org.junit.Test;
public class DapiConnectorImplTest {
@Test
public void testGetLAtestVersion() {
public void testGetLatestVersion() {
DapiConnectorImpl connector = new DapiConnectorImpl(null);
String version = connector.getLatestVersion(Arrays.asList("2.2", "3.3", "11.2", "10"));
assertEquals("11.2", version);
......
update cache_type_table set class_name ='lcsb.mapviewer.annotation.services.dapi.DapiConnector' where class_name='lcsb.mapviewer.annotation.services.dapi.DapiConnectorImpl';
\ No newline at end of file
update cache_type_table set class_name ='lcsb.mapviewer.annotation.services.dapi.DapiConnector' where class_name='lcsb.mapviewer.annotation.services.dapi.DapiConnectorImpl';
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment