QCDIS / NaaVRE

BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

Catalog.get_cell_from_og_node_id(\\nTypeError: \'NoneType\' object is not subscriptable\\n"}' #1422

Closed skoulouzis closed 2 months ago

skoulouzis commented 2 months ago
self = <jupyterlab_vre.tests.test_handlers.HandlersAPITest testMethod=test_execute_workflow_handler>
    def test_execute_workflow_handler(self):
        workflow_path = os.path.join(base_path, 'workflows', 'NaaVRE')
        workflow_files = os.listdir(workflow_path)
        with mock.patch.object(ExecuteWorkflowHandler, 'get_secure_cookie') as m:
            m.return_value = 'cookie'
        cells_json_path = os.path.join(base_path, 'cells')
        cells_files = os.listdir(cells_json_path)
        for cell_file in cells_files:
            cell_path = os.path.join(cells_json_path, cell_file)
            create_cell_and_add_to_cat(cell_path=cell_path)
            response = self.call_cell_handler()
            wf_creation_utc = datetime.datetime.now(tz=datetime.timezone.utc)
            self.assertEqual(200, response.code)
            git_wf_id = json.loads(response.body.decode('utf-8'))['wf_id']
            cat_repositories = Catalog.get_repositories()
            repo = cat_repositories[0]
            repo_token = repo['token']
            owner, repository_name = repo['url'].removeprefix('https://github.com/').split('/')
            job = wait_for_job(
                wf_id=git_wf_id,
                wf_creation_utc=wf_creation_utc,
                owner=owner,
                repository_name=repository_name,
                token=repo_token,
                job_id=None,
                timeout=300,
                wait_for_completion=True,
            )
            self.assertIsNotNone(job, 'Job not found')
            self.assertEqual('completed', job['status'], 'Job not completed')
        for workflow_file in workflow_files:
            print('workflow_file: ', workflow_file)
            workflow_file_path = os.path.join(workflow_path, workflow_file)
            with open(workflow_file_path, 'r') as read_file:
                payload = json.load(read_file)

            response = self.fetch('/executeworkflowhandler', method='POST', body=json.dumps(payload))
>           self.assertEqual(response.code, 200, response.body)
E           AssertionError: 500 != 200 : b'{"message": "Unhandled error", "reason": null, "traceback": "Traceback (most recent call last):\\n  File \\"/home/runner/miniconda3/envs/jupyterlab/lib/python3.11/site-packages/tornado/web.py\\", line 1790, in _execute\\n    result = await result\\n             ^^^^^^^^^^^^\\n  File \\"/home/runner/_work/NaaVRE/NaaVRE/jupyterlab_vre/experiment_manager/handlers.py\\", line 131, in post\\n    parser = WorkflowParser(nodes, links)\\n             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n  File \\"/home/runner/_work/NaaVRE/NaaVRE/jupyterlab_vre/services/parser/parser.py\\", line 67, in __init__\\n    self.__parse_links()\\n  File \\"/home/runner/_work/NaaVRE/NaaVRE/jupyterlab_vre/services/parser/parser.py\\", line 87, in __parse_links\\n    Catalog.get_cell_from_og_node_id(\\nTypeError: \'NoneType\' object is not subscriptable\\n"}'
jupyterlab_vre/tests/test_handlers.py:286: AssertionError