From f072d4f99a04c11c6aa3b69dba044024175f735c Mon Sep 17 00:00:00 2001
From: Samuel Gaist <samuel.gaist@idiap.ch>
Date: Mon, 16 Mar 2020 09:13:14 +0100
Subject: [PATCH] [algorithms] Remove dependency check and add push failure
 test

The check is done prior to the dependency list enumeration.
---
 beat/cmdline/algorithms.py           | 5 +----
 beat/cmdline/test/test_algorithms.py | 1 +
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/beat/cmdline/algorithms.py b/beat/cmdline/algorithms.py
index 3961287..d658b98 100644
--- a/beat/cmdline/algorithms.py
+++ b/beat/cmdline/algorithms.py
@@ -45,7 +45,6 @@ from beat.core.execution import DockerExecutor
 from beat.core.dock import Host
 from beat.core import hash
 from beat.backend.python.algorithm import Storage as AlgorithmStorage
-from beat.backend.python.algorithm import Algorithm
 
 from . import common
 from . import commands
@@ -330,9 +329,7 @@ def execute_impl(prefix, cache, instructions_file):
 
 def get_dependencies(ctx, asset_name):
     prefix = ctx.meta["config"].path
-    alg = Algorithm(prefix, asset_name)
-    if not alg.valid:
-        raise RuntimeError("Invalid algortihm: {}".format(alg.errors))
+    alg = algorithm.Algorithm(prefix, asset_name)
 
     dependencies = {}
 
diff --git a/beat/cmdline/test/test_algorithms.py b/beat/cmdline/test/test_algorithms.py
index 1357315..a7a6a55 100644
--- a/beat/cmdline/test/test_algorithms.py
+++ b/beat/cmdline/test/test_algorithms.py
@@ -59,6 +59,7 @@ class TestOnline(core.OnlineAssetTestCase):
         "fork": "user/forked_obj/1",
         "push": "user/db_input_loop_processor/1",
         "not_owner_push": "v1/integers_add/1",
+        "push_invalid": "errors/description_too_long/1",
     }
 
     def _modify_asset(self, asset_name):
-- 
GitLab