diff --git a/src/main/java/eu/hbp/mip/akka/ExperimentActor.java b/src/main/java/eu/hbp/mip/akka/ExperimentActor.java index 002bec8fd54544b11f8a094d015106dcfd0a2c5c..3c1e2b869dce6d02f427c2ba67229827146a5b97 100644 --- a/src/main/java/eu/hbp/mip/akka/ExperimentActor.java +++ b/src/main/java/eu/hbp/mip/akka/ExperimentActor.java @@ -40,12 +40,14 @@ public class ExperimentActor extends UntypedActor { if(experiment == null) { log.error("Experiment with UUID="+uuid+" not found in DB"); + // getContext().stop(getSelf()); return; } experiment.setResult(queryResult.data().get()); experiment.setFinished(new Date()); experimentRepository.save(experiment); log.info("Experiment "+ uuid +" updated (finished)"); + // getContext().stop(getSelf()); } else if (message instanceof QueryError) { @@ -55,6 +57,7 @@ public class ExperimentActor extends UntypedActor { if(experiment == null) { log.error("Experiment with UUID="+uuid+" not found in DB"); + // getContext().stop(getSelf()); return; } experiment.setHasServerError(true); @@ -63,6 +66,7 @@ public class ExperimentActor extends UntypedActor { experiment.setFinished(new Date()); experimentRepository.save(experiment); log.info("Experiment "+ uuid +" updated (finished)"); + // getContext().stop(getSelf()); } else { diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index c000854237fa1dc8b193569090295d2c060d3fa1..8f70ec42e3bd5a2cc9cd36e6391b06e17693fd90 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -2,7 +2,18 @@ akka { actor { provider = "akka.remote.RemoteActorRefProvider" } + loglevel = DEBUG + log-config-on-start = on + debug { + autoreceive = on + lifecycle = on + unhandled = on + fsm = on + event-stream = on + } remote { + log-sent-messages = on + log-received-messages = on enabled-transports = ["akka.remote.netty.tcp"] netty.tcp { hostname = 127.0.0.1 # external (logical) hostname @@ -11,5 +22,9 @@ akka { bind-hostname = 0.0.0.0 # internal (bind) hostname bind-port = 8089 # internal (bind) port } + message-frame-size = 10000000b + send-buffer-size = 10000000b + receive-buffer-size = 10000000b + maximum-frame-size = 10000000b } } \ No newline at end of file diff --git a/tests/integration/README.md b/tests/integration/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c4d15f0d7285304cf292860360e6d7e70d6356df --- /dev/null +++ b/tests/integration/README.md @@ -0,0 +1,22 @@ +# Integration Tests + +## Algorithms factory + +### Introduction + +This test creates a model and runs an experiment on it. + +### Prerequisites + +* An instance of the algorithms factory has to be running and using the right database +* An instance of the portal-backend has to be running and using the right database +* The authentication has to be disabled on the backend + +### Launch tests + +* Run `./test.sh` + +### Notes + +* This test cannot be run multiple time without updating the model and experiment +* This test has to be improved diff --git a/tests/integration/algorithmsFactory/expQuery1.json b/tests/integration/algorithmsFactory/expQuery1.json new file mode 100644 index 0000000000000000000000000000000000000000..5a8bcdae78ec61812f07554b9e60c047602bc9fa --- /dev/null +++ b/tests/integration/algorithmsFactory/expQuery1.json @@ -0,0 +1,11 @@ +{ + "model": "m1", + "validations": [], + "algorithms": [{ + "code": "statisticsSummary", + "name": "Statistics Summary", + "validation": false, + "parameters": [] + }], + "name": "exp1" +} \ No newline at end of file diff --git a/tests/integration/algorithmsFactory/model1.json b/tests/integration/algorithmsFactory/model1.json new file mode 100644 index 0000000000000000000000000000000000000000..57f016216fa223298db9c3c94599f8387f7d2cf1 --- /dev/null +++ b/tests/integration/algorithmsFactory/model1.json @@ -0,0 +1,38 @@ +{ + "title": "m1", + "config": { + "type": "designmatrix", + "height": 480, + "yAxisVariables": ["LeftVentralDC", "RightVentralDC"], + "xAxisVariable": null, + "hasXAxis": true, + "title": { + "text": "m1" + } + }, + "dataset": { + "code": "DS1481704064551", + "date": 1481704064551, + "variable": ["LeftHippocampus"], + "grouping": [], + "header": ["LeftVentralDC", "RightVentralDC"], + "filter": [], + "data": { + "LeftHippocampus": [3.7286198, 3.1846678, 2.8703444, 2.8979964, 3.4619358, 2.5105906, 2.8982141, 2.6872339, 3.1972363, 3.2911184, 2.9515553, 2.9401393, 3.6112382, 3.5819845, 2.2612252, 2.9814761, 1.9312203, 2.5242808, 3.419138, 3.0938213, 2.3761911, 3.3467891, 3.3146746, 2.65154, 2.7365172, 3.6109595, 3.5837913, 3.2108827, 2.9679625, 2.9331343, 3.2695944, 3.2318206, 3.3833191, 2.4940085, 3.6005921, 2.9348338, 3.0284543, 3.221544, 3.3995185, 2.5502717, 3.1133225, 3.0535655, 3.0459149, 3.0768876, 2.8672171, 2.7170782, 2.7824194, 3.2298849, 2.7445114, 3.0848966, 3.2695327, 3.3794942, 2.9209523, 2.7089813, 2.9198987, 3.2364528, 2.7453506, 3.3737676, 2.7872503, 3.1793489, 2.990272, 2.9152024, 2.1996343, 2.6988192, 3.3929338, 3.2502811, 2.7304571, 3.4071274, 2.1612666, 2.2714982, 2.875823, 2.6842864, 3.4813874, 3.0724523, 3.0630162, 2.6582189, 3.2668059, 3.0805199, 2.5444772, 2.5179632, 3.4357893, 3.1649148, 2.9420402, 3.4358525, 2.7218139, 2.79773, 2.7559037, 2.704215, 2.2514098, 3.2308846, 2.8464255, 2.0262113, 2.063931, 2.7482443, 2.9287093, 1.8229287, 3.0755506, 2.946188, 3.3844888, 3.0216813, 3.2838862, 2.4460714, 3.2530298, 2.818069, 3.0476778, 3.23136, 2.8614881, 3.2917094, 3.2961311, 2.6883807, 2.9526205, 2.8586855, 2.6786246, 2.7809842, 2.9135525, 2.3446972, 3.4482682, 3.3385522, 2.8011084, 2.869163, 2.5087285, 2.7935455, 3.0592759, 2.91412, 3.0866697, 2.5761819, 3.02894, 3.1231911, 2.9631696, 3.2717206, 2.7223935, 3.1708794, 2.6653464, 3.4841855, 3.2346187, 3.1096823, 3.2594864, 3.3777602, 3.0444627, 2.3585591, 3.0884058, 2.9230752, 2.6730533, 2.6567671, 2.3730245, 2.6046226, 2.9129052, 2.7984641, 3.2273035, 2.4181049, 3.0801177, 3.1244955, 3.517519, 3.4157271, 2.7687814, 3.5357869, 3.0278928, 3.1619532, 2.723336, 2.7433479, 3.629647, 2.7860332, 2.4920621, 2.2893879, 2.6209912, 2.6846368, 2.6692164, 3.2519946, 2.4013884, 2.7605345, 2.963192, 2.6607358, 3.1862915, 2.2768753, 3.2177315, 2.8895693, 2.003931, 2.7029657, 3.090199, 2.8971047, 3.2423143, 3.0121813, 2.1372511, 3.1160712], + "LeftVentralDC": [5.3755217, 5.5965338, 4.7961493, 4.4291716, 4.8572435, 4.9586, 4.5081143, 4.3160005, 4.2663755, 4.3938789, 4.9104481, 4.6324029, 5.3484287, 5.143034, 4.613904, 4.8648009, 3.9025126, 4.0768027, 5.1846833, 4.6970305, 4.1375418, 5.1229525, 5.2048564, 3.969727, 4.7025633, 5.4139905, 5.6778154, 5.311295, 4.8632817, 4.5522995, 5.035861, 5.6188045, 5.701808, 4.1428623, 5.3632851, 4.2855473, 5.1523466, 4.867064, 5.2871637, 4.0093832, 4.5086913, 4.8986797, 4.4368711, 5.2883959, 4.3325291, 4.7905135, 4.8843808, 4.8122063, 4.2936788, 5.2203193, 5.5419579, 5.6184802, 4.5574389, 4.3107433, 4.6910949, 4.5437393, 4.566844, 4.9689984, 4.5335288, 5.0491943, 5.3412547, 4.0244365, 4.1268635, 4.0583677, 5.6291108, 5.214395, 4.4888153, 5.1337185, 3.8571436, 3.5927229, 4.8925953, 4.3329306, 5.296145, 4.8090177, 4.81638, 4.6970539, 5.0648246, 4.4942288, 4.3951774, 4.4921265, 5.2860804, 5.0390916, 4.984714, 4.772193, 4.975306, 4.4793334, 4.2604833, 4.4334917, 4.3732853, 4.52671, 4.0614252, 4.0194826, 4.1705008, 4.7587442, 4.7960243, 3.6601245, 4.611464, 4.8706579, 5.1850977, 4.2908287, 5.134059, 3.9599149, 5.2511644, 4.3724737, 4.5694156, 4.987915, 4.2464828, 5.822576, 5.4624386, 4.5071387, 4.0011196, 4.5677481, 4.3874955, 4.0306511, 4.8546362, 3.6947365, 5.0563025, 5.4577322, 4.1722569, 4.2505231, 4.1644483, 4.0980544, 4.3836389, 4.7408586, 4.7031436, 4.734736, 4.6096535, 4.8651328, 4.5933886, 4.2951961, 4.2151761, 4.9431977, 4.5426946, 4.8953152, 5.0320182, 4.7833462, 4.1449695, 5.1029515, 4.6120009, 4.2128382, 4.4683251, 4.5846334, 4.3363605, 5.1036096, 3.7851224, 4.7058024, 4.1516838, 5.2021298, 4.6447692, 4.8014083, 4.2432566, 3.9613726, 5.412365, 5.4456587, 4.9442887, 5.2123804, 5.1221819, 5.2081904, 4.3126745, 4.4143748, 5.0511794, 5.3140326, 4.3205132, 3.9920454, 4.8867769, 4.5071473, 4.597259, 4.4485765, 4.0086694, 4.8826175, 4.9329309, 4.4190497, 4.8269272, 4.1433311, 5.1765537, 4.5123277, 3.9529121, 4.2153563, 4.3625526, 4.4931407, 5.2487035, 4.8329701, 4.4104199, 5.1498618], + "RightVentralDC": [5.1691098, 5.2792888, 4.6463733, 4.2766423, 4.5680194, 4.7761998, 4.2461057, 4.0753789, 4.0740113, 4.2634706, 4.8420544, 4.3766694, 5.0303869, 4.8853641, 4.4129639, 4.7735691, 3.6817849, 3.8773289, 5.0105095, 4.4041986, 4.0137801, 4.8959699, 4.9846501, 3.7503753, 4.4823651, 5.2260623, 5.3797908, 4.9691701, 4.6563873, 4.3703313, 4.8707128, 5.198925, 5.490654, 3.9795225, 5.3314753, 4.0909204, 4.8566594, 4.6893983, 4.9172239, 3.7041016, 4.3916054, 4.6301336, 4.2310848, 5.1740866, 4.089695, 4.591538, 4.689754, 4.5699086, 4.0849972, 4.9646335, 5.2291918, 5.2873178, 4.2287464, 4.2101293, 4.5595279, 4.276031, 4.4602766, 4.7832747, 4.331367, 4.8968534, 5.1664834, 3.8400371, 3.7049513, 3.9049153, 5.4750361, 5.0981264, 4.199872, 4.8956842, 3.7363589, 3.420038, 4.7345834, 4.1327362, 5.0590482, 4.6442499, 4.5584445, 4.4970832, 4.8722687, 4.3533134, 4.2325959, 4.3822675, 5.0040393, 4.7463746, 4.6996875, 4.4601159, 4.7595086, 4.2003007, 4.0714226, 4.3451777, 4.1399622, 4.3042693, 3.8324463, 3.837002, 3.9694006, 4.458395, 4.6119914, 3.6339836, 4.3252096, 4.5669355, 4.9213881, 4.0751586, 4.8507404, 3.7837131, 5.0011005, 4.1742387, 4.3710508, 4.7767768, 3.9799087, 5.6578398, 5.2704864, 4.2915845, 3.8068097, 4.4014544, 4.2059369, 3.941082, 4.6747622, 3.5099764, 4.8186145, 5.1968069, 3.9706714, 4.114274, 3.9402285, 3.9524946, 4.1634469, 4.5444598, 4.5684409, 4.4705372, 4.3834357, 4.6665373, 4.3872132, 4.1488218, 4.0543766, 4.7548537, 4.3108025, 4.6950755, 4.8219919, 4.5206814, 3.9227884, 4.7745028, 4.4856086, 4.165751, 4.2348461, 4.3190846, 4.2788835, 5.0380659, 3.4876189, 4.5376191, 3.987612, 5.0096288, 4.3885126, 4.5850391, 4.0490904, 4.0254827, 5.1115813, 5.1702838, 4.6984811, 4.8785176, 4.9210939, 4.964304, 4.1352744, 4.2316885, 4.6472111, 5.1216283, 4.1926022, 3.7266634, 4.7106433, 4.2076755, 4.3527055, 4.2554479, 3.8686464, 4.6480007, 4.6879725, 4.2526441, 4.5382161, 3.9414988, 4.9809828, 4.2713261, 3.8299766, 4.0310779, 4.2213197, 4.3679347, 4.9559722, 4.6159215, 4.2022476, 4.9862008] + } + }, + "query": { + "variables": [{ + "code": "LeftHippocampus" + }], + "groupings": [], + "coVariables": [{ + "code": "LeftVentralDC" + }, { + "code": "RightVentralDC" + }], + "filters": [] + } +} \ No newline at end of file diff --git a/tests/integration/algorithmsFactory/test.sh b/tests/integration/algorithmsFactory/test.sh new file mode 100755 index 0000000000000000000000000000000000000000..2f75b02952872e78f50dfc58dd7b03dac7ecd563 --- /dev/null +++ b/tests/integration/algorithmsFactory/test.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +curl http://backend:8080/services/models -X POST -H "Content-Type: application/json" -d @model1.json +curl http://backend:8080/services/experiments -X POST -H "Content-Type: application/json" -d @expQuery1.json