Skip to content

Commit

Permalink
Removes redundant test handle, adds algorithm options for translation…
Browse files Browse the repository at this point in the history
… algorithm tests all in test_lgweb.py.
  • Loading branch information
pritchardn committed Sep 28, 2022
1 parent a889df2 commit fbb50fb
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions daliuge-translator/test/dropmake/test_lgweb.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def test_get_pgtjson(self):
# good!
c._get_json("/pgt_jsonbody?pgt_name=logical_graphs/chiles_simple1_pgt.graph")

def test_get_pgt_post(self, algo="metis"):
def test_get_pgt_post(self, algo="metis", algo_options=None):

c = RestClient("localhost", lgweb_port, timeout=10)

Expand All @@ -171,6 +171,8 @@ def test_get_pgt_post(self, algo="metis"):
"max_load_imb": 100,
"max_cpu": 8,
}
if algo_options is not None:
form_data.update(algo_options)

# POST form to /gen_pgt
try:
Expand Down Expand Up @@ -246,24 +248,21 @@ def test_loop_pgt_post(self):
except RestClientException as e:
self.fail(e)

def _test_translate_alg(self, algorithm):
self.test_get_pgt_post(algo=algorithm)

@unittest.skip("None translation is not an option in EAGLE and does not work.")
def test_none_translation(self):
self._test_translate_alg(algorithm='none')
self.test_get_pgt_post(algo='none')

def test_metis_translation(self):
self._test_translate_alg(algorithm='metis')
self.test_get_pgt_post(algo='metis')

def test_sarkar_translation(self):
self._test_translate_alg(algorithm='mysarkar')
self.test_get_pgt_post(algo='mysarkar')

def test_min_num_parts_translation(self):
self._test_translate_alg(algorithm='min_num_parts')
self.test_get_pgt_post(algo='min_num_parts', algo_options={'deadline': 300, 'time_greedy': 50})

def test_pso_translation(self):
self._test_translate_alg(algorithm='pso')
self.test_get_pgt_post(algo='pso', algo_options={'swarm_size': 10, 'deadline': 300})


def test_pg_viewer(self):
Expand Down

0 comments on commit fbb50fb

Please sign in to comment.