Skip to content

Commit

Permalink
Remove unnecessary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yinggeh committed May 14, 2024
1 parent f3371ae commit 0a3dfcd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 206 deletions.
206 changes: 2 additions & 204 deletions qa/L0_lifecycle/lifecycle_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3406,8 +3406,7 @@ def test_shutdown_with_live_connection(self):
)

def test_add_custom_config(self):
models_base = ("savedmodel", "plan")
models_shape = ((1, 16), (1, 16))
models_base = ("savedmodel",)
models = list()
for m in models_base:
models.append(tu.get_model_name(m, np.float32, np.float32, np.float32))
Expand All @@ -3427,55 +3426,6 @@ def test_add_custom_config(self):
except Exception as ex:
self.assertTrue(False, "unexpected error {}".format(ex))

# Run inference on the model on all versions. Only version 1, 3 should work.
for model_name, model_shape in zip(models_base, models_shape):
try:
iu.infer_exact(
self,
model_name,
model_shape,
1,
np.float32,
np.float32,
np.float32,
swap=False,
model_version=1,
)
except Exception as ex:
self.assertTrue(False, "unexpected error {}".format(ex))

try:
iu.infer_exact(
self,
model_name,
model_shape,
1,
np.float32,
np.float32,
np.float32,
swap=True,
model_version=3,
)
except Exception as ex:
self.assertTrue(False, "unexpected error {}".format(ex))

try:
iu.infer_exact(
self,
model_name,
model_shape,
1,
np.float32,
np.float32,
np.float32,
model_version=2,
)
self.assertTrue(
False, "expected error for unavailable model " + model_name
)
except Exception as ex:
self.assertIn("Request for unknown model", ex.message())

# Add custom model configuration, which cause model to be
# re-loaded and use custom config inside configs folder, which
# means that version policy will change and only version 2 will
Expand All @@ -3501,60 +3451,8 @@ def test_add_custom_config(self):
except Exception as ex:
self.assertTrue(False, "unexpected error {}".format(ex))

# Only version 2 should work.
for model_name, model_shape in zip(models_base, models_shape):
try:
iu.infer_exact(
self,
model_name,
model_shape,
1,
np.float32,
np.float32,
np.float32,
swap=True,
model_version=2,
)
except Exception as ex:
self.assertTrue(False, "unexpected error {}".format(ex))

try:
iu.infer_exact(
self,
model_name,
model_shape,
1,
np.float32,
np.float32,
np.float32,
model_version=1,
)
self.assertTrue(
False, "expected error for unavailable model " + model_name
)
except Exception as ex:
self.assertIn("Request for unknown model", ex.message())

try:
iu.infer_exact(
self,
model_name,
model_shape,
1,
np.float32,
np.float32,
np.float32,
model_version=3,
)
self.assertTrue(
False, "expected error for unavailable model " + model_name
)
except Exception as ex:
self.assertIn("Request for unknown model", ex.message())

def test_delete_custom_config(self):
models_base = ("savedmodel", "plan")
models_shape = ((1, 16), (1, 16))
models_base = ("savedmodel",)
models = list()
for m in models_base:
models.append(tu.get_model_name(m, np.float32, np.float32, np.float32))
Expand All @@ -3574,57 +3472,6 @@ def test_delete_custom_config(self):
except Exception as ex:
self.assertTrue(False, "unexpected error {}".format(ex))

# Run inference on the model on all versions. Only version 2 should work.
for model_name, model_shape in zip(models_base, models_shape):
try:
iu.infer_exact(
self,
model_name,
model_shape,
1,
np.float32,
np.float32,
np.float32,
swap=True,
model_version=2,
)
except Exception as ex:
self.assertTrue(False, "unexpected error {}".format(ex))

try:
iu.infer_exact(
self,
model_name,
model_shape,
1,
np.float32,
np.float32,
np.float32,
model_version=1,
)
self.assertTrue(
False, "expected error for unavailable model " + model_name
)
except Exception as ex:
self.assertIn("Request for unknown model", ex.message())

try:
iu.infer_exact(
self,
model_name,
model_shape,
1,
np.float32,
np.float32,
np.float32,
model_version=3,
)
self.assertTrue(
False, "expected error for unavailable model " + model_name
)
except Exception as ex:
self.assertIn("Request for unknown model", ex.message())

# Delete custom model configuration, which cause model to be
# re-loaded and use default config, which means that version
# policy will be changed and so only version 1, 3 will be available
Expand All @@ -3646,55 +3493,6 @@ def test_delete_custom_config(self):
except Exception as ex:
self.assertTrue(False, "unexpected error {}".format(ex))

# Only version 1, 3 should work.
for model_name, model_shape in zip(models_base, models_shape):
try:
iu.infer_exact(
self,
model_name,
model_shape,
1,
np.float32,
np.float32,
np.float32,
swap=False,
model_version=1,
)
except Exception as ex:
self.assertTrue(False, "unexpected error {}".format(ex))

try:
iu.infer_exact(
self,
model_name,
model_shape,
1,
np.float32,
np.float32,
np.float32,
swap=True,
model_version=3,
)
except Exception as ex:
self.assertTrue(False, "unexpected error {}".format(ex))

try:
iu.infer_exact(
self,
model_name,
model_shape,
1,
np.float32,
np.float32,
np.float32,
model_version=2,
)
self.assertTrue(
False, "expected error for unavailable model " + model_name
)
except Exception as ex:
self.assertIn("Request for unknown model", ex.message())


if __name__ == "__main__":
unittest.main()
4 changes: 2 additions & 2 deletions qa/L0_lifecycle/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2136,7 +2136,7 @@ LOG_IDX=$((LOG_IDX+1))
# LifeCycleTest.test_add_custom_config
rm -fr models config.pbtxt.*
mkdir models
for i in savedmodel plan ; do
for i in savedmodel; do
cp -r $DATADIR/qa_model_repository/${i}_float32_float32_float32 models/.
mkdir models/${i}_float32_float32_float32/configs
sed 's/^version_policy:.*/version_policy: { specific: { versions: [2] }}/' \
Expand Down Expand Up @@ -2168,7 +2168,7 @@ LOG_IDX=$((LOG_IDX+1))
# LifeCycleTest.test_delete_custom_config
rm -fr models config.pbtxt.*
mkdir models
for i in savedmodel plan ; do
for i in savedmodel; do
cp -r $DATADIR/qa_model_repository/${i}_float32_float32_float32 models/.
mkdir models/${i}_float32_float32_float32/configs
sed 's/^version_policy:.*/version_policy: { specific: { versions: [2] }}/' \
Expand Down

0 comments on commit 0a3dfcd

Please sign in to comment.