tests: Deprecate the use of CLI commands in tests. 49/18349/2
authorPaul Vinciguerra <pvinci@vinciconsulting.com>
Sun, 17 Mar 2019 14:17:03 +0000 (07:17 -0700)
committerNeale Ranns <nranns@cisco.com>
Mon, 18 Mar 2019 14:06:12 +0000 (14:06 +0000)
Since the stated policy regarding CLI commands is:
  "Note that the debug CLI is a developer's tool
   - no warranty express or implied - and that
   we may choose not to fix debug CLI bugs.",

this change emits a deprecation warning whenever a test case calls a CLI command.

Change-Id: I91b30e86ae1b2fca36732837f36cdda762cdf458
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
test/Makefile
test/vpp_papi_provider.py

index f78c8a8..e5e63d7 100644 (file)
@@ -111,7 +111,7 @@ $(PAPI_INSTALL_DONE): $(PIP_PATCH_DONE)
        @touch $@
 
 define retest-func
-@env FORCE_FOREGROUND=$(FORCE_FOREGROUND) FAILED_DIR=$(FAILED_DIR) VENV_PATH=$(VENV_PATH) scripts/setsid_wrapper.sh $(FORCE_FOREGROUND) $(VENV_PATH)/bin/activate $(PYTHON_INTERP) $(PYTHON_PROFILE_OPTS) run_tests.py -d $(TEST_DIR) $(UNITTEST_EXTRA_OPTS) || env FAILED_DIR=$(FAILED_DIR) COMPRESS_FAILED_TEST_LOGS=$(COMPRESS_FAILED_TEST_LOGS) scripts/compress_failed.sh
+@env FORCE_FOREGROUND=$(FORCE_FOREGROUND) FAILED_DIR=$(FAILED_DIR) VENV_PATH=$(VENV_PATH) scripts/setsid_wrapper.sh $(FORCE_FOREGROUND) $(VENV_PATH)/bin/activate $(PYTHON_INTERP) -Wd $(PYTHON_PROFILE_OPTS) run_tests.py -d $(TEST_DIR) $(UNITTEST_EXTRA_OPTS) || env FAILED_DIR=$(FAILED_DIR) COMPRESS_FAILED_TEST_LOGS=$(COMPRESS_FAILED_TEST_LOGS) scripts/compress_failed.sh
 endef
 
 .PHONY: sanity
index bce8336..98fbb2f 100644 (file)
@@ -9,8 +9,10 @@ import os
 import time
 from collections import deque
 
+import deprecation
 from six import moves, iteritems
 from vpp_papi import VPP, mac_pton
+
 from hook import Hook
 from vpp_l2 import L2_PORT_TYPE
 
@@ -390,6 +392,9 @@ class VppPapiProvider(object):
         self.hook.after_api(api_fn.__name__, api_args)
         return reply
 
+    @deprecation.deprecated(
+        deprecated_in="19.04", removed_in="19.07",
+        details="Use the Corresponding API function instead.")
     def cli(self, cli):
         """ Execute a CLI, calling the before/after hooks appropriately.