ckan / ckanext-dcat

CKAN ♥ DCAT
163 stars 142 forks source link

Tests failing KeyError: 'source_type' (ckan master) #125

Closed davidread closed 5 years ago

davidread commented 5 years ago
======================================================================
ERROR: ckanext.dcat.tests.test_harvester.TestDCATHarvestFunctionalExtensionPoints.test_harvest_after_download_empty_content_stops_gather_stage
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.7.13/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/build/ckan/ckanext-dcat/ckanext/dcat/tests/test_harvester.py", line 1135, in test_harvest_after_download_empty_content_stops_gather_stage
    harvest_source = self._create_harvest_source(source_url)
  File "/home/travis/build/ckan/ckanext-dcat/ckanext/dcat/tests/test_harvester.py", line 514, in _create_harvest_source
    {}, **source_dict)
  File "/home/travis/build/ckan/ckanext-dcat/ckan/ckan/tests/helpers.py", line 109, in call_action
    return logic.get_action(action_name)(context=context, data_dict=kwargs)
  File "/home/travis/build/ckan/ckanext-dcat/ckan/ckan/logic/__init__.py", line 464, in wrapped
    result = _action(context, data_dict, **kw)
  File "/home/travis/build/ckan/ckanext-dcat/ckanext-harvest/ckanext/harvest/logic/action/create.py", line 70, in harvest_source_create
    source = toolkit.get_action('package_create')(context, data_dict)
  File "/home/travis/build/ckan/ckanext-dcat/ckan/ckan/logic/__init__.py", line 464, in wrapped
    result = _action(context, data_dict, **kw)
  File "/home/travis/build/ckan/ckanext-dcat/ckan/ckan/logic/action/create.py", line 211, in package_create
    item.after_create(context, data)
  File "/home/travis/build/ckan/ckanext-dcat/ckanext-harvest/ckanext/harvest/plugin.py", line 54, in after_create
    _create_harvest_source_object(context, data_dict)
  File "/home/travis/build/ckan/ckanext-dcat/ckanext-harvest/ckanext/harvest/plugin.py", line 363, in _create_harvest_source_object
    source.type = data_dict['source_type']
KeyError: 'source_type'
davidread commented 5 years ago

Can anyone currently using ckanext-dcat find a bit of resource to look at this? Maybe @rossjones @camfindlay ?

camfindlay commented 5 years ago

Looking at the Travis build report it's only failing against CKAN master (2.8.x). is this perhaps some internal change in CKAN core causing the break? @davidread

davidread commented 5 years ago

Yes probably @camfindlay.

amercader commented 5 years ago

Yes, tests are broken against master (2.9.x). I pushed some fixes at the extension level on 20957bb, but the source_type ones are a core issue related to the migration to Flask: https://github.com/ckan/ckan/pull/4385, so we'll need to wait on that patch.

amercader commented 5 years ago

All green now