-
Notifications
You must be signed in to change notification settings - Fork 10
[no ticket][risk=no] Fix e2e genomic-extraction-to-vcf test: Update waitForComplete function #6532
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
Conversation
e2e/app/component/table.ts
Outdated
break; | ||
} | ||
} | ||
async findCellByRowValue(searchColumnHeader, searchCellValue, resultColumnHeader): Promise<Cell | null> { |
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.
This func did not work for the History table. So I had to fix this. Some changed files in this PR are due to this func change.
}); | ||
|
||
// Check creation status. | ||
async function waitForComplete(page: Page, maxTime: number): Promise<boolean> { |
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.
waitForComplete()
is just too big. Broke it down into two smaller functions: waitForRuntimeComplete()
and waitForExtractionComplete
.
private async getStatusSpinnerXpath(datasetName: string): Promise<string> { | ||
const historyTable = this.getHistoryTable(); | ||
await historyTable.waitUntilVisible(); | ||
const statusCell = await historyTable.findCellByRowValue('DATASET NAME', datasetName, 'STATUS'); |
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.
Since the Extraction History table could contain more than 1 row (from running few times in same day), look for the spinner icon in STATUS column in the same row that contains the dataset name, not look for it in the whole table.
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.
Thanks, mostly minor style comments
e2e/app/component/table.ts
Outdated
// Find the searchColumnHeader index | ||
const allColumns = await this.getColumns(); | ||
const colValues = await Promise.all(allColumns.map((column) => getPropValue<string>(column, 'innerText'))); | ||
console.log({ colValues }); |
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.
Looks like leftover debug statements, would remove
e2e/app/component/table.ts
Outdated
break; | ||
} | ||
} | ||
async findCellByRowValue(searchColumnHeader, searchCellValue, resultColumnHeader): Promise<Cell | null> { |
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.
Please add types to the parameters, it makes it easier to follow
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.
Added types to parameters. Added comments to explain the function. Removed console.log
.
e2e/app/component/table.ts
Outdated
break; | ||
} | ||
} | ||
async findCellByRowValue(searchColumnHeader, searchCellValue, resultColumnHeader): Promise<Cell | null> { |
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.
Please add method documentation of what this is supposed to do - the semantics are not obvious from the method name.
e2e/app/component/table.ts
Outdated
} | ||
// Find the row index which contains searchCellValue | ||
const allRows = await this.getRows(); | ||
const tds = await Promise.all(allRows.map((row) => row.$x('./td'))); |
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.
There's a lot of extraneous state variables introduced compared to the previous approach which is making this more challenging to read, in my opinion. I'm thinking it may be more readable to group these together, e.g.:
const searchColumnTdValues = await Promise.all(allRows.map(async (row) => {
const td = await row.$x('./td');
return getPropValue<string>(td[columnIndex], 'innerText');
}))
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.
I like new code. Going to try it if it works.
return true; | ||
.waitForXPath(statusSpinnerXpath, { | ||
visible: true, | ||
timeout: timeout |
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.
nit: just timeout
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.
Done
e2e/app/sidebar/runtime-panel.ts
Outdated
|
||
/** | ||
* Open Runtime sidebar, check status for running. | ||
* Open Runtime sidebar, wait for running or error status. |
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.
Logically, why would waitForRunning
return when it's in the error state? Consider renaming the method or else updating the semantics some other way
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.
Added comments. Renamed func to waitForFinish
.
/**
* Open the Runtime sidebar, wait for the Running or Error status.
* The Running or Error status in runtime creation is considered as done/complete.
*/
async waitForFinish(timeout?: number): Promise<boolean>
const cell = await accountAccessTable.findCellByRowValue( | ||
TableColumns.ACCESS_MODULE, | ||
accessModule, | ||
TableColumns.REQUIRED_FOR_TIER |
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.
Interesting - how did this work previously, without specifying a search column?
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.
I think it worked in this table because the TableColumns.ACCESS_MODULE
is the first column and it was the only column where the search area was.
await signInWithAccessToken(page); | ||
}); | ||
|
||
const waitForCompletionMaxTime = 60 * 60 * 1000; |
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.
This limit should be shorter than the overall timeout. By the time we reach this point in the code, we don't have 60 minutes left
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.
Yeah, forgot to update this timeout after shorten jest timeout.
// Total Count should be greater than 1. | ||
// Total Count should be greater than or equal to 1 and less than or equal to 5. | ||
// At the time of writing test, Total Count is 2. Total Count can change if synthetic dataset changes. | ||
// We want keep Total Count is larger, it will take longer time to for the extraction job to complete. |
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.
Nice
|
||
// Check creation status. | ||
async function waitForComplete(page: Page, maxTime: number): Promise<boolean> { | ||
async function waitForRuntimeComplete(page: Page, maxTime: number): Promise<boolean> { |
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.
Why do we have so much custom code in this test case for waiting on a runtime to start? Isn't this a very central function which should be supported by a library or utility? Is this not duplicated somewhere else in the code?
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.
This function can be a common function but no other tests can use it as it is now. I would need more time to refactor this function so it can be used in other places. This function doesn't initiate the Create Runtime process. The only other runtime test is nightly/runtime.spec.ts
. It's much simpler and doesn't have same test steps. But it could use this function if it is more generalized.
20df4bf
to
4856ec1
Compare
import DataTable from 'app/component/data-table'; | ||
import { waitWhileLoading } from 'utils/waits-utils'; | ||
import { exists } from 'utils/element-utils'; | ||
import Cell from '../component/cell'; |
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.
please avoid path relative imports like this (except same dir)
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.
Good catch. I missed this.
Checking for whether the genomic extraction job has finished was relying on existences of Success icon in Genomic Extraction History table. But, if job has failed, test just waits until test timed out because test code only look for the Success icon.

PR checklist