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

G5.13 Improvements to Germplasm Accession Synonyms Test #13

Open
laceysanderson opened this issue Feb 9, 2024 · 0 comments
Open

G5.13 Improvements to Germplasm Accession Synonyms Test #13

laceysanderson opened this issue Feb 9, 2024 · 0 comments
Labels
bug - potential For issues describing a potential bug that has not yet been shown repeatable by a core developer. Group 5 | Automated Testing | Performance Any issue related to automated testing and improving performance

Comments

@laceysanderson
Copy link
Member

laceysanderson commented Feb 9, 2024

Branch

g5.13-germplasmAccessionSynonymTests

Groups

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

Describe

These suggestions came up in the review of #6. This issue makes sure we don't forget about them and allows us to merge that PR :-)

GermplasmAccessionImporterTest::testGermplasmAccessionImporterLoadSynonyms()

    // Check both synonyms are in chado.synonym
    $synonyms_semicolon_query = $this->connection->select('1:synonym', 's')
      ->fields('s', ['name']);
    $group = $synonyms_semicolon_query->orConditionGroup()
      ->condition('s.name', $syn3, '=')
      ->condition('s.name', $syn4, '=');
    $synonyms_semicolon_query->condition($group);
    $synonyms_semicolon_record = $synonyms_semicolon_query->execute()->fetchAll();
    $this->assertEquals($synonyms_semicolon_record[0]->name, $syn3, "The synonym table does not contain the expected synonym syn3");
    $this->assertEquals($synonyms_semicolon_record[1]->name, $syn4, "The synonym table does not contain the expected synonym syn4");

    // @todo: Test the case when a stock_relationship previously exists

    // Do my final queries to ensure everything we expect to be in the tables is there
    // stock table
    // $stock_table_query = $this->connection->select('1:stock', 'st')
    //   ->fields('st', ['stock_id', 'name', 'uniquename', 'organism_id']);
    // $stock_table_records = $stock_table_query->execute();
    // $stock_table_array_actual = $stock_table_records->fetchAllAssoc('stock_id');
    // print_r($stock_table_records->fetchAllAssoc('stock_id'));

Lacey: Might also be good to check that both synonyms are connected to the correct stock via the stock_synonym table here just as you have done with the other test cases above.

Carolyn: I didn't get to this in time sadly, but in commit 371d157 I added the check for a pre-existing stock_relationship and intended to also add a test to make sure duplicate stock_relationships indeed do not get added by the importer. All this to say that I plan to tackle your suggestion at the same time since both tests are synonym-focussed 😄

@laceysanderson laceysanderson changed the title G[groupNo].[issueNo] Improvements to Germplasm Accession Synonyms Test G5.13 Improvements to Germplasm Accession Synonyms Test Feb 9, 2024
@laceysanderson laceysanderson added Group 5 | Automated Testing | Performance Any issue related to automated testing and improving performance bug - potential For issues describing a potential bug that has not yet been shown repeatable by a core developer. labels Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug - potential For issues describing a potential bug that has not yet been shown repeatable by a core developer. Group 5 | Automated Testing | Performance Any issue related to automated testing and improving performance
Projects
None yet
Development

No branches or pull requests

1 participant