Open eboileau opened 2 months ago
We would also like to add CLI tests, something like
from scimodom.app import create_app
# w/ a redefinition of the config for testing
@pytest.fixture
def app():
app = create_app()
yield app
does not work for testing, because of setup_service.upsert_all()
which does not work with sqlite
sqlalchemy.exc.UnsupportedCompilationError: Compiler <sqlalchemy.dialects.sqlite.base.SQLiteCompiler object at 0x7fa1256e2fd0> can't render element of type <class 'sqlalchemy.dialects.mysql.dml.OnDuplicateClause'> (Background on this error at: https://sqlalche.me/e/20/l7de)
We could try registering-commands-with-blueprints, this might work then with
@pytest.fixture()
def runner(app):
return app.test_cli_runner()
but this needs to be tested (we want to have the application context pushed). Otherwise, we might just as well try custom scripts.
A clear and concise description of todo items.
[ ]
flask metadata
cannot handle CSV entries incl. header with blank spaces, etc.[ ]
flask delete
(FileService
) should except/passFileNotFoundError
when removing a gene cache file if it does not exists.[ ] The "selection" handling in the CLI is relegated to
cli.dataset
, but in services this is under project, anddelete_selection
cannot be properly tested now, being in the CLI only. Maybe we should have it under project or dataset service, or eventually selection service or move this to utilities (where it would be accessible for project, dataset, CLI and tests).[ ] The order in which tables are deleted should matter, but if I change
ProjectService.delete_project
e.g. to delete project first,test_delete_project
still completes successfuly, whereas it shoud not... Using on cascade would probably be more robust, but do we need to set it up in the model?[ ] Handle graceful exit on failure e.g. if annotating dataset with nonexistent
taxa_id
andversion
, see also below:flask project
with e.g. nonexistent combination oftaxa_id
andcto
FileNotFoundError: [Errno 2] No such file or directory: '/data/metadata/project_requests/bla.json'
[ ] Is logging-level CLI-specific configurable? Check click-logging.
[ ] When done, update CLI docs.