Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test/sample_test] Fix arguments parsing in yaml config. #2150

Closed
Closed
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
3 changes: 2 additions & 1 deletion test/sample-test/run_sample_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def run(self):
except OSError as ose:
print('Config file with the same name not found, use default args:{}'.format(ose))
else:
self._test_args.update(raw_args['arguments'])
if raw_args['arguments']:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will fail if there is no 'argument'.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to check if arguments exists and check the value is not None

self._test_args.update(raw_args['arguments'])
if 'output' in self._test_args.keys(): # output is a special param that has to be specified dynamically.
self._test_args['output'] = self._output
if 'test_timeout' in raw_args.keys():
Expand Down