-
Notifications
You must be signed in to change notification settings - Fork 0
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
G4.76 Step 2 --Remove validator TraitImportValues and utilize the 3 newly added validators by the Traits Importer #79
Conversation
…ed affected tests
…file row scope validators. 1 TEST FAILING
…est for now, added 2 scenarios to test each of empty cell and incorrect data type value
…g the test for validating a file with duplicate traits
…status and format the details message
…tImportValuePluginValidator
My thoughts on next steps for this PR based on current status and discussion in #82.
On second thought, do not worry about return value changes in this PR. They will instead be handled in issue #86 |
…n to be case sensitive in example files
This reverts commit fcc5111.
…genus in DuplicateTraits
…, and updated the DuplicateTraits validator
… on getting FormValidateTest to pass
…tests still breaking
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.
✅ Code looks exactly as I expected :-)
✅ Core functionality was verified by @reynoldtan
☑️ Potential bug that Reynold found has been documented in Issue #97 and is not core to this PR so can be ignored here.
✅ Automated tests look good and pass
Ready to merge!
Issue #76
Motivation
After spending time thinking about/discussing how to organize plugin instances for validating the phenotype share importer, we realized that the plugin instance to validate columns in the trait importer could be split up into 3 separate instances. These instances were implemented in PR #77 as
EmptyCell
,ValueInList
, andDuplicateTraits
.The Traits Importer is currently still calling the initial
TraitImportValues
validator and needs to use the new validators instead. This is expected to break some tests, so those will need to be fixed as well in this PR.Current Status
Exception: No genus has been set. See setting a genus in the Traits Service and make sure to use a configured genus. To configure a genus or see all configured genus, go to /admin/tripal/extension/tripal-cultivate/phenotypes/ontology.
$instance->context = $context
to set it and in thevalidator::validateRow()
method, remove the 2nd parameter and add a$context = $this->context;
line at the top of the method for now.What does this PR do?
TripalCultivatePhenotypesTraitsImporter.php
. It now iterates through the input file and calls each existing validator at the correct point (ie. metadata first, header-row for the first line of file, and data-row validators for each additional row of the the file)TraitImportValues
validator plugin instance and its test functiontestTraitImportValuePluginValidator()
fromPluginValidatorTest.php
Testing
Automated Testing
Additional scenarios were added to the data provider
provideFilesForValidation()
in classTraitImporterFormValidateTest
:correct_header_emptycell_method.tsv
: A file with a correct header, 1st row of correct data, 2nd row has an empty cell for the required'Method Short Name'
columncorrect_header_invalid_datatype.tsv
: A file with a correct header, 1st row of data contains an invalid value for the column'Type'
and the 2nd row contains valid dataManual Testing
Tripal
>Content
>Add Tripal Content
and selectOrganism
from the listTripal
>Extensions
>Tripal Cultivate Phenotypes Configuration
Tripal
>Data Loaders
>Tripal Cultivate: Phenotypic Trait Importer
trpcultivate_phenotypes/tests/src/Fixtures/TraitImporterFiles
; these are the files used in automated testing of the fromValidate() method.NOTE:
simple_example.txt
is the only file that will pass validation and thus, get uploaded into the system. If you try this one, or modify any file to completely pass validation, keep in mind that existing traits in the database can impact validation later on (in this case, the duplicate traits validator)