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

G2.134 Outstanding tasks to complete processing of messages to the user #134

Open
5 of 8 tasks
carolyncaron opened this issue Dec 21, 2024 · 2 comments · Fixed by #137
Open
5 of 8 tasks

G2.134 Outstanding tasks to complete processing of messages to the user #134

carolyncaron opened this issue Dec 21, 2024 · 2 comments · Fixed by #137
Assignees
Labels
Group 2 - Data Importing Any issue relating to importing of biological data into either Chado or any other database. Group 5 | Automated Testing | Performance Any issue related to automated testing and improving performance HIGH PRIORITY

Comments

@carolyncaron
Copy link
Contributor

carolyncaron commented Dec 21, 2024

Branch

G2.134-finishProcessTests
g2.134-addExceptionsToProcessors

Groups

Group 2 - Data Importing, Group 5 | Automated Testing | Performance

Describe

This issue outlines development tasks needed to follow PR #127 after its merged. Note that separate PRs can be done to address each task:

  • Finish creating new tests in TraitImporterProcessValidationTest to trigger every case from each processing method implemented in PR G4.114 Finalize processValidationMessages() to generate user-friendly messages #127 and render the output to compare with expectations. Each test will have its own data provider.

    • testProcessValidDataFileFailures()
    • testProcessValidDelimitedFileFailures()
    • testProcessEmptyCellFailures()
    • testProcessValueInListFailures()
  • Add checks to each new processing method that:

    • Validation statuses are indeed set to 'fail' and that 'failedItems' contains content. Otherwise, throw an exception and update the tests from task 1) accordingly.
    • That the case message is one of the anticipated cases, otherwise throw an exception.

Design

The design for task 1) should follow the standard set by these test methods from PR #127:

  • testProcessGenusExistsFailures()
  • testProcessValidHeadersFailures()
  • testProcessDuplicateTraitsFailures()
@carolyncaron carolyncaron changed the title G2.[issueNo] Outstanding tasks to complete processing of messages to the user G2.134 Outstanding tasks to complete processing of messages to the user Dec 21, 2024
@carolyncaron carolyncaron self-assigned this Dec 21, 2024
@carolyncaron carolyncaron added Group 2 - Data Importing Any issue relating to importing of biological data into either Chado or any other database. Group 5 | Automated Testing | Performance Any issue related to automated testing and improving performance HIGH PRIORITY labels Dec 21, 2024
@laceysanderson
Copy link
Member

Just thought I'd post the comment that I added in the PR before this one in case it helps with some of the other tests:

Note regarding testProcessDuplicateTraitsFailures logic:
The current logic is good and fine to stay as is. That said, I wanted to respond to the following comment:

// Pull out the table rows for this table case.
$selected_table_rows = $this->cssSelect("table.table-case-$table_case tbody tr td");
// Keep track of the index in $selected_table_rows. This is necessary
// since there's no way to distinguish different rows in a table.
// ie:
// Row 1: $selected_table_rows[0], ..[1], ..[2], ..[3]
// Row 2: $selected_table_rows[4], ..[5], ..[6], ..[7]
// etc...

There is actually a way. What you would do is use the cssSelect to select the row instead of the cell. Then within the loop you already have you can do the following:

$selected_rows = $this->cssSelect("table.table-case-$table_case tbody tr");
$current_row_index = 0;
foreach ($table as $expected_line_no => $validation_status) {
  $select_row_cells = (array) $selected_rows[$current_row_index]->td;
}

which gives you a simple array of the cells for each row.

@reynoldtan
Copy link
Contributor

This is an outstanding issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Group 2 - Data Importing Any issue relating to importing of biological data into either Chado or any other database. Group 5 | Automated Testing | Performance Any issue related to automated testing and improving performance HIGH PRIORITY
Projects
None yet
3 participants