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

<single-row> gives false positive, when <all-rows> fails for a single row result set #547

Closed
lukzas opened this issue Oct 25, 2019 · 2 comments
Labels
Milestone

Comments

@lukzas
Copy link
Contributor

lukzas commented Oct 25, 2019

Consider the following predicate for a single row numeric value equal 5 to be more than 20

<test name="numeric">
    <system-under-test>
      <resultSet>
        <query>
          <![CDATA[
        SELECT 5
      ]]>
        </query>
      </resultSet>
    </system-under-test>
    <assert>
      <single-row>
        <predicate operand="#0" type="numeric">
          <more-than>20</more-than>
        </predicate>
      </single-row>
    </assert>
  </test>

Above test is passed (and it should not), but when used with <all-rows> tag instead it is evaluated properly and fails. Using alias or name for column does not help. When more-than value is changed, so that predicate holds, both tests are passed.

Tried NBi 1.21 RCs up to latest 1.22 beta v4

@Seddryck
Copy link
Owner

I confirm the bug

@Seddryck
Copy link
Owner

Great thanks for reporting this nasty bug.

The issue was that the single-row was not deserialized and the test resulted in a no test without constraint (so no potential failure).

I fixed the deserialization and added a warning when running a test without constraint.

The fix will be included in release 1.21 but is now part of 1.22 branch.

Fix available at https://ci.appveyor.com/project/Seddryck/nbi/builds/28399795/artifacts or in 1.22-beta0009

@Seddryck Seddryck added this to the v1.21 milestone Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants