Open Arthurvdv opened 4 months ago
Currently the references inside the test project are added with the private attribute set to False. So they won't be copied to the bin folder of the test project and the tests fail (but not very visible)
dotnet test
doesn't display anything. Rider displays some cryptic messages, and Visual Studio did something similar.
I already commented on the pull request to ask this question (see https://github.com/StefanMaron/BusinessCentral.LinterCop/pull/648#issuecomment-2209548702). But since it's already merged, christophstuber may not have noticed.
<Reference Include="Microsoft.Dynamics.Nav.CodeAnalysis">
<SpecificVersion>False</SpecificVersion>
<HintPath>../ALLanguage/extension/bin/Analyzers/Microsoft.Dynamics.Nav.CodeAnalysis.dll</HintPath>
<Private>False</Private> <!-- should be True, but I am not sure if this was maybe intentional -->
</Reference>
Maybe we can set it to true, until christophstuber gets back to us.
@dannoe , awesome! That was indeed the difference it seems and now I see the options to run tests as I would expect 🥳
I'll await the feedback of christophstuber before changing these properties in the repo.
Last hurdle is to apply the FeatureFlags on executing a test, I'll have a look into that tomorrow.
@dannoe Thank you for figuring that out. I'm sorry for being inactive for some time, but I'm currently on a business trip.
@christophstuber I have another use case for your fork of the RoslyTestKit. Would you be okay with me putting your code into its own repository and releasing a nuget package for it?
Created #702 to remove the private false property from the project.
@dannoe Feel free to do so, as long as it remains accessible to everyone. Also maybe mention https://github.com/cezarypiatek/RoslynTestKit as the original source.
I could use some help getting the tests to run manually in VS Code. Probably it's something simple, but somehow I can't find the right solution 🤔
When executing the 'play' button it runs the command dotnet build C:\Users\arthur.vandevondervo\repo\BusinessCentral.LinterCop\BusinessCentral.LinterCop.Test\BusinessCentral.LinterCop.Test.csproj /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary /p:Configuration=Debug /p:Platform="AnyCPU"
Where I somehow want to add an extra parameter for handling the preprocessor directives; /p:FeatureFlags=#Spring2018#Fall2018#Spring2019#Fall2019#Spring2020#Fall2020#Spring2021#Fall2021#Spring2022#Spring2022RV1#Spring2022RV2#Fall2022#Spring2023#Fall2023#Fall2023RV1#Fall2023RV2#Fall2023RV3#Spring2024#Fall2024#Spring2024OrGreater#ManifestHelper#PageSystemAction
Any help on this is appreciated
As I don't use vscode for C# I can't really help here.
What works for me in VS Code is running dotnet test /p:FeatureFlags=#Spring2018#Fall2018#Spring2019#Fall2019#Spring2020#Fall2020#Spring2021#Fall2021#Spring2022#Spring2022RV1#Spring2022RV2#Fall2022#Spring2023#Fall2023#Fall2023RV1#Fall2023RV2#Fall2023RV3#Spring2024#Fall2024#Spring2024OrGreater#ManifestHelper#PageSystemAction
from the terminal.
@dannoe and @christophstuber, thank both of you for the quick response!
The command-line approach indeed works 🤗 I was hoping to have it working with the gui and with debugging functionality, but that will be for somewhere in the future I guess.
I'm probably missing something obvious, but how do I execute the test automation in VS Code? Or do I need to install an additional Test extension?
I've created an clean Windows VM with VS Code version v1.91.0 and these installed extensions
I'm also looking into integrating the test in the pipeline of GitHub, running the tests from the command line doesn't return the expected results.
dotnet test /p:FeatureFlags=#ManifestHelper
@christophstuber Can you share your setup or do you see anything I'm missing here?