File tree Expand file tree Collapse file tree 6 files changed +8
-8
lines changed
klass-api/src/test/java/no/ssb/klass/api/migration Expand file tree Collapse file tree 6 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ public class MigrationTestConfig {
44
55 public static String getSourceHost () {
66 return System .getProperty ("source.service.host" ,
7- System .getenv ().getOrDefault ("SOURCE_SERVICE_HOST" , "http://localhost:8081 " ));
7+ System .getenv ().getOrDefault ("SOURCE_SERVICE_HOST" , "http://localhost:8082 " ));
88 }
99
1010 public static String getTargetHost () {
Original file line number Diff line number Diff line change 1111import static no .ssb .klass .api .migration .MigrationTestUtils .formatter ;
1212import static no .ssb .klass .api .migration .MigrationTestUtils .generateRandomDate ;
1313
14- public class AbstractKlassApiChanges extends AbstractKlassApiDataIntegrityTest {
14+ public abstract class AbstractKlassApiChanges extends AbstractKlassApiDataIntegrityTest {
1515 static LocalDate date ;
1616
1717 static String dateFrom ;
Original file line number Diff line number Diff line change 1010
1111import static no .ssb .klass .api .migration .MigrationTestConstants .*;
1212
13- public class AbstractKlassApiCorrespondsTest extends AbstractKlassApiDataIntegrityTest {
13+ public abstract class AbstractKlassApiCorrespondsTest extends AbstractKlassApiDataIntegrityTest {
1414
1515 String getCorrespondsAtPath (Integer id ) {
1616 return CLASSIFICATIONS_PATH + "/" + id + "/" + CORRESPONDS_AT ;
Original file line number Diff line number Diff line change 1111import static no .ssb .klass .api .migration .MigrationTestConstants .*;
1212import static no .ssb .klass .api .migration .MigrationTestUtils .generateRandomId ;
1313
14- public class AbstractKlassApiFamiliesTest extends AbstractKlassApiDataIntegrityTest {
14+ public abstract class AbstractKlassApiFamiliesTest extends AbstractKlassApiDataIntegrityTest {
1515
1616 static Stream <Integer > rangeProviderClassificationFamilyIds () {
1717 return IntStream .rangeClosed (0 , 30 ).boxed ();
Original file line number Diff line number Diff line change 99import static no .ssb .klass .api .migration .MigrationTestConstants .VERSIONS ;
1010import static no .ssb .klass .api .migration .MigrationTestUtils .generateRandomId ;
1111
12- public class AbstractKlassApiVersions extends AbstractKlassApiDataIntegrityTest {
12+ public abstract class AbstractKlassApiVersions extends AbstractKlassApiDataIntegrityTest {
1313 static Integer randomId ;
1414 String getVersionByIdPath (Integer id ) {
1515 return "/" + VERSIONS + "/" + id ;
Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ source .env
66set +a
77
88# Start containers
9- docker compose up -d
9+ docker compose --profile migrate-data up -d
1010
1111echo " Wait for mariadb to be ready"
1212sleep 10
1313
1414echo " Load data from file to mariadb database"
15- docker compose exec -T mariadb mariadb -u root -p" $MARIADB_ROOT_PASSWORD " --host=127.0.0.1 klass < " $MARIADB_LOCAL_FILEPATH "
15+ docker compose --profile migrate-data exec -T mariadb mariadb -u root -p" $MARIADB_ROOT_PASSWORD " --host=127.0.0.1 klass < " $MARIADB_LOCAL_FILEPATH "
1616
1717echo " Wait for load from file to finish"
1818sleep 10
@@ -26,7 +26,7 @@ sleep 10
2626# Run necessary postgresql alteration on type timestamp to remove microseconds
2727echo " Alter columns of type timestamp"
2828docker cp alter_timestamp.sql " $( docker compose ps -q postgresql) " :/tmp/alter_timestamp.sql
29- docker compose exec -T postgresql psql -U klass -d klass -f /tmp/alter_timestamp.sql
29+ docker compose --profile migrate-data exec -T postgresql psql -U klass -d klass -f /tmp/alter_timestamp.sql
3030
3131echo " Dump data from postgres database to file"
3232pg_dump -U klass -h localhost -p 5432 klass > " $POSTGRES_LOCAL_FILEPATH " /" $POSTGRES_DUMP_FILENAME "
You can’t perform that action at this time.
0 commit comments