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

Allow running tests with params #1028

Open
mrhawk555 opened this issue Dec 6, 2019 · 2 comments
Open

Allow running tests with params #1028

mrhawk555 opened this issue Dec 6, 2019 · 2 comments

Comments

@mrhawk555
Copy link

@mrhawk555 mrhawk555 commented Dec 6, 2019

Can you allow to run test procedures with params?

For example -

begin
  ut.run('hr.test_apply_bonus.bonus_cannot_be_negative(1)');
end;

@lwasylow
Copy link
Member

@lwasylow lwasylow commented Dec 6, 2019

This is unfortunately a quite complex task as we would need to allow to accept any type of parameter and from the string it can be hard to distinguished between a date/string etc.
What I would suggest is to create a common procedure accepting parameters and write a test for each input. e.g. test_success_for_2 , test_fail_for_minus4 etc.

@jgebal
Copy link
Member

@jgebal jgebal commented Dec 29, 2019

There are two more related issues:
#151 and #491

The challenge is not trivial and we can go into very different solutions.
Regardless of decided approach, it will require quite a bit of work.

Before starting the work, we should examine the pros and cons of different designs for parameter-driven tests.

We would not support passing parameter to test at suite run-time (as you propose).
Parameters should rather be part of suite definition.
Such approach would make tests non-deterministic as tests would fail/pass depending on provided inputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.