Big Refactoring (BR) of the test execution model
Get rid of narval preprocessors in favor of Recipes
- Each preprocessing recipe must be run from the "main" recipe (thus we add
a ATest.exec_recipe() method that can be called from Recipe execution).
- We add a (Repository, checkout_recipe, Recipe) relation, which is the
Recipe that tells how to retrieve the code for a given Repository
- Also add a (ProjectEnvironment, setup_recipe, Recip) dedicated to perform
the installation for a project (compile and install)
- Add implementations for these recipes for Python project
- Rewrite the quick recipe using this new model
from apycotlib import atest, writer, ERROR
class apycot_environment(object):
def __init__(self, plan):
self.plan = plan
def __enter__(self):
w = writer.TestDataWriter(self.plan.cnxh, self.plan.plandata['eid'])
test = atest.Test(self.plan.plandata, w)
test.setup()
self.test = test
return test
def __exit__(self, exc_type, exc_val, exc_tb):
if exc_type is not None:
self.test.global_status = ERROR
self.test.clean()
def install_environment(test):
data = test.writer.cnxh.rql('Any E WHERE E eid %s' % test.texec['eid'],
vid='apycot.get_dependencies').json()
for dep in data[0]:
test.checkout(dep)
test.call_preprocessor('install', dep)