diff --git a/.github/workflows/on_pull_request.yaml b/.github/workflows/on_pull_request.yaml index 8693fd003..57f46ab6e 100644 --- a/.github/workflows/on_pull_request.yaml +++ b/.github/workflows/on_pull_request.yaml @@ -24,11 +24,11 @@ jobs: python-version: 3.10.6 cache: pip cache-dependency-path: requirements.txt - - name: Install PyLint - run: | - python -m pip install --upgrade pip - pip install pylint - name: Install dependencies + run: | + python launch.py --test - name: Analysing the code with pylint run: | - pylint $(git ls-files '*.py') + python -m pip install --upgrade pip + pip install pylint + pylint $(git ls-files '*.py') diff --git a/launch.py b/launch.py index bf34ee507..ad55ca2e3 100644 --- a/launch.py +++ b/launch.py @@ -97,5 +97,9 @@ if __name__ == "__main__": setup.log.info(f"Server arguments: {sys.argv[1:]}") setup.log.debug('Starting WebUI') logging.disable(logging.INFO) - import webui - webui.webui() + if args.test: + setup.log.info(f"Test only") + import webui + exit(0) + else: + webui.webui() diff --git a/setup.py b/setup.py index 804ee35b0..649718bd0 100644 --- a/setup.py +++ b/setup.py @@ -496,6 +496,7 @@ def add_args(): parser.add_argument('--skip-extensions', default = False, action='store_true', help = "Skips running individual extension installers, default: %(default)s") parser.add_argument('--skip-git', default = False, action='store_true', help = "Skips running all GIT operations, default: %(default)s") parser.add_argument('--experimental', default = False, action='store_true', help = "Allow unsupported versions of libraries, default: %(default)s") + parser.add_argument('--test', default = False, action='store_true', help = "Run test only, default: %(default)s") def parse_args():