Skip to content
This repository was archived by the owner on Feb 2, 2022. It is now read-only.

Commit 28b4037

Browse files
stishkinstas
andauthored
Use updated schemathesis docker image (#136)
Co-authored-by: stas <statis@microsoft.com>
1 parent e7bc863 commit 28b4037

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

cli/raft-tools/libs/python3/raft.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def install_certificates():
2626
subprocess.check_call(["update-ca-certificates", "--fresh"])
2727

2828

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

5050
if init:
5151
print("Installing MSAL requirements")
52-
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", os.path.join(msal_dir, "requirements.txt")])
52+
args = [sys.executable, "-m", "pip", "install", "--no-cache-dir"]
53+
if pip_root_dir:
54+
args = args + ["--root", pip_root_dir]
55+
56+
args = args + ["-r", os.path.join(msal_dir, "requirements.txt")]
57+
58+
subprocess.check_call(args)
5359
else:
5460
print("Retrieving MSAL token")
5561
sys.path.append(msal_dir)

cli/raft-tools/tools/Schemathesis/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"container" : "python:3.9.1-buster",
2+
"container" : "schemathesis/schemathesis:v3.0.8-buster",
33
"shell" : "/bin/sh",
44
"run" : {
55
"shellArguments" : ["-c",
6-
"pip install schemathesis; cd /; python3 $RAFT_TOOL_RUN_DIRECTORY/run.py install; sleep $RAFT_STARTUP_DELAY; python3 $RAFT_TOOL_RUN_DIRECTORY/run.py" ]
6+
"cd /; python3 $RAFT_TOOL_RUN_DIRECTORY/run.py install; sleep $RAFT_STARTUP_DELAY; python3 $RAFT_TOOL_RUN_DIRECTORY/run.py" ]
77
},
88
"idle" : {
99
"shellArguments" : ["-c", "echo DebugMode; while true; do sleep 100000; done;"]

cli/raft-tools/tools/Schemathesis/run.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111

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

0 commit comments

Comments
 (0)