Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve embedded tomcat detection #1809

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/org/labkey/test/TestFileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ public static File getGradleReportDir()
}

/**
* Private because deployment structure varies between Non-embedded, locally built embedded, and deployed embedded
* distribution.
* Access is restricted because deployment structure varies between Non-embedded, locally built embedded, and
* deployed embedded distribution.
*/
private static File getDefaultDeployDir()
static File getDefaultDeployDir()
{
return new File(getLabKeyRoot(), "build/deploy");
}
Expand Down
23 changes: 1 addition & 22 deletions src/org/labkey/test/TestProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
public abstract class TestProperties
{

private static final String USE_EMBEDDED_TOMCAT = "useEmbeddedTomcat";

static
{
// https://github.com/SeleniumHQ/selenium/issues/11750#issuecomment-1470357124
Expand Down Expand Up @@ -72,25 +70,6 @@ public abstract class TestProperties
ioe.printStackTrace(System.err);
}

File serverPropFile = new File(TestFileUtils.getLabKeyRoot(), "gradle.properties");
if (!System.getProperties().containsKey(USE_EMBEDDED_TOMCAT) && serverPropFile.isFile())
{
// Gradle properties don't get pulled into tests when running in IntelliJ
try (Reader serverPropReader = Readers.getReader(serverPropFile))
{
TestLogger.log("Loading properties from " + propFile.getName());
Properties properties = new Properties();
properties.load(serverPropReader);
if (properties.containsKey(USE_EMBEDDED_TOMCAT))
System.setProperty(USE_EMBEDDED_TOMCAT, "");
}
catch (IOException ioe)
{
TestLogger.error("Failed to load " + serverPropFile.getName() + " file. Ignoring");
ioe.printStackTrace(System.err);
}
}

}

public static void load()
Expand Down Expand Up @@ -252,7 +231,7 @@ public static boolean isTrialServer()

public static boolean isEmbeddedTomcat()
{
return System.getProperties().containsKey(USE_EMBEDDED_TOMCAT);
return System.getProperties().containsKey("useEmbeddedTomcat") || new File(TestFileUtils.getDefaultDeployDir(), "embedded").isDirectory();
}

public static boolean isCheckerFatal()
Expand Down
3 changes: 3 additions & 0 deletions src/org/labkey/test/tests/CrawlerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ public void postTest()
CspLogUtil.resetCspLogMark();
}

@Override
public void checkLinks() { /* Nothing interesting to crawl */ }

@Override
protected BrowserType bestBrowser()
{
Expand Down