Skip to content

Commit

Permalink
test: update jgf reader/writer tests
Browse files Browse the repository at this point in the history
Problem: the python JGF writer no longer outputs certain vertex
metadata, but the tests expect it to be there.

Change the tests to no longer look for the eliminated metadata.
  • Loading branch information
jameshcorbett committed Sep 24, 2024
1 parent 3ba368d commit 751621f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 25 deletions.
10 changes: 2 additions & 8 deletions t/python/t10001-resourcegraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ class TestResourceGraph(unittest.TestCase):
"""Test for the ResourceGraph class."""

def _check_metadata(self, metadata):
if metadata["type"] in ("node", "core", "gpu", "cluster"):
self.assertEqual(metadata["unit"], "")
self.assertEqual(metadata["size"], 1)
self.assertEqual(metadata["properties"], {})
else:
if metadata["type"] not in ("node", "core", "gpu", "cluster"):
raise ValueError(metadata["type"])

def test_basic(self):
Expand Down Expand Up @@ -94,10 +90,8 @@ def test_basic_3(self):
if metadata["type"] != "node":
self._check_metadata(node.get_metadata())
else:
self.assertEqual(metadata["unit"], "")
self.assertEqual(metadata["size"], 1)
self.assertEqual(len(metadata["properties"]), 1)
if metadata["id"] < 10:
if int(metadata["name"][len("compute") :]) < 10:
self.assertEqual(metadata["properties"]["pdebug"], "")
else:
self.assertEqual(metadata["properties"]["pbatch"], "")
Expand Down
34 changes: 17 additions & 17 deletions t/t8001-util-ion-R.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ print_schema2 (){

test_expect_success 'fluxion-R: encoding nodelists on heterogeneity works' '
cat <<-EOF >expected1 &&
/cluster0 -1
/cluster0 null
/cluster0/foo2 0
/cluster0/foo2/core0 0
/cluster0/foo2/core1 0
Expand All @@ -39,7 +39,7 @@ test_expect_success 'fluxion-R: encoding nodelists on heterogeneity works' '

test_expect_success 'fluxion-R: encoding nodelists with high ranks' '
cat <<-EOF >expected2 &&
/cluster0 -1
/cluster0 null
/cluster0/fluke82 79
/cluster0/fluke82/core0 79
/cluster0/fluke82/core1 79
Expand Down Expand Up @@ -90,7 +90,7 @@ test_expect_success 'fluxion-R: encoding nodelists with high ranks' '

test_expect_success 'fluxion-R: encoding nodelists with reverse mapping' '
cat <<-EOF >expected3 &&
/cluster0 -1
/cluster0 null
/cluster0/fluke102 79
/cluster0/fluke102/core0 79
/cluster0/fluke102/core1 79
Expand Down Expand Up @@ -157,24 +157,24 @@ test_expect_success 'fluxion-R: can detect insufficient nodelist' '

test_expect_success 'fluxion-R: encoding properties on heterogeneity works' '
cat <<-EOF >expected6 &&
/cluster0 -1 {}
/cluster0 null null
/cluster0/foo2 0 {"arm-v9@core":""}
/cluster0/foo2/core0 0 {}
/cluster0/foo2/core1 0 {}
/cluster0/foo2/gpu0 0 {}
/cluster0/foo2/gpu1 0 {}
/cluster0/foo2/core0 0 null
/cluster0/foo2/core1 0 null
/cluster0/foo2/gpu0 0 null
/cluster0/foo2/gpu1 0 null
/cluster0/foo3 2 {"arm-v9@core":"","amd-mi60@gpu":""}
/cluster0/foo3/core0 2 {}
/cluster0/foo3/core1 2 {}
/cluster0/foo3/gpu0 2 {}
/cluster0/foo3/gpu1 2 {}
/cluster0/foo3/core0 2 null
/cluster0/foo3/core1 2 null
/cluster0/foo3/gpu0 2 null
/cluster0/foo3/gpu1 2 null
/cluster0/foo1 3 {"arm-v9@core":"","amd-mi60@gpu":""}
/cluster0/foo1/core0 3 {}
/cluster0/foo1/core1 3 {}
/cluster0/foo1/gpu0 3 {}
/cluster0/foo1/gpu1 3 {}
/cluster0/foo1/core0 3 null
/cluster0/foo1/core1 3 null
/cluster0/foo1/gpu0 3 null
/cluster0/foo1/gpu1 3 null
/cluster0/foo4 1 {"arm-v8@core":""}
/cluster0/foo4/core0 1 {}
/cluster0/foo4/core0 1 null
EOF
flux R encode -r 0 -c 0-1 -g 0-1 -p "arm-v9@core:0" -H foo2 > out6 &&
flux R encode -r 1 -c 0 -H foo3 -p "arm-v8@core:1" >> out6 &&
Expand Down

0 comments on commit 751621f

Please sign in to comment.