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

Helper function to allow easy command line loading #56

Closed
bradfordcondon opened this issue Jul 18, 2018 · 4 comments
Closed

Helper function to allow easy command line loading #56

bradfordcondon opened this issue Jul 18, 2018 · 4 comments
Assignees

Comments

@bradfordcondon
Copy link
Member

bradfordcondon commented Jul 18, 2018

This is an ideas discussion thread for how to allow more automated data loading with the dev seed project in mind (and perhaps this discussion/utility will end up there instead).

Constraints

  • Loaders are never bootstrapped, they must be manually loaded

  • I think the easy way to run the loader is to provide a simulated $form and $form_state as required by the Importer. This is because some private methods move the file to temp etc, and the functions used to actually run the loader might be private.

  • I'd love to use a drush command, but passing a fake form isn't really possible with Drush -> you'd have to write a seperate drush command for each loader to allow the options to be passed in.

  • Could a db:seeder be better? Lets you run it via the command line, assuming you can pass a file path and whatever options needed.

@bradfordcondon
Copy link
Member Author

bradfordcondon commented Jul 18, 2018

Here is what I find to be a pretty good start for running a loader via phpunit:

https://github.com/statonlab/tripal_ssr/blob/910d99782faf71fe0350fb8ec6d307704f9186b0/tests/SSRLoaderTest.php#L208-L228

Note that i dont actually simulate form and form_state: instead I execute create with the $run_args (from the form) and the $file which is where the file goes from the GUI.


    $importer = new \SSRLoader();
    $importer->create($run_args, $file);
    $importer->run();

@bradfordcondon
Copy link
Member Author

bradfordcondon commented Jul 26, 2018

added in #57

Waiting on re-annotation of F excelsior. When thats done I need to do two things:

  • redoing the static URLs for the files
  • Actual testing of the importer to ensure it works

@bradfordcondon
Copy link
Member Author

waiting on interproscan to verify ips loader works. see #57

@bradfordcondon
Copy link
Member Author

merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant