ravendb / ravendb-jvm-client

RavenDB JVM Client
MIT License
13 stars 13 forks source link

BUG: TestDriver runtime version is lower than installed version but won't run #67

Closed cmitchell closed 1 year ago

cmitchell commented 1 year ago

I'm trying to use the TestDriver in a junit test and I get the following error despite having version 7.0.3 of the .NET runtime installed which is above he require 6.0.9+ :

 Caused by:
                java.lang.IllegalStateException: Could not find a matching runtime for '6.0.9+'. Available runtimes:
                - 7.0.3
                    at net.ravendb.embedded.RuntimeFrameworkVersionMatcher.match(RuntimeFrameworkVersionMatcher.java:56)
                    at net.ravendb.embedded.RuntimeFrameworkVersionMatcher.match(RuntimeFrameworkVersionMatcher.java:28)
                    at net.ravendb.embedded.RavenServerRunner.run(RavenServerRunner.java:81)
                    at net.ravendb.embedded.EmbeddedServer.runServer(EmbeddedServer.java:187)
                    at net.ravendb.embedded.EmbeddedServer.lambda$startServer$0(EmbeddedServer.java:60)
                    at net.ravendb.client.documents.Lazy.getValue(Lazy.java:24)
                    at net.ravendb.embedded.EmbeddedServer.startServer(EmbeddedServer.java:71)
                    at net.ravendb.test.driver.RavenTestDriver.runServer(RavenTestDriver.java:358)
                    at net.ravendb.test.driver.RavenTestDriver.lambda$static$0(RavenTestDriver.java:61)
                    at net.ravendb.client.documents.Lazy.getValue(Lazy.java:24)
                    at net.ravendb.test.driver.RavenTestDriver.getDocumentStore(RavenTestDriver.java:116)
                    at net.ravendb.test.driver.RavenTestDriver.getDocumentStore(RavenTestDriver.java:101)

Do you need to update the test-driver package and re-release? RavenDB 5.4.100 itself (not the TestDriver which only goes up to 5.4) runs just fine on the above version of .NET.

Is there a TestContainers of RavenDB?

ppekrol commented 1 year ago

Hi @cmitchell

Your value of FrameworkVersion is '6.0.9+' which means that all 6.0 patch releases greater or equal to 9 will be accepted (e.g 6.0.9, 6.0.10, etc) so it does not match the 7.0.3 .NET that you have on your machine.

Starting from 5.4.100, we switched to .NET 7, so proper value would be 7.0.3+ for example.

You can read more about it here: https://ravendb.net/docs/article-page/5.4/Csharp/server/embedded#net-frameworkversion

I hope it helps you.

cmitchell commented 1 year ago

@ppekrol Yes, that matches what I suspected happened.

I'm using the latest available ravendb-test-driver released in October 2022 from here: https://mvnrepository.com/artifact/net.ravendb/ravendb-test-driver/5.4.0 implementation("net.ravendb:ravendb-test-driver:5.4.0")

When will you make the ravendb-test-driver for 5.4.100 available? I'm using the latest ravendb version (5.4.100) and would like to be able to write tests that match that version.

ml054 commented 1 year ago

@cmitchell We will release 5.4.1 with dotnet 7.0.2+ and latest RavenDB server (5.4.101)

ml054 commented 1 year ago

I've released java 5.4.1 - it should be in maven central in few hours.

ml054 commented 1 year ago

@cmitchell Let me know if it resolves this issue.

cmitchell commented 1 year ago

Hi @ml054 Yes! That solved the issue. Thank you!