★ wanayoo — archive 1999 https://github.com/utPLSQL/utPLSQL/issues/151Nouvelle recherche | Portail wanayoo
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

Parameter drive tests #151

Open
jgebal opened this issue Jan 10, 2017 · 5 comments
Open

Parameter drive tests #151

jgebal opened this issue Jan 10, 2017 · 5 comments
Labels

Comments

@jgebal
Copy link
Member

@jgebal jgebal commented Jan 10, 2017

There is an interesting extension to JUnit:
https://github.com/Pragmatists/JUnitParams
We could think of implementing something similar.

Here are examples of different ways to use it.
https://github.com/Pragmatists/JUnitParams/blob/master/src/test/java/junitparams/usage/SamplesOfUsageTest.java

@Pazus
Copy link
Member

@Pazus Pazus commented Apr 18, 2018

—%test
—%parametrized(select name, birthdate from test_clients)
procedure tst_client_proc(a_name varchar2, a_birthdate date);

We can call it providing parameter values by iterating over sql statement using dbms_sql

We can also accept a function which returns a cursor.

Parameters should be mapped by name if the column aliases in the query correspond equally or by position if not.

@mathewbutler
Copy link

@mathewbutler mathewbutler commented Apr 18, 2018

Does this need to support query input? The model I have in mind is;

  • a data setup step
  • parameterised annotation passing list of items set up in data (without SQL)

With this you have the same capability, just without exposing SQL to the annotation.

My concern is opening up avenue of issues where users want to persist test / results data to drive tests rather that keep tests isolated and UtPLSQL clean from data storage.

@alesana-san
Copy link

@alesana-san alesana-san commented Dec 19, 2018

I agree with @mathewbutler. I guess the better option is to preset all test data (like test_clients) and then iterate over it in a single test and check the results. Given that we have:

  • Knowing that ut.expect doesn't stop execution after the first fail we will iterate through all given data;
  • We don't have tons of test executions in reports about every single launch of iterated test but still keep data about all fails;
  • I think that inventing a new annotation should provide some sort of a utility but we just take parametrizing (params, query or whatever) out of the test body and put it in a declaration part. Instead test-writer can do it by himself feeling free to write any kind of query and handle it in a way he wants it inside of the test body.

No offense, guys, just thoughts out of my head :)

@Pazus
Copy link
Member

@Pazus Pazus commented Sep 5, 2019

@jfluri
Copy link

@jfluri jfluri commented Jun 16, 2020

We should look at something like this:
https://junit.org/junit5/docs/current/user-guide/#writing-tests-parameterized-tests

I like the Functionality that the @MethodSource annotation in jUnit has. It provides a Stream of (multiple) parameters that are handed to the test executions. Like a rowtype in a way...

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
5 participants
You can’t perform that action at this time.