Fixed test

parent 9d34c608
Pipeline #109613 failed with stage
in 6 minutes and 9 seconds
...@@ -235,7 +235,6 @@ public class EMADLGenerator { ...@@ -235,7 +235,6 @@ public class EMADLGenerator {
} }
String trainingHash = emadlHash + "#" + cnntHash + "#" + trainingDataHash + "#" + testDataHash; String trainingHash = emadlHash + "#" + cnntHash + "#" + trainingDataHash + "#" + testDataHash;
System.out.println("Hash: " + trainingHash);
boolean alreadyTrained = newHashes.contains(trainingHash) || isAlreadyTrained(trainingHash, componentInstance); boolean alreadyTrained = newHashes.contains(trainingHash) || isAlreadyTrained(trainingHash, componentInstance);
if(alreadyTrained && !forced.equals("y")) { if(alreadyTrained && !forced.equals("y")) {
Log.warn("Training of model " + componentInstance.getFullName() + " skipped"); Log.warn("Training of model " + componentInstance.getFullName() + " skipped");
......
...@@ -46,7 +46,7 @@ public class GenerationTest extends AbstractSymtabTest { ...@@ -46,7 +46,7 @@ public class GenerationTest extends AbstractSymtabTest {
private void createHashFile() { private void createHashFile() {
try { try {
cifarTrainingHashFile.toFile().getParentFile().mkdirs(); cifarTrainingHashFile.toFile().getParentFile().mkdirs();
List<String> lines = Arrays.asList("AF9A637D700CB002266D20BF242F4A59#B87F2C80B19CABE0899C30FA66763A47#C4C23549E737A759721D6694C75D9771#5AF0CE68E408E8C1F000E49D72AC214A"); List<String> lines = Arrays.asList("AF9A637D700CB002266D20BF242F4A59#27150AFBB0093AE0914C701ECA0E0040#C4C23549E737A759721D6694C75D9771#5AF0CE68E408E8C1F000E49D72AC214A");
Files.write(cifarTrainingHashFile, lines, Charset.forName("UTF-8")); Files.write(cifarTrainingHashFile, lines, Charset.forName("UTF-8"));
} }
catch(Exception e) { catch(Exception e) {
...@@ -73,7 +73,7 @@ public class GenerationTest extends AbstractSymtabTest { ...@@ -73,7 +73,7 @@ public class GenerationTest extends AbstractSymtabTest {
@Test @Test
public void testCifar10Generation() throws IOException, TemplateException { public void testCifar10Generation() throws IOException, TemplateException {
Log.getFindings().clear(); Log.getFindings().clear();
String[] args = {"-m", "src/test/resources/models/", "-r", "cifar10.Cifar10Classifier", "-b", "MXNET", "-f", "n"}; String[] args = {"-m", "src/test/resources/models/", "-r", "cifar10.Cifar10Classifier", "-b", "MXNET", "-p", "/home/christopher/anaconda3/bin/python", "-f", "n"};
EMADLGeneratorCli.main(args); EMADLGeneratorCli.main(args);
assertTrue(Log.getFindings().isEmpty()); assertTrue(Log.getFindings().isEmpty());
...@@ -95,7 +95,7 @@ public class GenerationTest extends AbstractSymtabTest { ...@@ -95,7 +95,7 @@ public class GenerationTest extends AbstractSymtabTest {
@Test @Test
public void testSimulatorGeneration() throws IOException, TemplateException { public void testSimulatorGeneration() throws IOException, TemplateException {
Log.getFindings().clear(); Log.getFindings().clear();
String[] args = {"-m", "src/test/resources/models/", "-r", "simulator.MainController", "-b", "MXNET", "-f", "n"}; String[] args = {"-m", "src/test/resources/models/", "-r", "simulator.MainController", "-b", "MXNET", "-p", "/home/christopher/anaconda3/bin/python", "-f", "n"};
EMADLGeneratorCli.main(args); EMADLGeneratorCli.main(args);
assertTrue(Log.getFindings().isEmpty()); assertTrue(Log.getFindings().isEmpty());
} }
...@@ -103,7 +103,7 @@ public class GenerationTest extends AbstractSymtabTest { ...@@ -103,7 +103,7 @@ public class GenerationTest extends AbstractSymtabTest {
@Test @Test
public void testAddGeneration() throws IOException, TemplateException { public void testAddGeneration() throws IOException, TemplateException {
Log.getFindings().clear(); Log.getFindings().clear();
String[] args = {"-m", "src/test/resources/models/", "-r", "Add", "-b", "MXNET", "-f", "n"}; String[] args = {"-m", "src/test/resources/models/", "-r", "Add", "-b", "MXNET", "-p", "/home/christopher/anaconda3/bin/python", "-f", "n"};
EMADLGeneratorCli.main(args); EMADLGeneratorCli.main(args);
assertTrue(Log.getFindings().isEmpty()); assertTrue(Log.getFindings().isEmpty());
} }
...@@ -111,7 +111,7 @@ public class GenerationTest extends AbstractSymtabTest { ...@@ -111,7 +111,7 @@ public class GenerationTest extends AbstractSymtabTest {
@Test @Test
public void testAlexnetGeneration() throws IOException, TemplateException { public void testAlexnetGeneration() throws IOException, TemplateException {
Log.getFindings().clear(); Log.getFindings().clear();
String[] args = {"-m", "src/test/resources/models/", "-r", "Alexnet", "-b", "MXNET", "-f", "n"}; String[] args = {"-m", "src/test/resources/models/", "-r", "Alexnet", "-b", "MXNET", "-p", "/home/christopher/anaconda3/bin/python", "-f", "n"};
EMADLGeneratorCli.main(args); EMADLGeneratorCli.main(args);
assertTrue(Log.getFindings().isEmpty()); assertTrue(Log.getFindings().isEmpty());
} }
...@@ -119,7 +119,7 @@ public class GenerationTest extends AbstractSymtabTest { ...@@ -119,7 +119,7 @@ public class GenerationTest extends AbstractSymtabTest {
@Test @Test
public void testResNeXtGeneration() throws IOException, TemplateException { public void testResNeXtGeneration() throws IOException, TemplateException {
Log.getFindings().clear(); Log.getFindings().clear();
String[] args = {"-m", "src/test/resources/models/", "-r", "ResNeXt50", "-b", "MXNET", "-f", "n"}; String[] args = {"-m", "src/test/resources/models/", "-r", "ResNeXt50", "-b", "MXNET", "-p", "/home/christopher/anaconda3/bin/python", "-f", "n"};
EMADLGeneratorCli.main(args); EMADLGeneratorCli.main(args);
assertTrue(Log.getFindings().isEmpty()); assertTrue(Log.getFindings().isEmpty());
} }
...@@ -127,7 +127,7 @@ public class GenerationTest extends AbstractSymtabTest { ...@@ -127,7 +127,7 @@ public class GenerationTest extends AbstractSymtabTest {
@Test @Test
public void testThreeInputGeneration() throws IOException, TemplateException { public void testThreeInputGeneration() throws IOException, TemplateException {
Log.getFindings().clear(); Log.getFindings().clear();
String[] args = {"-m", "src/test/resources/models/", "-r", "ThreeInputCNN_M14", "-b", "MXNET", "-f", "n"}; String[] args = {"-m", "src/test/resources/models/", "-r", "ThreeInputCNN_M14", "-b", "MXNET", "-p", "/home/christopher/anaconda3/bin/python", "-f", "n"};
EMADLGeneratorCli.main(args); EMADLGeneratorCli.main(args);
assertTrue(Log.getFindings().size() == 1); assertTrue(Log.getFindings().size() == 1);
} }
...@@ -135,7 +135,7 @@ public class GenerationTest extends AbstractSymtabTest { ...@@ -135,7 +135,7 @@ public class GenerationTest extends AbstractSymtabTest {
@Test @Test
public void testMultipleOutputsGeneration() throws IOException, TemplateException { public void testMultipleOutputsGeneration() throws IOException, TemplateException {
Log.getFindings().clear(); Log.getFindings().clear();
String[] args = {"-m", "src/test/resources/models/", "-r", "MultipleOutputs", "-b", "MXNET", "-f", "n"}; String[] args = {"-m", "src/test/resources/models/", "-r", "MultipleOutputs", "-b", "MXNET", "-p", "/home/christopher/anaconda3/bin/python", "-f", "n"};
EMADLGeneratorCli.main(args); EMADLGeneratorCli.main(args);
assertTrue(Log.getFindings().size() == 1); assertTrue(Log.getFindings().size() == 1);
} }
...@@ -143,7 +143,7 @@ public class GenerationTest extends AbstractSymtabTest { ...@@ -143,7 +143,7 @@ public class GenerationTest extends AbstractSymtabTest {
@Test @Test
public void testVGGGeneration() throws IOException, TemplateException { public void testVGGGeneration() throws IOException, TemplateException {
Log.getFindings().clear(); Log.getFindings().clear();
String[] args = {"-m", "src/test/resources/models/", "-r", "VGG16", "-b", "MXNET", "-f", "n"}; String[] args = {"-m", "src/test/resources/models/", "-r", "VGG16", "-b", "MXNET", "-p", "/home/christopher/anaconda3/bin/python", "-f", "n"};
EMADLGeneratorCli.main(args); EMADLGeneratorCli.main(args);
assertTrue(Log.getFindings().isEmpty()); assertTrue(Log.getFindings().isEmpty());
} }
...@@ -152,7 +152,7 @@ public class GenerationTest extends AbstractSymtabTest { ...@@ -152,7 +152,7 @@ public class GenerationTest extends AbstractSymtabTest {
public void testMultipleInstances() throws IOException, TemplateException { public void testMultipleInstances() throws IOException, TemplateException {
try { try {
Log.getFindings().clear(); Log.getFindings().clear();
String[] args = {"-m", "src/test/resources/models/", "-r", "InstanceTest.MainB", "-b", "MXNET", "-f", "n"}; String[] args = {"-m", "src/test/resources/models/", "-r", "InstanceTest.MainB", "-b", "MXNET", "-p", "/home/christopher/anaconda3/bin/python", "-f", "n"};
EMADLGeneratorCli.main(args); EMADLGeneratorCli.main(args);
assertTrue(Log.getFindings().isEmpty()); assertTrue(Log.getFindings().isEmpty());
} }
...@@ -197,7 +197,7 @@ public class GenerationTest extends AbstractSymtabTest { ...@@ -197,7 +197,7 @@ public class GenerationTest extends AbstractSymtabTest {
public void testDontRetrain1() { public void testDontRetrain1() {
// The training hash is stored during the first training, so the second one is skipped // The training hash is stored during the first training, so the second one is skipped
Log.getFindings().clear(); Log.getFindings().clear();
String[] args = {"-m", "src/test/resources/models/", "-r", "cifar10.Cifar10Classifier", "-b", "MXNET"}; String[] args = {"-m", "src/test/resources/models/", "-r", "cifar10.Cifar10Classifier", "-b", "MXNET", "-p", "/home/christopher/anaconda3/bin/python"};
EMADLGeneratorCli.main(args); EMADLGeneratorCli.main(args);
assertTrue(Log.getFindings().isEmpty()); assertTrue(Log.getFindings().isEmpty());
...@@ -215,9 +215,7 @@ public class GenerationTest extends AbstractSymtabTest { ...@@ -215,9 +215,7 @@ public class GenerationTest extends AbstractSymtabTest {
Log.getFindings().clear(); Log.getFindings().clear();
createHashFile(); createHashFile();
System.out.println("============ Test 2 started ==============="); String[] args = {"-m", "src/test/resources/models/", "-r", "cifar10.Cifar10Classifier", "-b", "MXNET", "-p", "/home/christopher/anaconda3/bin/python"};
String[] args = {"-m", "src/test/resources/models/", "-r", "cifar10.Cifar10Classifier", "-b", "MXNET"};
EMADLGeneratorCli.main(args); EMADLGeneratorCli.main(args);
assertTrue(Log.getFindings().size() == 1); assertTrue(Log.getFindings().size() == 1);
assertTrue(Log.getFindings().get(0).getMsg().contains("skipped")); assertTrue(Log.getFindings().get(0).getMsg().contains("skipped"));
...@@ -229,7 +227,7 @@ public class GenerationTest extends AbstractSymtabTest { ...@@ -229,7 +227,7 @@ public class GenerationTest extends AbstractSymtabTest {
public void testDontRetrain3() { public void testDontRetrain3() {
// Multiple instances of the first NN are used. Only the first one should cause a training // Multiple instances of the first NN are used. Only the first one should cause a training
Log.getFindings().clear(); Log.getFindings().clear();
String[] args = {"-m", "src/test/resources/models/", "-r", "instanceTestCifar.MainC", "-b", "MXNET"}; String[] args = {"-m", "src/test/resources/models/", "-r", "instanceTestCifar.MainC", "-b", "MXNET", "-p", "/home/christopher/anaconda3/bin/python"};
EMADLGeneratorCli.main(args); EMADLGeneratorCli.main(args);
assertTrue(Log.getFindings().size() == 1); assertTrue(Log.getFindings().size() == 1);
assertTrue(Log.getFindings().get(0).getMsg().contains("skipped")); assertTrue(Log.getFindings().get(0).getMsg().contains("skipped"));
...@@ -241,7 +239,7 @@ public class GenerationTest extends AbstractSymtabTest { ...@@ -241,7 +239,7 @@ public class GenerationTest extends AbstractSymtabTest {
Log.getFindings().clear(); Log.getFindings().clear();
createHashFile(); createHashFile();
String[] args = {"-m", "src/test/resources/models/", "-r", "cifar10.Cifar10Classifier", "-b", "MXNET", "-f", "y"}; String[] args = {"-m", "src/test/resources/models/", "-r", "cifar10.Cifar10Classifier", "-b", "MXNET", "-p", "/home/christopher/anaconda3/bin/python", "-f", "y"};
EMADLGeneratorCli.main(args); EMADLGeneratorCli.main(args);
assertTrue(Log.getFindings().isEmpty()); assertTrue(Log.getFindings().isEmpty());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment