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

Test coverage is reported incorrectly if extended events files roll over #5

Closed
jmclusky opened this issue Sep 27, 2016 · 3 comments
Closed
Assignees

Comments

@jmclusky
Copy link
Contributor

Many events are missing from the Extended Events trace files when the output is large enough to cause a rollover to the next file (by default, this is 1Gb).

We have a very large test suite - over 2500 tests across 187 test classes. This generates around 4.5Gb worth of extended events logs in the default settings.

I noticed that coverage wasn't being reported as good as I was expected, and some stored procedures that I know have good coverage were reporting not being visited. Their object IDs were missing from the .xel files when analysed directly, but the tests themselves were run when I checked tSQLt.TestResult.

I noticed when I changed the SQL statement run from tSQLt.RunAll to just run the test class in question the test coverage was correct for the stored procedures I was examining.

I have worked around this by editing the SQL statement that sets up the extended event session to specify max_file_size=(65536) on the target - the output is now 10Gb, over twice the size of the split files.

Obviously this is a bug in SQL Server itself, not SQL Cover, but it may be worth working around the issue. One option might be to make the max_file_size configurable (similar to the timeout, which as you can imagine that I'm having to increase!).

A better option might be to split the test runs - rather than using tSQLt.RunAll, it might be better to batch up by test class and retrieve the extended events data after each test class is run. This will reduce disk space consumption on the SQL Server as well.

@GoEddie
Copy link
Owner

GoEddie commented Sep 27, 2016

Hi John,

Thanks for submitting these issues!

There are two versions of the tool, one is for azure which doesn't use trace files but the memory buffer - I will look at whether that can be used for very large test suites.

I know it will need to make sure it pulls off the data quick enough so we don't lose anything so it isn't straightforward but should mean we don't get trace rollover files.

There will need to be a tradeoff between large traces and the processing required.

I'll look into what the best way to approach it is and report back here!

ed

@GoEddie GoEddie self-assigned this Sep 27, 2016
Seddryck pushed a commit to Seddryck/SQLCover that referenced this issue Jan 13, 2017
Seddryck pushed a commit to Seddryck/SQLCover that referenced this issue Jan 13, 2017
Fixed GoEddie#5 : wrong url
GoEddie pushed a commit that referenced this issue Jan 23, 2017
* Fix issue #5 : badge for licence - Apache 2.0 and not MIT

* Update README.md

Fixed #5 : wrong url
GoEddie pushed a commit that referenced this issue Feb 23, 2017
* Fix issue #5 : badge for licence - Apache 2.0 and not MIT

* Fix useless references in projects

* Add configuration for connection string

* add missing files in project file

* add redirection to config file for connectionString

* Change test syntax to improve debugging on appveyor

* Ignore two integration tests. Waiting feedback from GoEddie.

* Add user.config file for personal settings and rollback default connectionString to previous value. Update .gitignore with *.user.config
GoEddie pushed a commit that referenced this issue Feb 23, 2017
* Fix issue #5 : badge for licence - Apache 2.0 and not MIT

* Fix useless references in projects

* Add configuration for connection string

* add missing files in project file

* add redirection to config file for connectionString

* Change test syntax to improve debugging on appveyor

* Ignore two integration tests. Waiting feedback from GoEddie.

* Add user.config file for personal settings and rollback default connectionString to previous value. Update .gitignore with *.user.config

* Add nuspec file and ps to create nuget package

* Rely on environment variable for nugetVersion in place of hardcoded

* Add appVeyor.yml
@ghost
Copy link

ghost commented Oct 25, 2017

Hello, I'm having this issue, but I don't see what the resolution is from this thread.. Is it incorrectly closed, or have I missed something?

Thanks !

@Athi2019
Copy link

Athi2019 commented Oct 9, 2019

I am facing the same issue now. Do we have a resolution pls?

Thankyou.

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

No branches or pull requests

3 participants