diff --git a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/family/FamilyAnalysisTest.java b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/family/FamilyAnalysisTest.java index 91ac362447..b4bb3310fb 100644 --- a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/family/FamilyAnalysisTest.java +++ b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/family/FamilyAnalysisTest.java @@ -109,10 +109,9 @@ public void tearDown() throws Exception { } @Test - public void creationTest() { + public void creationTest() throws IOException { PedigreeGraph pedigreeGraph = family.getPedigreeGraph(); - assertTrue(pedigreeGraph.getBase64().startsWith("iVBORw0KGgoAAAANSUhEUgAAAeA")); - assertTrue(pedigreeGraph.getBase64().endsWith("AIDB6Bwfs3Rj5UIf81hI8AAAAASUVORK5CYII=")); + assertEquals(runAndGetPedigreeImageB64(family), pedigreeGraph.getBase64()); } @Test @@ -130,7 +129,7 @@ public void twoMemberFamilyTest() throws CatalogException { } @Test - public void threeMemberNoDisorderFamilyTest() throws CatalogException { + public void threeMemberNoDisorderFamilyTest() throws CatalogException, IOException { FamilyUpdateParams updateParams = new FamilyUpdateParams(); QueryOptions queryOptions = new QueryOptions() @@ -140,33 +139,30 @@ public void threeMemberNoDisorderFamilyTest() throws CatalogException { .first(); PedigreeGraph pedigreeGraph = updatedFamily.getPedigreeGraph(); - assertTrue(pedigreeGraph.getBase64().startsWith("iVBORw0KGgoAAAANSUhEUgAAAeAAAAH")); - assertTrue(pedigreeGraph.getBase64().endsWith("2WENFPAsd1MAAAAASUVORK5CYII=")); + assertEquals(runAndGetPedigreeImageB64(updatedFamily), pedigreeGraph.getBase64()); } @Test - public void threeGenerationFamilyTest() throws CatalogException { + public void threeGenerationFamilyTest() throws CatalogException, IOException { Family threeGenFamily = createThreeGenerationFamily("Cos-Cos", true).first(); PedigreeGraph pedigreeGraph = threeGenFamily.getPedigreeGraph(); - assertTrue(pedigreeGraph.getBase64().startsWith("iVBORw0KGgoAAAANSUhEUgAAAeAAAAHgCA")); - assertTrue(pedigreeGraph.getBase64().endsWith("h9S2DROnwXOvwAAAABJRU5ErkJggg==")); + assertEquals(runAndGetPedigreeImageB64(threeGenFamily), pedigreeGraph.getBase64()); } @Test - public void threeGenerationFamilyWithoutDisorderTest() throws CatalogException { + public void threeGenerationFamilyWithoutDisorderTest() throws CatalogException, IOException { Family threeGenFamily = createThreeGenerationFamily("Hello-Hello", false).first(); PedigreeGraph pedigreeGraph = threeGenFamily.getPedigreeGraph(); - assertTrue(pedigreeGraph.getBase64().startsWith("iVBORw0KGgoAAAANSUhEUgAAAeAAAAHgC")); - assertTrue(pedigreeGraph.getBase64().endsWith("wNJj9EVvh8HVQAAAABJRU5ErkJggg==")); + assertEquals(runAndGetPedigreeImageB64(threeGenFamily), pedigreeGraph.getBase64()); } @Test - public void test2Member2GenerationFamilyTest() throws CatalogException { + public void test2Member2GenerationFamilyTest() throws CatalogException, IOException { Family family = create2Member2GenerationDummyFamily("Colo-Colo", "father222-sample", "child2222-sample").first(); PedigreeGraph pedigreeGraph = family.getPedigreeGraph(); - assertTrue(pedigreeGraph.getBase64().startsWith("iVBORw0KGgoAAAANSUhEUgAAA")); - assertTrue(pedigreeGraph.getBase64().endsWith("qkAAAAASUVORK5CYII=")); + + assertEquals(runAndGetPedigreeImageB64(family), pedigreeGraph.getBase64()); } @Test @@ -205,9 +201,6 @@ public void testPedigreeGraphAnalysis() throws ToolException, IOException { false, sessionIdUser); String b64Image = PedigreeGraphUtils.getB64Image(outDir); - MatcherAssert.assertThat(b64Image, CoreMatchers.startsWith("iVBORw0KGgoAAAANSUhEUgAAAeAAAAHg")); - MatcherAssert.assertThat(b64Image, CoreMatchers.endsWith("s3Rj5UIf81hI8AAAAASUVORK5CYII=")); - assertEquals(family.getPedigreeGraph().getBase64(), b64Image); } @@ -477,4 +470,12 @@ private static DataResult create2Member2GenerationDummyFamily(String fam return familyOpenCGAResult; } + + + public String runAndGetPedigreeImageB64(Family family) throws IOException { + Path scratchDir = Paths.get(opencga.createTmpOutdir()); + PedigreeGraph pedigreeGraph = PedigreeGraphUtils.getPedigreeGraph(family, opencga.getOpencgaHome(), scratchDir); + return pedigreeGraph.getBase64(); + + } } diff --git a/opencga-core/src/main/resources/configuration.yml b/opencga-core/src/main/resources/configuration.yml index 7d8c91c340..4eb3543f79 100644 --- a/opencga-core/src/main/resources/configuration.yml +++ b/opencga-core/src/main/resources/configuration.yml @@ -170,7 +170,6 @@ analysis: k8s.nodeSelector: agentpool: jobs kubernetes.io/os: linux - kubernetes.io/role: agent # FOR ACI: # k8s.requests: # cpu: 2 diff --git a/pom.xml b/pom.xml index 03b422906c..911c6ab2dc 100644 --- a/pom.xml +++ b/pom.xml @@ -43,14 +43,13 @@ - 3.3.0 - 3.3.0 - 6.3.0 - 3.3.0 - 5.3.0 - 3.3.0 - - 0.2.0 + 4.0.0_dev + 4.0.0_dev + 7.0.0-SNAPSHOT + 4.0.0-SNAPSHOT + 6.0.0-SNAPSHOT + 4.0.0-SNAPSHOT + 0.2.0 2.14.3 2.30.1