Skip to content

Commit 88ef758

Browse files
Merge branch 'develop' into fb_pipelineFileLike
2 parents 032e687 + 001e03f commit 88ef758

10 files changed

Lines changed: 60 additions & 71 deletions

File tree

data/qc/noopTransform.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
all.lines = readLines("${runInfo}")
2+
runDataFile.line = grep("^runDataFile", all.lines, value = TRUE);
3+
runDataFile.props <- strsplit(runDataFile.line, "\t")[[1]]
4+
run.data.file = runDataFile.props[2];
5+
run.output.file = runDataFile.props[4];
6+
7+
run.data = read.delim(run.data.file, header=TRUE, sep="\t", quote="", check.names=FALSE);
8+
run.data$TransformType = "${transformOperation}";
9+
write.table(run.data, file=run.output.file, sep="\t", na="", row.names=FALSE, quote=TRUE, qmethod="double");

modules/editableModule/src/org/labkey/editablemodule/EditableModuleContainerListener.java

Lines changed: 0 additions & 55 deletions
This file was deleted.

modules/editableModule/src/org/labkey/editablemodule/EditableModuleModule.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ protected void init()
5252
@Override
5353
public void doStartup(ModuleContext moduleContext)
5454
{
55-
// add a container listener so we'll know when our container is deleted:
56-
ContainerManager.addContainerListener(new EditableModuleContainerListener());
5755
}
5856

5957
@Override

src/org/labkey/test/components/domain/DomainFieldRow.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,12 @@ public DomainFieldRow setSampleType(String sampleTypeName)
12521252
return this;
12531253
}
12541254

1255+
public List<String> getAvailableSampleTypes()
1256+
{
1257+
expand();
1258+
return elementCache().getLookupSampleTypeSelect().getOptions().stream().map(WebElement::getText).collect(Collectors.toList());
1259+
}
1260+
12551261
public DomainFieldRow setAliquotOption(ExpSchema.DerivationDataScopeType option)
12561262
{
12571263
expand();

src/org/labkey/test/components/ui/grids/ResponsiveGrid.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55
package org.labkey.test.components.ui.grids;
66

7+
import org.awaitility.Awaitility;
78
import org.jetbrains.annotations.Nullable;
89
import org.labkey.remoteapi.query.Filter;
910
import org.labkey.test.Locator;
@@ -26,6 +27,7 @@
2627
import org.openqa.selenium.interactions.Actions;
2728
import org.openqa.selenium.support.ui.ExpectedConditions;
2829

30+
import java.time.Duration;
2931
import java.util.ArrayList;
3032
import java.util.Arrays;
3133
import java.util.Collection;
@@ -357,20 +359,16 @@ public void editColumnLabel(CharSequence columnIdentifier, String newColumnLabel
357359
.keyUp(Keys.SHIFT)
358360
.perform();
359361

360-
// Enter the new text.
361-
textEdit.sendKeys(newColumnLabel, Keys.RETURN);
362+
doAndWaitForUpdate(()-> {
363+
textEdit.sendKeys(newColumnLabel, Keys.RETURN);
362364

363-
getWrapper().shortWait()
365+
getWrapper().shortWait()
364366
.withMessage("Column label edit text box did not go away.")
365367
.until(ExpectedConditions.stalenessOf(textEdit));
366368

367-
doAndWaitForUpdate(()->
368-
WebDriverWrapper.waitFor(()-> WebElementUtils.getTextContent(headerCell).equals(newColumnLabel),
369-
"Column header not updated.", 1_000)
370-
);
371-
waitForLoaded();
372-
clearElementCache();
373-
369+
Awaitility.await().atMost(Duration.ofSeconds(1)).untilAsserted(() -> assertEquals("Column label",
370+
newColumnLabel, WebElementUtils.getTextContent(headerCell)));
371+
});
374372
}
375373

376374
/**

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.labkey.test.BaseWebDriverTest;
99
import org.labkey.test.Locator;
1010
import org.labkey.test.categories.Daily;
11+
import org.labkey.test.util.WebServicesUtil;
1112

1213
import java.util.List;
1314

@@ -53,7 +54,10 @@ public void testLinkedReportToExternalURL()
5354
waitAndClick(Locator.linkWithText(REPORT_NAME));
5455
switchToWindow(1);
5556

56-
waitForElement(Locator.linkWithText("Get a Demo"));
57+
if (!WebServicesUtil.isLabKeyDotOrgMaintenance(getDriver()))
58+
{
59+
waitForElement(Locator.linkWithText("Get a Demo"));
60+
}
5761
Assert.assertEquals("Linked report navigated to incorrect external link", LINK_REPORT_URL, getDriver().getCurrentUrl());
5862
}
5963
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.labkey.test.util.DataRegionTable;
3333
import org.labkey.test.util.PortalHelper;
3434
import org.labkey.test.util.URLBuilder;
35+
import org.labkey.test.util.WebServicesUtil;
3536
import org.openqa.selenium.WebElement;
3637

3738
import java.io.IOException;
@@ -764,6 +765,7 @@ public void testScopeFromSiteToSubFolder() throws IOException, CommandException
764765
WebElement banner = Locator.tagWithText("h3", "Date & Number Display Formats").refindWhenNeeded(getDriver());
765766
checker().withScreenshot()
766767
.verifyTrue("'Click here' link did not navigate as expected.",
768+
WebServicesUtil.isLabKeyDotOrgMaintenance(getDriver()) ||
767769
waitFor(banner::isDisplayed, 1_000));
768770
closeExtraWindows();
769771
}

src/org/labkey/test/tests/component/GridPanelTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private void createSmallSampleType() throws IOException, CommandException
165165
FILTER_INT_COL.getName(), TestDataGenerator.randomInt(1, INT_MAX),
166166
FILTER_STRING_COL.getName(), stringSets.get(setIndex++),
167167
FILTER_DATE_COL.getName(), sampleSetDataGenerator.randomDateString(DateUtils.addWeeks(new Date(), -25), new Date()),
168-
FILTER_BOOL_COL.getName(), sampleSetDataGenerator.randomBoolean())
168+
FILTER_BOOL_COL.getName(), TestDataGenerator.randomBoolean())
169169
);
170170
}
171171

src/org/labkey/test/util/TestDataGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ private Supplier<Object> getDefaultDataSupplier(PropertyDescriptor propertyDescr
469469
case "double":
470470
return () -> randomDouble(0, 20);
471471
case "boolean":
472-
return this::randomBoolean;
472+
return TestDataGenerator::randomBoolean;
473473
case "date":
474474
case "datetime":
475475
return () -> randomDateString(DateUtils.addWeeks(new Date(), -39), new Date());
@@ -797,7 +797,7 @@ public String randomDateString(String dateFormat, Date min, Date max)
797797
return new SimpleDateFormat(dateFormat).format(date);
798798
}
799799

800-
public boolean randomBoolean()
800+
public static boolean randomBoolean()
801801
{
802802
return ThreadLocalRandom.current().nextBoolean();
803803
}

src/org/labkey/test/util/WebServicesUtil.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@
1515
*/
1616
package org.labkey.test.util;
1717

18+
import org.openqa.selenium.WebDriver;
19+
1820
import java.io.IOException;
1921
import java.net.InetAddress;
2022
import java.net.InetSocketAddress;
2123
import java.net.Socket;
24+
import java.net.URL;
25+
import java.util.Objects;
2226

2327
import static org.junit.Assert.assertTrue;
2428

@@ -91,4 +95,27 @@ static public Socket openSocket(String hostIp, int port) throws IOException
9195
socket.connect(new InetSocketAddress(hostIp, port), 2000);
9296
return socket;
9397
}
98+
99+
/**
100+
* Checks whether the current page is the maintenance page for labkey.org.
101+
* This is usually indicated by a {@code 502}-{@code 504} status code.
102+
* Allows tests that check links to labkey.org to not fail during maintenance periods.
103+
*
104+
* @param driver The WebDriver instance to check
105+
* @return true if the current page is the maintenance page for labkey.org, false otherwise.
106+
*/
107+
public static boolean isLabKeyDotOrgMaintenance(WebDriver driver)
108+
{
109+
try
110+
{
111+
URL url = new URL(Objects.requireNonNull(driver.getCurrentUrl()));
112+
String title = driver.getTitle();
113+
int responseCode = Integer.parseInt(Objects.requireNonNull(title).substring(0, 3));
114+
return url.getHost().endsWith("labkey.org") && 502 <= responseCode && responseCode <= 504;
115+
}
116+
catch (Exception e)
117+
{
118+
return false;
119+
}
120+
}
94121
}

0 commit comments

Comments
 (0)