mirror of
https://github.com/github/codeql.git
synced 2026-03-04 06:36:46 +01:00
20 lines
766 B
Python
20 lines
766 B
Python
import subprocess
|
|
import logging
|
|
|
|
|
|
def test(codeql, java):
|
|
# Each of these serves the "repo" and "repo2" directories on http://localhost:924[89]
|
|
repo_server_process = subprocess.Popen(["python3", "-m", "http.server", "9428", "-b", "localhost"], cwd="repo")
|
|
repo_server_process2 = subprocess.Popen(["python3", "-m", "http.server", "9429", "-b", "localhost"], cwd="repo2")
|
|
try:
|
|
codeql.database.create(
|
|
extractor_option="buildless=true",
|
|
_env={"CODEQL_EXTRACTOR_JAVA_OPTION_BUILDLESS_CLASSPATH_FROM_BUILD_FILES": "true"},
|
|
)
|
|
finally:
|
|
try:
|
|
repo_server_process.kill()
|
|
except Exception as e:
|
|
logging.error("Failed to kill server 1:", e)
|
|
repo_server_process2.kill()
|