tripal / t4d8

This is a temporary repository for Drupal 9 upgrade for Tripal v4. It is meant to house issues related to the upgrade.
GNU General Public License v2.0
1 stars 10 forks source link

Ensure Chado Prepare works in automated testing #297

Closed laceysanderson closed 1 year ago

laceysanderson commented 1 year ago

This PR adds

Testing

Manual

Automated testing

Documentation

There has been a documentation issue opened https://github.com/tripal/tripal_doc/issues/13

Also, to get a chado instance prepared for testing use the following command in any test which extends ChadoBrowserTestBase:

$prepared_chado = $this->getTestSchema(ChadoTestBrowserBase::PREPARE_TEST_CHADO);

Warning

Previous versions of this PR had a prepareTestChado() method WHICH HAS BEEN REMOVED. Please use the new approach instead.

laceysanderson commented 1 year ago

I believe the tests should now pass and that this PR successfully adds an efficient way to get a prepared chado for testing and fixes all the bugs which stopped the official prepare task from running in the testing environment.

To create a prepared chado test instance you do the following:

$prepared_chado = $this->getTestSchema(ChadoTestBrowserBase::PREPARE_TEST_CHADO);

Note: this is different then we originally discussed as it became clear we did not want to add records to an existing chado test db due to too many unexpected issues. This approach is more reliable and just as fast. The only downside is that ChadoTestBrowserBase creates an empty chado that we do not use when this approach is taken which is a bit more overhead then needed.

We also need to add documentation for automated testing in the Tripal/Chado environment. I've added an issue with some details here: https://github.com/tripal/tripal_doc/issues/13

codeclimate[bot] commented 1 year ago

Code Climate has analyzed commit 0e6211aa and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

The test coverage on the diff in this pull request is 73.3% (50% is the threshold).

This pull request will bring the total coverage in the repository to 33.2% (12.8% change).

View more on Code Climate.

laceysanderson commented 1 year ago

Confirmed that since this is well tested, has been up for more then 3 days it can be merged 🎉 This will be used a lot in future testing so if there are any bugs -they will be found :-)