fledware / GodotXUnit

MIT License
32 stars 5 forks source link

Why mixes the modern .NET5 SDK format with the legacy .NET Framework project format? #6

Closed GeorgeS2019 closed 3 years ago

GeorgeS2019 commented 3 years ago

Please look at the discussion here to understand the question addressed to the author of GodotXUnit

rexfleischer commented 3 years ago

Sorry for the late comment.

I'm not entirely sure what's being asked. But this project isn't using NET5, it's on 4.7 iirc. I'm not very good with the build systems in dotnet, so suggestions and pull requests would be greatly appreciated.

One technical issue that should be brought up is with xunit. To have custom annotations (GodotFact), xunit requires the dll to be specified: https://github.com/fledware/GodotXUnit/blob/master/addons/GodotXUnit/GodotXUnitApi/GodotFactAttribute.cs#L48

I hope this clears some things up, let me know!

rexfleischer commented 3 years ago

Also, I'd like to say thanks for the attention you've been giving to this project!

GeorgeS2019 commented 3 years ago

@rexfleischer NOT .NET5 but .NET5 project format.

[.NET5 SDK project format]

[Non .NET5 SDK but legacy .NET framework project format]

I feedback that it is more the issue we need to sort out as discussed here, the benefit of .NET5 project format for simplicity

GeorgeS2019 commented 3 years ago

@rexfleischer The other issues are as described, not sure if you have solutions soon

rexfleischer commented 3 years ago
  • non IDE integration

This would be really cool and I wanted to look into building a plugin for intellij to run tests there. But, all these build issues came up.

  • using GD.Print statement within test (e.g. Fact and GodotFact) is not show up in the output of the (positive) test results ==> now we only get "No output"

This is definitely on my radar of things. The issue is that the godot tests run in a different process than the godot IDE, so there needs to be a way to grab output sent by GD.Print, which I couldnt find. You can either use console output, or GDU.Print.

I see what you mean now by the mixing of project builds. That's the main problem that I ran into. Godot 3.2.3 very forcefully changed the csproj file on the root. For instance, if you pull down this project, godot will change the csproj file. But you can see it is the same: https://github.com/fledware/GodotXUnit/blob/master/GodotXUnit.csproj#L2

And I couldn't get Godot.NET.Sdk/3.2.3 to build the sub projects.

GeorgeS2019 commented 3 years ago

@rexfleischer

Godot 3.2.3 very forcefully changed the csproj file

At least you have a provision for calling test.dll at a custom folder outside the godot project. I have not tested it yet. This could be one way to bring most of the unit tests in cs projects outside the godot project folder and use the .NET5 SDK project format.

rexfleischer commented 3 years ago

That may be true, but then I don't think intellij will be able to find it if the attributes are hot loaded during compile time. I don't think that's a pattern I'd like to support.

GeorgeS2019 commented 3 years ago

@rexfleischer Do you plan to support Visual Studio e.g. 2019? There is a VS2019 Godot extension. Do you see a way to combine it?

rexfleischer commented 3 years ago

I wasn't planning to. The only one I was planning to support was rider, because that's the IDE I use.

I was planning on doing this same type of thing when kotlin scripting becomes stable. I'd be able to reuse integration work with rider with the kotlin IDE.

rexfleischer commented 3 years ago

I'm going to close this for now as won't fix. Until there is a way to have a multi project in godot, I'm not aware of a way to fix it.

If someone has a suggestion on how to have a multi project or some other solution, please open a different ticket as an enhancement.