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

Improve Install of targets / crash Install on Databasetarget. #2103

Merged
merged 2 commits into from
May 17, 2017

Conversation

M4ttsson
Copy link
Contributor

My first PR so I hope I got everything right.
Fixes #1098

Null check in Install to ensure that the ConnectionType has been set.
@codecov
Copy link

codecov bot commented May 10, 2017

Codecov Report

Merging #2103 into master will increase coverage by <1%.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master   #2103    +/-   ##
=======================================
+ Coverage      81%     81%   +<1%     
=======================================
  Files         289     289            
  Lines       19957   19964     +7     
  Branches     2360    2361     +1     
=======================================
+ Hits        16176   16234    +58     
+ Misses       3175    3126    -49     
+ Partials      606     604     -2

@M4ttsson
Copy link
Contributor Author

Btw, should my unit test run in Travis? I assumed that the other sql test that I "took inspiration" from is not run in Travis for a reason so I used the same if-case to disable it.

@304NotModified 304NotModified self-requested a review May 13, 2017 13:45
@304NotModified
Copy link
Member

thanks!

AFAIK Travis doesn't have a SQL service? If it has, it would be great to enable (I'm an other pull request ;)

@304NotModified
Copy link
Member

More info is here: https://docs.travis-ci.com/user/database-setup/

@304NotModified
Copy link
Member

Thanks! this a great improvement.

But I was thinking, isn't easier to do something like this?

public void Install(InstallationContext installationContext) {
  if(!IsInitialized)
  { 
     InitializeTarget(); 
  }
  ...
}

@304NotModified 304NotModified added database-target enhancement Improvement on existing feature labels May 16, 2017
@304NotModified 304NotModified modified the milestone: 4.4.10 May 16, 2017
@M4ttsson
Copy link
Contributor Author

Yes, it would. I was concerned about any side effects of calling the base.InitializeTarget() that contains calls to a FindAllLayouts() method. I guess it would cause the layouts to be loaded?
I could change it if you want? I agree that the code would look better that way.

@304NotModified
Copy link
Member

Indeed the side effect is less clear.

So for now this is good enough, thanks!

@304NotModified 304NotModified merged commit c38dd7a into NLog:master May 17, 2017
@M4ttsson
Copy link
Contributor Author

M4ttsson commented May 18, 2017

Awesome. I think I'll look for another issue to do now. Or should I maybe create an mysql version of the install tests so it can be tested in Travis too?

@304NotModified
Copy link
Member

Or should I maybe create an mysql version of the install tests so it can be tested in Travis too?

That would be great also to have!

@304NotModified
Copy link
Member

Fixed in 4.4.10 and the release is queued. Will be online in a few hours!

Thanks for the submit!

@M4ttsson
Copy link
Contributor Author

Awesome.
I might have some time tomorrow to look at creating the mysql install test we mentioned. Should I just do it and create a pull request or how should I do it?

@304NotModified
Copy link
Member

Just send a PR. Would be great to have!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database-target enhancement Improvement on existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants