Skip to content
This repository was archived by the owner on Feb 2, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions cli/raft-tools/libs/python3/raft.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def install_certificates():
subprocess.check_call(["update-ca-certificates", "--fresh"])


def auth_token(init):
def auth_token(init, pip_root_dir=None):
work_directory = os.environ['RAFT_WORK_DIRECTORY']
run_directory = os.environ['RAFT_TOOL_RUN_DIRECTORY']
with open(os.path.join(work_directory, "task-config.json"), 'r') as task_config:
Expand All @@ -49,7 +49,13 @@ def auth_token(init):

if init:
print("Installing MSAL requirements")
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", os.path.join(msal_dir, "requirements.txt")])
args = [sys.executable, "-m", "pip", "install", "--no-cache-dir"]
if pip_root_dir:
args = args + ["--root", pip_root_dir]

args = args + ["-r", os.path.join(msal_dir, "requirements.txt")]

subprocess.check_call(args)
else:
print("Retrieving MSAL token")
sys.path.append(msal_dir)
Expand Down
4 changes: 2 additions & 2 deletions cli/raft-tools/tools/Schemathesis/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"container" : "python:3.9.1-buster",
"container" : "schemathesis/schemathesis:v3.0.8-buster",
"shell" : "/bin/sh",
"run" : {
"shellArguments" : ["-c",
"pip install schemathesis; cd /; python3 $RAFT_TOOL_RUN_DIRECTORY/run.py install; sleep $RAFT_STARTUP_DELAY; python3 $RAFT_TOOL_RUN_DIRECTORY/run.py" ]
"cd /; python3 $RAFT_TOOL_RUN_DIRECTORY/run.py install; sleep $RAFT_STARTUP_DELAY; python3 $RAFT_TOOL_RUN_DIRECTORY/run.py" ]
},
"idle" : {
"shellArguments" : ["-c", "echo DebugMode; while true; do sleep 100000; done;"]
Expand Down
5 changes: 3 additions & 2 deletions cli/raft-tools/tools/Schemathesis/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@

if __name__ == "__main__":
if len(sys.argv) == 2 and sys.argv[1] == "install":
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", os.path.join(raft_libs_dir, "requirements.txt")])
raft.auth_token(True)
subprocess.check_call([sys.executable, "-m", "pip", "install", "--no-cache-dir", "--root", "/tmp", "-r", os.path.join(raft_libs_dir, "requirements.txt")])
raft.auth_token(True, pip_root_dir='/tmp')
else:
sys.path.append('/tmp/usr/local/lib/python3.9/site-packages')
raft.install_certificates()
token = raft.auth_token(False)

Expand Down