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

Make ignore role standard unless otherwise specified #296

Closed
Code-nomad opened this issue Aug 29, 2017 · 7 comments
Closed

Make ignore role standard unless otherwise specified #296

Code-nomad opened this issue Aug 29, 2017 · 7 comments

Comments

@Code-nomad
Copy link

Code-nomad commented Aug 29, 2017

Example:

      <equalTo>
            <column index="0" role="key"/>
            <column index="1" type="numeric" role="value" tolerance="0.001"/>
            <column index="..." role="ignore"/>
            <resultSet ..../>
      </equalTo>

Columns that are not to be included in the test are currently marked with the ignore keyword. On big tables of which you only want to check one or two columns you have to specify ignore on all the others.

The feature proposition is: Make ignore standard behavior unless specified otherwise.

@Seddryck Seddryck self-assigned this Aug 29, 2017
@Seddryck
Copy link
Owner

I understand the unfriendliness of the current design when most of the columns must be set to ignore. Nevertheless, changing the default behaviour (all columns are keys except the first) is a huge breaking-change and will probably break 20% of the tests that are coded with NBi.

I'll check further the best solution but I'll probably add an attribute at the level of the equalTo assertion to specify that by default columns should be ignored.

@Seddryck Seddryck added this to the v1.16 milestone Aug 29, 2017
@Code-nomad
Copy link
Author

Code-nomad commented Aug 29, 2017

I was talking to Wim last week about a possible non mandatory attribute remarking default behavior. That might be a slightly more elegant solution.

@FuegoArtificial
Copy link

How could a use case look like to ignore columns? I never select columns I don't test for, that's why I ask.

@Seddryck
Copy link
Owner

Seddryck commented Sep 1, 2017

@FuegoArtificial If you've a stored procedure returning 3 columns (1 key and two values), the best practice is to have two tests, one checking the first value-column and ignoring the second and a second with the opposite configuration.

Another case is when you've a CSV file with many information including the few columns that you need for your assertion.

@FuegoArtificial
Copy link

ah okay, that makes sense.
I disagree with that best practice to have an extra test for each value along the same entities, so maybe that's why I never have that use case.
There can be a heavy performance impact on the one side and I don't see a reason not to test multiple values at once on the other side. But maybe that's a matter of taste to understand which values fail just from the test name instead of having to look on the error result table.

@Seddryck
Copy link
Owner

Seddryck commented Sep 2, 2017

Finally, I just added an option to specify none for the values attribute of the equalTo assertion. If you select this option it means that you must specify one by one all the columns that should be treated as a value column.

@Seddryck
Copy link
Owner

Seddryck commented Sep 2, 2017

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

No branches or pull requests

3 participants