Skip to content

Commit 2dfdbb5

Browse files
Add test coverage for CycleCheckAction and CheckEdgesAction
1 parent cedecd6 commit 2dfdbb5

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

src/org/labkey/test/tests/SampleTypeLineageTest.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.junit.Test;
55
import org.junit.experimental.categories.Category;
66
import org.labkey.remoteapi.CommandException;
7+
import org.labkey.remoteapi.SimpleGetCommand;
78
import org.labkey.remoteapi.experiment.LineageCommand;
89
import org.labkey.remoteapi.experiment.LineageNode;
910
import org.labkey.remoteapi.experiment.LineageResponse;
@@ -12,6 +13,7 @@
1213
import org.labkey.remoteapi.query.SelectRowsResponse;
1314
import org.labkey.test.BaseWebDriverTest;
1415
import org.labkey.test.Locator;
16+
import org.labkey.test.WebTestHelper;
1517
import org.labkey.test.TestFileUtils;
1618
import org.labkey.test.TestTimeoutException;
1719
import org.labkey.test.categories.Daily;
@@ -842,7 +844,7 @@ public void testDeleteLineageParent() throws IOException, CommandException
842844
// create a sample type with the following explicit domain columns
843845
SampleTypeDefinition sampleType = new SampleTypeDefinition("Family");
844846
TestDataGenerator sampleGenerator = sampleType.create(createDefaultConnection(), getProjectName());
845-
847+
846848
sampleGenerator.addRow(List.of("A"));
847849
sampleGenerator.addRow(List.of("B"));
848850
sampleGenerator.addCustomRow(Map.of("name", "C", "MaterialInputs/Family", "A,B"));
@@ -1216,4 +1218,20 @@ public void testDeleteSamplesSomeWithDerivedSamples()
12161218

12171219
}
12181220

1221+
@Test
1222+
public void testDiagnosticActions() throws IOException, CommandException
1223+
{
1224+
// CycleCheckAction: confirm the page loads and the acyclic test data reports no cycles
1225+
beginAt(WebTestHelper.buildURL("experiment", PROJECT_NAME, "cycleCheck"));
1226+
assertTextPresent("This operation can use a lot of memory.");
1227+
clickButton("Continue");
1228+
assertTextPresent("No cycles found");
1229+
1230+
// CheckEdgesAction: confirm the API returns success with an empty cycle list
1231+
var cmd = new SimpleGetCommand("experiment", "checkEdges");
1232+
Map<String, Object> response = cmd.execute(createDefaultConnection(), "/" + PROJECT_NAME).getParsedData();
1233+
assertEquals("CheckEdgesAction should report success", Boolean.TRUE, response.get("success"));
1234+
assertTrue("CheckEdgesAction should find no cycle edges", ((List<?>) response.get("result")).isEmpty());
1235+
}
1236+
12191237
}

0 commit comments

Comments
 (0)