masesgroup / KNet

KNet is a comprehensive .NET suite for Apache Kafka™ providing all features: Producer, Consumer, Admin, Streams, Connect, backends (ZooKeeper and Kafka).
https://knet.masesgroup.com/
Apache License 2.0
32 stars 6 forks source link

Add test execution at the end of build process #480

Closed masesdevelopers closed 1 week ago

masesdevelopers commented 1 month ago

Is your feature request related to a problem? Please describe. Currently no tests are executed.

Describe the solution you'd like The build workflow can execute some unit tests to verify execution. Meanwhile the test projects can be enhanced to use the Microsoft.NET.Test.Sdk and/or Microsoft.TestPlatform.TestHost

Describe alternatives you've considered N/A

Additional context N/A

masesdevelopers commented 1 month ago

Reopen with https://github.com/masesgroup/KNet/pull/481#issuecomment-2155339231

masesdevelopers commented 3 weeks ago

The build workflow shall report the error when the following line of code https://github.com/masesgroup/KNet/blob/b9d7372b0b7497b40ee504699704bfa055e95e6c/tests/net/KNetTest/Program.cs#L463 it is activated, however the whole workflow shall not fail.

masesdevelopers commented 2 weeks ago

Add tests on MacOS

masesdevelopers commented 1 week ago

For MacOS and Windows try to start local ZooKeeper and Apache Kafka broker then execute the tests

masesdevelopers commented 1 week ago

Sometime tests done in net462 reports:

Unhandled Exception: Java.Lang.NullPointerException
   at MASES.JCOBridge.C2JBridge.JVMInterop.JavaClass.Invoke(String methodName, Object[] args, Object& result)
   at MASES.JCOBridge.C2JBridge.JVMInterop.JavaClass.Invoke(String methodName, Object[] args)
   at MASES.JCOBridge.C2JBridge.JVMBridgeBase`1.SExecute[TReturn](IJavaType clazz, String methodName, Object[] args)
   at MASES.KNet.Serialization.SerDes`2..ctor() in /_/src/net/KNet/Specific/Serialization/SerDes.cs:line 158
   at MASES.KNetTest.Program.Main(String[] args) in /_/tests/net/General/KNetTest/Program.cs:line 140

probably the problem is the same solved in #509 moving out from main initialization of object which needs a started JVM.