Build failed in Jenkins: cubicweb-saem_ref » py27,debian_jessie #101

jenkins.logilab.org noreply at logilab.org
Fri Feb 24 15:50:20 CET 2017


https://jenkins.logilab.org/job/cubicweb-saem_ref/TOXENV=py27,distributions=debian_jessie/101/Changes:

[Philippe Pepiot <philippe.pepiot at logilab.fr>] [hook] export EAC ARK on AuthorityRecordId

Copy (eventually) created recordId to otherRecordId and set recordId to ARK
(thus export ARK in a <recordId /> field).

Do this in hooks as well as in dataimport machinery which use MassiveStore and
doesn't trigger hooks.

Closes extranet #12572781

[Philippe Pepiot <philippe.pepiot at logilab.fr>] [py3] use six.move.map instead of itertools.imap

------------------------------------------
[...truncated 5.89 KB...]
            # unit1 is related to a transfer
            breadcrumbs = unit1.cw_adapt_to('IBreadCrumbs').breadcrumbs()
            expected_breadcrumbs = [transfer, unit1]
            self.assertEqual(breadcrumbs, expected_breadcrumbs)
            # unit2 is not related to a transfer, breadcrumbs leads to /sedalib.
>           breadcrumbs = unit2.cw_adapt_to('IBreadCrumbs').breadcrumbs()

test/test_views.py:253: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/py27/local/lib/python2.7/site-packages/cubicweb/entity.py:603: in cw_adapt_to
    interface, self._cw, entity=self)
.tox/py27/local/lib/python2.7/site-packages/logilab/common/registry.py:378: in select_or_none
    return self._select_best(self[__oid], *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = {'SEDA-2.0.rng': [<class 'cubicweb_seda.entities.profile_generation.SEDA2Relax...er'>, <class 'cubicweb_saem_ref.views.seda.SEDAComponentsBreadcrumbsAdapter'>]}
objects = [<class 'cubicweb.web.views.ibreadcrumbs.IBreadCrumbsAdapter'>, <class 'cubicweb.web.views.schema.RQLExpressionIBreadC...ws.schema.CWRelationIBreadCrumbsAdapter'>, <class 'cubicweb.web.views.cwsources.CWDataImportIBreadCrumbsAdapter'>, ...]
args = (<cubicweb.devtools.fake.FakeRequest object at 0x7fb647c85d90>,)
kwargs = {'entity': <Entity SEDAArchiveUnit 6286 [] at 140420862946704>}
score = 3
winners = [<class 'cubicweb_seda.views.sedalib.SEDAComponentsBreadcrumbsAdapter'>, <class 'cubicweb_saem_ref.views.seda.SEDAComponentsBreadcrumbsAdapter'>]
obj = <class 'cubicweb_saem_ref.views.seda.SEDAComponentsBreadcrumbsAdapter'>
objectscore = 3, msg = 'select ambiguity: %s\n(args: %s, kwargs: %s)'

    def _select_best(self, objects, *args, **kwargs):
        """return an instance of the most specific object according
            to parameters
    
            return None if not object apply (don't raise `NoSelectableObject` since
            it's costly when searching objects using `possible_objects`
            (e.g. searching for hooks).
            """
        score, winners = 0, None
        for obj in objects:
            objectscore = obj.__select__(obj, *args, **kwargs)
            if objectscore > score:
                score, winners = objectscore, [obj]
            elif objectscore > 0 and objectscore == score:
                winners.append(obj)
        if winners is None:
            return None
        if len(winners) > 1:
            # log in production environement / test, error while debugging
            msg = 'select ambiguity: %s\n(args: %s, kwargs: %s)'
            if self.debugmode:
                # raise bare exception in debug mode
>               raise SelectAmbiguity(msg % (winners, args, kwargs.keys()))
E               SelectAmbiguity: select ambiguity: [<class 'cubicweb_seda.views.sedalib.SEDAComponentsBreadcrumbsAdapter'>, <class 'cubicweb_saem_ref.views.seda.SEDAComponentsBreadcrumbsAdapter'>]
E               (args: (<cubicweb.devtools.fake.FakeRequest object at 0x7fb647c85d90>,), kwargs: ['entity'])

.tox/py27/local/lib/python2.7/site-packages/logilab/common/registry.py:414: SelectAmbiguity
______________________ SKOSImportTC.test_datafeed_source _______________________

self = <unittest_sobjects_skos.SKOSImportTC testMethod=test_datafeed_source>

    def test_datafeed_source(self):
        with self.admin_access.repo_cnx() as cnx:
            url = u'file://%s' % self.datapath('skos.rdf')
            cnx.create_entity('CWSource', name=u'mythesaurus', type=u'datafeed', parser=u'rdf.skos',
                              url=url)
            # create some agent and related objects
            agent = testutils.authority_record(cnx, u'bob')
            function = cnx.create_entity('AgentFunction', name=u'sponge', function_agent=agent)
            cnx.commit()
            # create some external uri and link it to place, function and information entities
            cnx.create_entity('ExternalUri',
                              cwuri=u'http://data.culture.fr/thesaurus/resource/ark:/67717/T1-543',
                              uri=u'http://data.culture.fr/thesaurus/resource/ark:/67717/T1-543',
                              reverse_equivalent_concept=function)
            cnx.commit()
            self.function_eid = function.eid
        dfsource = self.repo.sources_by_uri['mythesaurus']
        # test creation upon initial pull
        with self.repo.internal_cnx() as cnx:
>           dfsource.pull_data(cnx, force=True, raise_on_error=True)

test/unittest_sobjects_skos.py:50: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/sources/datafeed.py:192: in pull_data
    return self._pull_data(cnx, force, raise_on_error)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/sources/datafeed.py:220: in _pull_data
    if parser.process_urls(self.urls, raise_on_error):
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/sources/datafeed.py:316: in process_urls
    if self.process(url, raise_on_error):
.tox/py27/share/cubicweb/cubes/skos/sobjects.py:136: in process
    created, updated = self._do_import(url, raise_on_error=raise_on_error)[0]
cubicweb_saem_ref/sobjects/skos.py:62: in _do_import
    store=_store(self._cw, source=self.source))
.tox/py27/share/cubicweb/cubes/skos/sobjects.py:156: in _do_import
    source=self.source, raise_on_error=raise_on_error, **kwargs)
.tox/py27/share/cubicweb/cubes/skos/sobjects.py:265: in import_skos_extentities
    res = store_skos_extentities(cnx, store, entities, import_log, source, **kwargs)
.tox/py27/share/cubicweb/cubes/skos/post321_import.py:114: in store_skos_extentities
    importer.import_entities(entities)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/dataimport/importer.py:310: in import_entities
    deferred = self._import_entities(ext_entities, queue)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/dataimport/importer.py:323: in _import_entities
    self.prepare_insert_entity(ext_entity)
.tox/py27/share/cubicweb/cubes/skos/post321_import.py:130: in prepare_insert_entity
    eid = super(SKOSExtEntitiesImporter, self).prepare_insert_entity(extentity)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/dataimport/importer.py:372: in prepare_insert_entity
    eid = self.store.prepare_insert_entity(ext_entity.etype, **ext_entity.values)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/dataimport/stores.py:218: in prepare_insert_entity
    self._system_source.add_entity(cnx, entity)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/sources/native.py:578: in add_entity
    attrs = self.preprocess_entity(entity)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <system NativeSQLSource source 1 @0x7fb64f678b50>
entity = <Entity ConceptScheme 6290 ['modification_date', 'title', 'cwuri', 'creation_date', 'record_id', 'ark'] at 140420864912208>

    def preprocess_entity(self, entity):
        """return a dictionary to use as extra argument to cursor.execute
            to insert/update an entity into a SQL database
            """
        attrs = {}
        eschema = entity.e_schema
        converters = getattr(self.dbhelper, 'TYPE_CONVERTERS', {})
        for attr, value in entity.cw_edited.items():
>           if value is not None and eschema.subjrels[attr].final:
E           KeyError: 'record_id'

.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/sqlutils.py:435: KeyError
_____________________ SKOSImportTC.test_skos_source_no_ark _____________________

self = <unittest_sobjects_skos.SKOSImportTC testMethod=test_skos_source_no_ark>

    def test_skos_source_no_ark(self):
        with self.admin_access.repo_cnx() as cnx:
            cnx.create_entity('SKOSSource', name=u'mythesaurus', ark_naa=testutils.naa(cnx),
                              url=u'file://%s' % self.datapath('skos_no_ark.rdf'))
            cnx.commit()
        dfsource = self.repo.sources_by_uri['mythesaurus']
        # test creation upon initial pull
        with self.repo.internal_cnx() as cnx:
>           dfsource.pull_data(cnx, force=True, raise_on_error=True)

test/unittest_sobjects_skos.py:75: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/sources/datafeed.py:192: in pull_data
    return self._pull_data(cnx, force, raise_on_error)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/sources/datafeed.py:220: in _pull_data
    if parser.process_urls(self.urls, raise_on_error):
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/sources/datafeed.py:316: in process_urls
    if self.process(url, raise_on_error):
.tox/py27/share/cubicweb/cubes/skos/sobjects.py:136: in process
    created, updated = self._do_import(url, raise_on_error=raise_on_error)[0]
cubicweb_saem_ref/sobjects/skos.py:62: in _do_import
    store=_store(self._cw, source=self.source))
.tox/py27/share/cubicweb/cubes/skos/sobjects.py:156: in _do_import
    source=self.source, raise_on_error=raise_on_error, **kwargs)
.tox/py27/share/cubicweb/cubes/skos/sobjects.py:265: in import_skos_extentities
    res = store_skos_extentities(cnx, store, entities, import_log, source, **kwargs)
.tox/py27/share/cubicweb/cubes/skos/post321_import.py:114: in store_skos_extentities
    importer.import_entities(entities)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/dataimport/importer.py:310: in import_entities
    deferred = self._import_entities(ext_entities, queue)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/dataimport/importer.py:323: in _import_entities
    self.prepare_insert_entity(ext_entity)
.tox/py27/share/cubicweb/cubes/skos/post321_import.py:130: in prepare_insert_entity
    eid = super(SKOSExtEntitiesImporter, self).prepare_insert_entity(extentity)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/dataimport/importer.py:372: in prepare_insert_entity
    eid = self.store.prepare_insert_entity(ext_entity.etype, **ext_entity.values)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/dataimport/stores.py:218: in prepare_insert_entity
    self._system_source.add_entity(cnx, entity)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/sources/native.py:578: in add_entity
    attrs = self.preprocess_entity(entity)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <system NativeSQLSource source 1 @0x7fb64f678b50>
entity = <Entity ConceptScheme 6284 ['modification_date', 'title', 'cwuri', 'creation_date', 'record_id', 'ark'] at 140420888971216>

    def preprocess_entity(self, entity):
        """return a dictionary to use as extra argument to cursor.execute
            to insert/update an entity into a SQL database
            """
        attrs = {}
        eschema = entity.e_schema
        converters = getattr(self.dbhelper, 'TYPE_CONVERTERS', {})
        for attr, value in entity.cw_edited.items():
>           if value is not None and eschema.subjrels[attr].final:
E           KeyError: 'record_id'

.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/sqlutils.py:435: KeyError
_______________________ LCSVImportTC.test_cwuri_with_ark _______________________

self = <unittest_sobjects_skos.LCSVImportTC testMethod=test_cwuri_with_ark>

    def test_cwuri_with_ark(self):
        with self.admin_access.repo_cnx() as cnx:
            scheme = cnx.create_entity('ConceptScheme', ark_naa=testutils.naa(cnx))
            cnx.commit()
            cnx.call_service('lcsv.skos.import', scheme_uri=scheme.cwuri,
                             stream=open(self.datapath('lcsv_example_shortened.csv')),
>                            delimiter='\t', encoding='utf-8', language_code='es')

test/unittest_sobjects_skos.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/session.py:190: in check_open
    return func(cnx, *args, **kwargs)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/session.py:936: in call_service
    return service.call(**kwargs)
.tox/py27/share/cubicweb/cubes/skos/sobjects.py:100: in call
    (created, updated), scheme_uris = self._do_import(stream, import_log, **kwargs)
cubicweb_saem_ref/sobjects/skos.py:54: in _do_import
    store=store, **kwargs)
.tox/py27/share/cubicweb/cubes/skos/sobjects.py:126: in _do_import
    extid_as_cwuri=False, **kwargs)
.tox/py27/share/cubicweb/cubes/skos/sobjects.py:265: in import_skos_extentities
    res = store_skos_extentities(cnx, store, entities, import_log, source, **kwargs)
.tox/py27/share/cubicweb/cubes/skos/post321_import.py:114: in store_skos_extentities
    importer.import_entities(entities)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/dataimport/importer.py:310: in import_entities
    deferred = self._import_entities(ext_entities, queue)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/dataimport/importer.py:323: in _import_entities
    self.prepare_insert_entity(ext_entity)
.tox/py27/share/cubicweb/cubes/skos/post321_import.py:130: in prepare_insert_entity
    eid = super(SKOSExtEntitiesImporter, self).prepare_insert_entity(extentity)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/dataimport/importer.py:372: in prepare_insert_entity
    eid = self.store.prepare_insert_entity(ext_entity.etype, **ext_entity.values)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/dataimport/stores.py:218: in prepare_insert_entity
    self._system_source.add_entity(cnx, entity)
.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/sources/native.py:578: in add_entity
    attrs = self.preprocess_entity(entity)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <system NativeSQLSource source 1 @0x7fb64a95d910>
entity = <Entity Concept 6283 ['modification_date', 'cwuri', 'creation_date', 'definition', 'record_id', 'definition_format', 'ark'] at 140420884275344>

    def preprocess_entity(self, entity):
        """return a dictionary to use as extra argument to cursor.execute
            to insert/update an entity into a SQL database
            """
        attrs = {}
        eschema = entity.e_schema
        converters = getattr(self.dbhelper, 'TYPE_CONVERTERS', {})
        for attr, value in entity.cw_edited.items():
>           if value is not None and eschema.subjrels[attr].final:
E           KeyError: 'record_id'

.tox/py27/local/lib/python2.7/site-packages/cubicweb/server/sqlutils.py:435: KeyError
==================== 4 failed, 141 passed in 687.17 seconds ====================
waiting for server to shut down.... done
server stopped
Exception TypeError: "'NoneType' object is not callable" in <bound method PostgresTestDataBaseHandler.__del__ of <cubicweb.devtools.PostgresTestDataBaseHandler object at 0x7fb654aa8c50>> ignored
ERROR: InvocationError: '<https://jenkins.logilab.org/job/cubicweb-saem_ref/TOXENV=py27,distributions=debian_jessie/ws/.tox/py27/bin/python> -m pytest <https://jenkins.logilab.org/job/cubicweb-saem_ref/TOXENV=py27,distributions=debian_jessie/ws/test'>
___________________________________ summary ____________________________________
ERROR:   py27: commands failed
Build step 'Execute shell' marked build as failure



More information about the saem-devel mailing list