aboutsummaryrefslogtreecommitdiffstats
path: root/checks.py
diff options
context:
space:
mode:
authorLovett, Trevor <trevor.lovett@att.com>2019-08-27 12:40:36 -0500
committerLovett, Trevor (tl2972) <tl2972@att.com>2019-08-27 16:02:47 -0500
commit84db7f8f65cd0ec77f09cfde365599df9890ce6c (patch)
treeeadedec4cb5f0db131442a6e594a5b8c61ee50cf /checks.py
parentb1df832ae5ddaac6344b7ccf3f1f32a0bcfbdd67 (diff)
[VVP] Generated completed preload from env files
User can supply an optional directory containing .env files and/or CSAR VSP which can be used to generate populated preloads in the requested format. The nested directories can be used to create sub-environments that inherit their settings from the parent directories. Optionally, values can be specified in a defaults.yaml and they will be used if that value is not defined in the .env file. This is useful if the parameter name and value will be the same in all modules. Issue-ID: VVP-278 Change-Id: Icd9846c63463537793db908be8ce5dba13c4bda3 Signed-off-by: Lovett, Trevor <trevor.lovett@att.com>
Diffstat (limited to 'checks.py')
-rw-r--r--checks.py28
1 files changed, 17 insertions, 11 deletions
diff --git a/checks.py b/checks.py
index b43d6c7..4431d26 100644
--- a/checks.py
+++ b/checks.py
@@ -52,6 +52,16 @@ THIS_DIR = os.path.dirname(os.path.abspath(__file__))
CURRENT_NEEDS_PATH = os.path.join(THIS_DIR, "ice_validator/heat_requirements.json")
+def run_pytest(*args, msg="pytest failed"):
+ original_dir = os.getcwd()
+ try:
+ os.chdir(os.path.join(THIS_DIR, "ice_validator"))
+ if pytest.main(list(args)) != 0:
+ return [msg]
+ finally:
+ os.chdir(original_dir)
+
+
class Traceability:
PATH = os.path.join(THIS_DIR, "ice_validator/output/traceability.csv")
@@ -145,18 +155,14 @@ def check_requirements_up_to_date():
return None
+def check_app_tests_pass():
+ return run_pytest("tests", "--self-test",
+ msg="app_tests failed. Run pytest app_tests and fix errors.")
+
+
def check_self_test_pass():
- """
- Run pytest self-test and ensure it passes
- :return:
- """
- original_dir = os.getcwd()
- try:
- os.chdir(os.path.join(THIS_DIR, "ice_validator"))
- if pytest.main(["tests", "--self-test"]) != 0:
- return ["VVP self-test failed. Run pytest --self-test and fix errors."]
- finally:
- os.chdir(original_dir)
+ return run_pytest("tests", "--self-test",
+ msg="self-test failed. Run pytest --self-test and fix errors.")
def check_testable_requirements_are_mapped():