Closed agstephens closed 4 years ago
@agstephens I'm not having much luck working out how to use this data in the tests when running the CI. Do you know anything about how this works?
Also travis needs to be authorised to work, I've sent a request over.
@ellesmith88 , I have just granted access to the request.
Thank @agstephens, I've worked out a way to get the test data in as well.
@agstephens I'm not having much luck working out how to use this data in the tests when running the CI. Do you know anything about how this works?
@ellesmith88: Here is my take on how things could work:
mini-esgf-data
repository could be included as a git "sub-module" in the other repositories. See: https://gist.github.com/gitaarik/8735255 for info about this approach.mini-esgf-data
). You may need to force this with extra arguments and/or commands. See: https://www.atlassian.com/git/tutorials/git-submodule - section called "Cloning git submodules"And/or you could hook up the pulling of the submodule as setup stage for all the relevant unit tests.
Does that make sense? Please come back to me if I've missed the point of your question.
@ellesmith88: also, it might make sense to define the test data sets as different "projects" in the configuration of the repositories. E.g.:
At present, in the lib.options
module we define:
project_base_dirs = {
'cmip5': '/badc/cmip5/data',
'cmip6': '/badc/cmip6/data',
'cordex': '/badc/cordex/data'
}
known_projects = project_base_dirs.keys()
facet_rules = {
'cmip5': 'activity product institute model experiment frequency realm mip_table ensemble_member version variable'.split(),
'cmip6': 'mip_era activity_id institution_id source_id experiment_id member_id table_id variable_id grid_label version'.split(),
'cordex': 'NOT DEFINED YET'
}
As part of the setup for the unit tests you could do something like:
from lib import options
...
CMIP5_TEST = 'mini_esgf_cmip5'
options.project_base_dirs[CMIP5_TEST] = './test_data/badc/cmip5/data'
options.known_projects.append(CMIP5_TEST)
options.facet_rules[CMIP5_TEST] = options.facet_rules['cmip5'][:]
...
Thank @agstephens, I've worked out a way to get the test data in as well.
Great stuff @ellesmith88
All done.
Integrate the two prototype repositories with:
Use mini example data repository set up separately.