Skip to content

clar: correctly account for "data" suites when counting#5168

Merged
pks-t merged 1 commit intolibgit2:masterfrom
tiennou:clar/fix-data-suite-count
Jul 18, 2019
Merged

clar: correctly account for "data" suites when counting#5168
pks-t merged 1 commit intolibgit2:masterfrom
tiennou:clar/fix-data-suite-count

Conversation

@tiennou
Copy link
Contributor

@tiennou tiennou commented Jul 16, 2019

Failing to do that makes clar miss the last of the suites, as all duplicated "data" would have not been accounted for.

Failing to do that makes clar miss the last of the suites, as all
duplicated "data" would have not been accounted for.
@tiennou
Copy link
Contributor Author

tiennou commented Jul 16, 2019

(Filed upstream: clar-test/clar#82)

Copy link
Member

@pks-t pks-t left a comment

Choose a reason for hiding this comment

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

Yup, agreed. Thanks for cleaning up after myself!

@pks-t pks-t merged commit 368b979 into libgit2:master Jul 18, 2019
@tiennou
Copy link
Contributor Author

tiennou commented Jul 18, 2019

No problem. I got quite confused by the "no such testsuite z::zz" messages in libssh2 😉.

I think the filtering would also gain to be improved — right now the filter syntax with "data labels" looks like this: -ssystem::suite (label)::testcase, and you can't refer to all labelled testcases of a group at once (IOW -ssystem::suite is not recognized. Also, I'm not fond of spaces + parenthesis appearing in those specifiers.

Would changing the syntax to something like -ssystem::suite[-label]::testcase would be acceptable ? That would allow filtering on any specific suite's "data label" (-ssystem::suite[-label]), all of them (-ssystem::suite), or all "data labels" (-s-label). That last one is accidental, but could be made to work.

(Just my 2c, my current pet clar peeve is skip reasons so it might get implemented first 😉).

@tiennou tiennou deleted the clar/fix-data-suite-count branch July 18, 2019 09:38
@pks-t
Copy link
Member

pks-t commented Jul 18, 2019

Yeah, I just stumbled over the exact same issue. Didn't realize at first that we in fact stopped executing those tests altogether!

I'm certainly open to changing how the syntax looks like, and filtering by data label would certainly be useful.

@pks-t
Copy link
Member

pks-t commented Jul 18, 2019

But wait, I'm already using your PR but it's still wrong. Are we skipping over modules which have no initializers at all now?

@pks-t
Copy link
Member

pks-t commented Jul 18, 2019

In fact it works correctly without this PR :/


def suite_count(self):
return len(self.modules)
return sum(len(module.initializers) for module in self.modules.values())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are we skipping over modules which have no initializers at all now?

Sounds like it does, yes. min(☝️, 1) then ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no such test suites in libssh2, which explains why I missed it 😞.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I tried the same locally, but in fact this didn't fix the issue for me. Didn't dig deeper yet, though

Copy link
Member

Choose a reason for hiding this comment

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

Oops. Because we both had the same issue of using min instead of max. See #5175 for a fix

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants