Adding --api-test for CI/CD

This commit is contained in:
Miroslav Štampar 2026-06-15 16:58:57 +02:00
parent d570f8e91f
commit 91bf58b54e
8 changed files with 292 additions and 10 deletions

View file

@ -188,6 +188,9 @@ def main():
elif conf.vulnTest:
from lib.core.testing import vulnTest
os._exitcode = 1 - (vulnTest() or 0)
elif conf.apiTest:
from lib.core.testing import apiTest
os._exitcode = 1 - (apiTest() or 0)
else:
from lib.controller.controller import start
if conf.profile:
@ -600,7 +603,7 @@ def main():
except OSError:
pass
if any((conf.vulnTest, conf.smokeTest)) or not filterNone(filepath for filepath in glob.glob(os.path.join(tempDir, '*')) if not any(filepath.endswith(_) for _ in (".lock", ".exe", ".so", '_'))): # ignore junk files
if any((conf.vulnTest, conf.smokeTest, conf.apiTest)) or not filterNone(filepath for filepath in glob.glob(os.path.join(tempDir, '*')) if not any(filepath.endswith(_) for _ in (".lock", ".exe", ".so", '_'))): # ignore junk files
try:
shutil.rmtree(tempDir, ignore_errors=True)
except OSError: