-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add a long report ETL for testing pipeline job cancellation #2091
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
996931c
Add a long report ETL for testing pipeline job cancellation
labkey-tchad 80b2719
Add trailing newline
labkey-tchad 87e749c
Clean up ETLScheduler
labkey-tchad a6a8795
Merge remote-tracking branch 'origin/develop' into fb_pipelineCancelTest
labkey-tchad 630f18c
Make ETLTest project setup more efficient
labkey-tchad 7e2bf22
Merge remote-tracking branch 'origin/develop' into fb_pipelineCancelTest
labkey-tchad fd2019e
Use folder archive for etl tests instead of folder type
labkey-tchad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<etl xmlns="http://labkey.org/etl/xml"> | ||
<name>Long Running Report ETL</name> | ||
<description>run scheduled report</description> | ||
<transforms> | ||
<transform id="step1" type="TaskRefTransformStep"> | ||
<taskref ref="org.labkey.di.pipeline.RunReportTask"> | ||
<settings> | ||
<setting name="reportId" value="module:ETLtest/etlReportWithSleep.R"/> | ||
<setting name="greeter" value="STEP1"/> | ||
</settings> | ||
</taskref> | ||
</transform> | ||
</transforms> | ||
</etl> |
3 changes: 3 additions & 0 deletions
3
modules/ETLtest/resources/reports/schemas/etlReportWithSleep.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
cat('Hello, ', labkey.url.params$greeter, '!\n', sep='') | ||
Sys.sleep(20) | ||
cat('Goodbye, ', labkey.url.params$greeter, '!\n', sep='') |
7 changes: 7 additions & 0 deletions
7
modules/ETLtest/resources/reports/schemas/etlReportWithSleep.report.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ReportDescriptor descriptorType="rReportDescriptor" reportName="etlReportWithSleep" xmlns="http://labkey.org/query/xml"> | ||
<Properties> | ||
<Prop name="runInBackground">true</Prop> | ||
</Properties> | ||
<tags/> | ||
</ReportDescriptor> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
import org.labkey.test.components.Component; | ||
import org.labkey.test.components.html.BootstrapMenu; | ||
import org.labkey.test.pages.LabKeyPage; | ||
import org.labkey.test.pages.pipeline.PipelineStatusDetailsPage; | ||
import org.labkey.test.selenium.LazyWebElement; | ||
import org.labkey.test.util.Ext4Helper; | ||
import org.labkey.test.util.LogMethod; | ||
|
@@ -31,33 +32,33 @@ | |
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class ETLScheduler extends LabKeyPage<ETLScheduler.Elements> | ||
public class ETLSchedulerPage extends LabKeyPage<ETLSchedulerPage.Elements> | ||
{ | ||
public ETLScheduler(BaseWebDriverTest test) | ||
public ETLSchedulerPage(BaseWebDriverTest test) | ||
{ | ||
super(test); | ||
} | ||
|
||
public static ETLScheduler beginAt(BaseWebDriverTest test) | ||
public static ETLSchedulerPage beginAt(BaseWebDriverTest test) | ||
{ | ||
return beginAt(test, test.getCurrentContainerPath()); | ||
} | ||
|
||
public static ETLScheduler beginAt(BaseWebDriverTest test, String containerPath) | ||
public static ETLSchedulerPage beginAt(BaseWebDriverTest test, String containerPath) | ||
{ | ||
test.beginAt(WebTestHelper.buildURL("dataintegration", containerPath, "begin")); | ||
return new ETLScheduler(test); | ||
return new ETLSchedulerPage(test); | ||
} | ||
|
||
public TransformRow transform(String transformId) | ||
{ | ||
return elementCache().findTransformRow(transformId); | ||
} | ||
|
||
public LabKeyPage viewProcessedJobs() | ||
public LabKeyPage<?> viewProcessedJobs() | ||
{ | ||
_test.clickAndWait(elementCache().viewProcessedJobsButton); | ||
return new LabKeyPage(_test); | ||
clickAndWait(elementCache().viewProcessedJobsButton); | ||
return new LabKeyPage<>(this); | ||
} | ||
|
||
public int rowCount() | ||
|
@@ -71,9 +72,9 @@ protected Elements elementCache() | |
return new Elements(); | ||
} | ||
|
||
protected class Elements extends LabKeyPage<?>.ElementCache | ||
protected class Elements extends LabKeyPage<Elements>.ElementCache | ||
{ | ||
private Map<String, TransformRow> transformRows = new HashMap<>(); | ||
private final Map<String, TransformRow> transformRows = new HashMap<>(); | ||
|
||
protected TransformRow findTransformRow(String transformId) | ||
{ | ||
|
@@ -116,7 +117,7 @@ public boolean isEnabled() | |
|
||
public TransformRow setEnabled(boolean enable) | ||
{ | ||
_test.setCheckbox(elementCache().enabledCheckbox, enable); | ||
setCheckbox(elementCache().enabledCheckbox, enable); | ||
return this; | ||
} | ||
|
||
|
@@ -127,7 +128,7 @@ public TransformRow setEnabled(boolean enable) | |
// | ||
// public TransformRow setVerboseLoggingEnabled(boolean enable) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Delete this commented out code? |
||
// { | ||
// _test.setCheckbox(elements().verboseLoggingCheckbox, enable); | ||
// setCheckbox(elements().verboseLoggingCheckbox, enable); | ||
// return this; | ||
// } | ||
|
||
|
@@ -159,44 +160,44 @@ public String getLastStatus() | |
return elementCache().lastStatus.getText(); | ||
} | ||
|
||
public LabKeyPage clickLastStatus() | ||
public PipelineStatusDetailsPage clickLastStatus() | ||
{ | ||
_test.clickAndWait(elementCache().lastStatus.findElement(By.cssSelector("a"))); | ||
clickAndWait(elementCache().lastStatus.findElement(By.cssSelector("a"))); | ||
|
||
return new LabKeyPage(_test); | ||
return new PipelineStatusDetailsPage(getDriver()); | ||
} | ||
|
||
public String getLastRun() | ||
{ | ||
return elementCache().lastRun.getText(); | ||
} | ||
|
||
public LabKeyPage clickLastRun() | ||
public PipelineStatusDetailsPage clickLastRun() | ||
{ | ||
_test.clickAndWait(elementCache().lastRun.findElement(By.cssSelector("a"))); | ||
clickAndWait(elementCache().lastRun.findElement(By.cssSelector("a"))); | ||
|
||
return new LabKeyPage(_test); | ||
return new PipelineStatusDetailsPage(getDriver()); | ||
} | ||
|
||
public String getLastChecked() | ||
{ | ||
return elementCache().lastChecked.getText(); | ||
} | ||
|
||
public LabKeyPage runNow() | ||
public PipelineStatusDetailsPage runNow() | ||
{ | ||
_test.clickAndWait(elementCache().runNowButton); | ||
clickAndWait(elementCache().runNowButton); | ||
|
||
return new LabKeyPage(_test); | ||
return new PipelineStatusDetailsPage(getDriver()); | ||
} | ||
|
||
public LabKeyPage reset() | ||
public ETLSchedulerPage reset() | ||
{ | ||
new BootstrapMenu(getDriver(), Locator.tagWithClassContaining("div", "lk-menu-drop") | ||
.withChild(Locator.lkButton("Reset State...")).findElement(this)) | ||
.clickSubMenu(true, "Reset"); | ||
|
||
return new LabKeyPage(_test); | ||
return ETLSchedulerPage.this; | ||
} | ||
|
||
@LogMethod(quiet = true) | ||
|
@@ -219,35 +220,35 @@ public class Confirm | |
{ | ||
public Confirm() | ||
{ | ||
_test.waitForElement(Ext4Helper.Locators.window("Confirm")); | ||
waitForElement(Ext4Helper.Locators.window("Confirm")); | ||
} | ||
|
||
public Confirm assertMessageContains() | ||
{ | ||
throw new NotImplementedException(""); | ||
} | ||
|
||
public ETLScheduler confirmNo() | ||
public ETLSchedulerPage confirmNo() | ||
{ | ||
Locator.XPathLocator noButton = Ext4Helper.Locators.windowButton("Confirm", "No"); | ||
_test.click(noButton); | ||
_test.waitForElementToDisappear(noButton); | ||
click(noButton); | ||
waitForElementToDisappear(noButton); | ||
|
||
return ETLScheduler.this; | ||
return ETLSchedulerPage.this; | ||
} | ||
|
||
public ETLScheduler confirmYes() | ||
public ETLSchedulerPage confirmYes() | ||
{ | ||
_test.click(Ext4Helper.Locators.windowButton("Confirm", "Yes")); | ||
_test.waitForElement(Ext4Helper.Locators.window("Success")); | ||
_test.click(Ext4Helper.Locators.windowButton("Success", "OK")); | ||
_test.waitForElementToDisappear(Ext4Helper.Locators.window("Success")); | ||
click(Ext4Helper.Locators.windowButton("Confirm", "Yes")); | ||
waitForElement(Ext4Helper.Locators.window("Success")); | ||
click(Ext4Helper.Locators.windowButton("Success", "OK")); | ||
waitForElementToDisappear(Ext4Helper.Locators.window("Success")); | ||
|
||
return ETLScheduler.this; | ||
return ETLSchedulerPage.this; | ||
} | ||
} | ||
|
||
private class RowElements extends Component<?>.ElementCache | ||
protected class RowElements extends Component<RowElements>.ElementCache | ||
{ | ||
// Column numbers | ||
private final int NAME = 1; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably we should wait for when we consolidate into
premiumModules
, but it seems like it would be nice to have this test code and theETLtest
module live into the same repo asdataintegration