Skip to content

Commit 57b2c1d

Browse files
committed
add copy and teardown for metadata.json for algoeval test
- because clean_all was used, the original metadata.json was nuked. Signed-off-by: Jack Luar <[email protected]>
1 parent 38f93c6 commit 57b2c1d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tools/AutoTuner/test/smoke_test_algo_eval.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import unittest
3636
import subprocess
3737
import os
38+
import shutil
3839
from .autotuner_test_utils import AutoTunerTestUtils
3940

4041
cur_dir = os.path.dirname(os.path.abspath(__file__))
@@ -66,6 +67,9 @@ def setUp(self):
6667
f" --reference {self.reference}"
6768
for a, e in self.matrix
6869
]
70+
# Make a file copy of the original metadata.json
71+
self.metadata = os.path.join(cur_dir, f"{design_path}/metadata.json")
72+
shutil.copyfile(self.metadata, self.metadata + ".orig")
6973

7074
def make_base(self):
7175
commands = [
@@ -88,6 +92,10 @@ def test_algo_eval(self):
8892
successful = out.returncode == 0
8993
self.assertTrue(successful)
9094

95+
# On successful run, restore the metadata.json file
96+
shutil.copyfile(self.metadata + ".orig", self.metadata)
97+
os.remove(self.metadata + ".orig")
98+
9199

92100
class asap7AlgoEvalSmokeTest(BaseAlgoEvalSmokeTest):
93101
platform = "asap7"

0 commit comments

Comments
 (0)