Skip to content

Commit 88ac6ce

Browse files
committed
fix script for new argument parasing
1 parent fe5e782 commit 88ac6ce

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

utils/appverifier_launch_sample.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def launchSample(sample_file, sample_region, sample_secret_endpoint, sample_secr
2424
SecretId=sample_secret_certificate)
2525
sample_private_key = secrets_client.get_secret_value(
2626
SecretId=sample_secret_private_key)
27-
except Exception: # lgtm [py/catch-base-exception]
27+
except Exception: # lgtm [py/catch-base-exception]
2828
sys.exit("ERROR: Could not get secrets to launch sample!")
2929

3030
current_folder = pathlib.Path(__file__).resolve()
@@ -41,7 +41,7 @@ def launchSample(sample_file, sample_region, sample_secret_endpoint, sample_secr
4141
print("Saved credentials to file...")
4242

4343
print("Processing arguments...")
44-
launch_arguments = []
44+
launch_arguments = [sample_file]
4545
launch_arguments.append("--endpoint")
4646
launch_arguments.append(sample_endpoint)
4747
launch_arguments.append("--cert")

utils/run_in_ci.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,9 @@ def launch_runnable(runnable_dir):
323323
# C++
324324
elif (config_json['language'] == "CPP"):
325325
runnable_file = os.path.join(runnable_dir, config_json['runnable_file'])
326-
print(f"launch runnable with arguments: {config_json_arguments_list}")
327-
runnable_return = subprocess.run(args=config_json_arguments_list, input=subprocess_stdin, timeout=runnable_timeout, executable=runnable_file)
326+
# For cpp, argv[0] is the program name, so we need to add the runnable_file as the first argument
327+
config_json_arguments_list.insert(0, runnable_file)
328+
runnable_return = subprocess.run(args=config_json_arguments_list, input=subprocess_stdin, timeout=runnable_timeout, executable="")
328329
exit_code = runnable_return.returncode
329330

330331
elif (config_json['language'] == "Python"):

utils/run_sample_ci.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ def launch_sample():
289289
# C++
290290
elif (config_json['language'] == "CPP"):
291291
try:
292+
config_json_arguments_list.insert(0, config_json['sample_file'])
292293
sample_return = subprocess.run(
293294
args=config_json_arguments_list, executable=config_json['sample_file'], timeout=600, capture_output=True, text=True)
294295
print("stdout:")

0 commit comments

Comments
 (0)