Another question with unit testing my own code on a CI server

31 views
Skip to first unread message

Justin A

unread,
Jan 19, 2018, 7:20:10 AM1/19/18
to RavenDB - 2nd generation document database

Hi all,

I'm sorry to keep asking question about unit testing my own code against RavenDb 4 but hopefully this would be the last one :)

I'm not sure what I need to do on a CI server (eg. VSTS or AppVeyor) to get my unit tests to work. I know that:

- I need raven.server.exe Or raven.server.dll 
- the updated docs have some really nice code that explains that it's trying to locate the exe/dll using env variables and if that fails, then some current directory attempts.
- my unit tests work great, locally .. when I fix the path to RavenDb 4.0 RC-40025, which i MANUALLY downloaded.

So, i'm wondering if this is what we have to do:

- create some powershell script that:
- downloads the specific version of ravendb 4.
- unzip that bad boy.
- add an env var .. which you then need to check in your custom locator class.
- profit!

is this the current practice about this?

if yes - then this should be added to the docs. (I can PR that, etc).

Side note: the code the MyRavenDbLocator isn't too bad. Something like that should be baked into the TestDriver library IMO. Documented so people know about the 'conventions' like the environment vars for localhost vs ci, etc. etc.


-le me-

Bruno Lopes

unread,
Jan 19, 2018, 8:40:17 AM1/19/18
to RavenDB - 2nd generation document database
why not lean on nuget, and have the tests depend on a server package of ravendb?
you get caching, can refer to a specific version, and the folder is somewhat well known. 
I guess the package would have to have some code mentioning the version so we could search for it in the packages\ folder?

I've been using a similar version of this, where the "setup script" that runs prior to the tests in CI does a nuget install RavenDB-Server -Version <v> -ExcludeVersion -OutputFolder local\

Justin A

unread,
Jan 19, 2018, 8:50:21 AM1/19/18
to RavenDB - 2nd generation document database
@bryan kewl - can u use dotnet CLI to do this?

Bruno Lopes

unread,
Jan 19, 2018, 9:05:06 AM1/19/18
to RavenDB - 2nd generation document database
Perhaps? A quick test showed me that dotnet restore only seems to look at .csproj ProjectReferences, which might or might not work.

If/when I get to this I might just pull nuget.exe and use that directly.

Oren Eini (Ayende Rahien)

unread,
Jan 19, 2018, 5:10:12 PM1/19/18
to ravendb
I would suggest downloading this manually on the CI end for now. 
Or using nuget to explicitly get the server and unzip it in a known location during the ci build script

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Justin A

unread,
Jan 20, 2018, 12:37:06 AM1/20/18
to RavenDB - 2nd generation document database
Ok - so I just did a PR to update the test-driver docs to include a way to do this via powershell for AppVeyor or VSTS.

It's pretty rushed cause i'm on holidays and all but I find this a 150% must-have for RavenDb so instead of asking others, you gotta do stuff yourself.

I'm also confused/shocked?? that no one else has made a comment on this, so far? As in - are _anyone_ doing CI/CD with RavenDb4 + tests ??? Surely...... ???

Jens Pettersson

unread,
Jan 20, 2018, 8:55:22 AM1/20/18
to RavenDB - 2nd generation document database
We’ve been doing unit/integration testning with RavenDB 4 successfully for a couple of months. However, with an on-prem CI server with a manually ”installed” server.

Justin A

unread,
Jan 20, 2018, 6:27:12 PM1/20/18
to RavenDB - 2nd generation document database
@jens

so you guys manually installed RavenDb on your own private CI server .. so your code then is hardcoded to that exact server-path?

Jens Pettersson

unread,
Jan 21, 2018, 12:12:04 AM1/21/18
to RavenDB - 2nd generation document database
We use environment variables for our test suite.

Things were easier in earlier versions but this works fine for us, for now.

Justin A

unread,
Jan 21, 2018, 8:05:06 AM1/21/18
to RavenDB - 2nd generation document database
Kewl :) That's what I've been playing around with doing also. Having Azure App Services (like a website or webjobs or functions, if I could get that to work ..) means it's easy to use the Azure Portal GUI to define my test driver settings ... 

so kewl! that's 2 people right now doing this who have spoken out. And one is with a fixed install of the raven-server ... 

anyone else been doing this yet?
Reply all
Reply to author
Forward
0 new messages