author David Douard <>
Fri, 14 Nov 2014 12:51:47 +0100
changeset 1740 f3137466457a
parent 1419 04b8e8af2e66
child 1594 c4f84b3b101e
permissions -rw-r--r--
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

# copyright 2010-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact --
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 2.1 of the License, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
# You should have received a copy of the GNU Lesser General Public License along
# with this program. If not, see <>.

__docformat__ = "restructuredtext en"
_ = unicode

from cubicweb.web.views import json
from cubicweb.predicates import is_instance, match_form_params

class GetDependencies(json.JsonEntityView):
    __regid__ = 'apycot.get_dependencies'
    __select__ = is_instance('TestExecution')

    def call(self):
        data = []
        for entity in self.cw_rset.entities():
            tconfig = entity.configuration
            env = entity.environment
            data.append(tconfig.dependencies(env) + [env])

class GetConfiguration(json.JsonEntityView):
    __regid__ = 'apycot.get_configuration'
    __select__ = is_instance('TestConfig') & match_form_params('environment')

    def call(self):
        data = []
        env = self._cw.entity_from_eid(self._cw.form['environment'])
        for tconfig in self.cw_rset.entities():