Building with Mono doesn't generate files.

#74 · closed · 3 comments

View on GitHub ↗

alexl0gan

Running the XUnit sample with mono, The `dotnet SpecFlow.NetCore` seems to work as expected: ``` dotnet SpecFlow.NetCore Current directory: /Users/alelog01/specflowTest/SpecFlow.NetCore/samples/VS2017/SpecFlow 2.1.0/net461/Sample.Website.Tests.XUnit Found: /Users/alelog01/specflowTest/SpecFlow.NetCore/samples/VS2017/SpecFlow 2.1.0/net461/Sample.Website.Tests.XUnit/Sample.Website.Tests.XUnit.csproj Found: /Users/alelog01/.nuget/packages/specflow/2.1.0/tools/specflow.exe Generating fake csproj. <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <RootNamespace>SpecFlow.GeneratedTests</RootNamespace> <AssemblyName>SpecFlow.GeneratedTests</AssemblyName> </PropertyGroup> <ItemGroup> <None Include="app.config"> <SubType>Designer</SubType> </None> <None Include="Root.feature"> <Generator>SpecFlowSingleFileGenerator</Generator> <LastGenOutput>/Users/alelog01/specflowTest/SpecFlow.NetCore/samples/VS2017/SpecFlow 2.1.0/net461/Sample.Website.Tests.XUnit/Root.feature.cs</LastGenOutput> </None> <None Include="Folder/Folder.feature"> <Generator>SpecFlowSingleFileGenerator</Generator> <LastGenOutput>/Users/alelog01/specflowTest/SpecFlow.NetCore/samples/VS2017/SpecFlow 2.1.0/net461/Sample.Website.Tests.XUnit/Folder/Folder.feature.cs</LastGenOutput> </None> </ItemGroup> </Project> Saving: /Users/alelog01/specflowTest/SpecFlow.NetCore/samples/VS2017/SpecFlow 2.1.0/net461/Sample.Website.Tests.XUnit/Sample.Website.Tests.XUnit.csproj.fake Found xunit in /Users/alelog01/specflowTest/SpecFlow.NetCore/samples/VS2017/SpecFlow 2.1.0/net461/Sample.Website.Tests.XUnit/Sample.Website.Tests.XUnit.csproj Generating app.config <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" /> </configSections> <specFlow> <unitTestProvider name="xunit" /> </specFlow> </configuration> Saving: /Users/alelog01/specflowTest/SpecFlow.NetCore/samples/VS2017/SpecFlow 2.1.0/net461/Sample.Website.Tests.XUnit/app.config Validating app.config. Found xunit in /Users/alelog01/specflowTest/SpecFlow.NetCore/samples/VS2017/SpecFlow 2.1.0/net461/Sample.Website.Tests.XUnit/Sample.Website.Tests.XUnit.csproj Calling: /Users/alelog01/.nuget/packages/specflow/2.1.0/tools/specflow.exe generateall "/Users/alelog01/specflowTest/SpecFlow.NetCore/samples/VS2017/SpecFlow 2.1.0/net461/Sample.Website.Tests.XUnit/Sample.Website.Tests.XUnit.csproj.fake" /force /verbose Removing: /Users/alelog01/specflowTest/SpecFlow.NetCore/samples/VS2017/SpecFlow 2.1.0/net461/Sample.Website.Tests.XUnit/Sample.Website.Tests.XUnit.csproj.fake Fixing SpecFlow generated files New file generated: /Users/alelog01/specflowTest/SpecFlow.NetCore/samples/VS2017/SpecFlow 2.1.0/net461/Sample.Website.Tests.XUnit/Root.feature.cs. No tests in Root.feature will be discovered by 'dotnet test' New file generated: /Users/alelog01/specflowTest/SpecFlow.NetCore/samples/VS2017/SpecFlow 2.1.0/net461/Sample.Website.Tests.XUnit/Folder/Folder.feature.cs. No tests in Folder.feature will be discovered by 'dotnet test' Rebuild to make the above files discoverable, see https://github.com/stajs/SpecFlow.NetCore/issues/22. SpecFlow fixed. ``` However no files are generated. SpecFlow should work with mono so is any further configuration needed to get this to work?

Comments

stajs

I have no experience with mono, so I honestly can't say for sure however I expected it to just work. To clarify, these two lines don't actually produce files on disk? ``` New file generated: /Users/alelog01/specflowTest/SpecFlow.NetCore/samples/VS2017/SpecFlow 2.1.0/net461/Sample.Website.Tests.XUnit/Root.feature.cs. No tests in Root.feature will be discovered by 'dotnet test' New file generated: /Users/alelog01/specflowTest/SpecFlow.NetCore/samples/VS2017/SpecFlow 2.1.0/net461/Sample.Website.Tests.XUnit/Folder/Folder.feature.cs. No tests in Folder.feature will be discovered by 'dotnet test' ``` And you are not hitting this issue? ``` Rebuild to make the above files discoverable, see https://github.com/stajs/SpecFlow.NetCore/issues/22. ```

alexl0gan

I am certain no files are generated. The difference in output between a windows run and mono run is that in windows, the fixing step produces ``` Fixing SpecFlow generated files Fixing: C:\Users\User\specflow\SpecFlow.NetCore\samples\VS2017\SpecFlow 2.1.0\net461\Sample.Website.Tests.XUnit\Root.feature.cs Fixing: C:\Users\User\specflow\SpecFlow.NetCore\samples\VS2017\SpecFlow 2.1.0\net461\Sample.Website.Tests.XUnit\Folder\Folder.feature.cs ``` whereas mono produces ``` Fixing SpecFlow generated files ```

stajs

We call out to SpecFlow to generate their glue files. The SpecFlow team and anecdotal evidence suggest that mono is supported: - https://github.com/techtalk/SpecFlow/wiki/Mono-Support - https://stackoverflow.com/questions/26088821/how-can-i-run-specflow-from-the-command-line-on-mono I would try manually calling the command that we generate: ``` Calling: /Users/alelog01/.nuget/packages/specflow/2.1.0/tools/specflow.exe generateall "/Users/alelog01/specflowTest/SpecFlow.NetCore/samples/VS2017/SpecFlow 2.1.0/net461/Sample.Website.Tests.XUnit/Sample.Website.Tests.XUnit.csproj.fake" /force /verbose ``` If that doesn't work, you'll have to raise an issue with the SpecFlow team. I'll close this issue as there is nothing this project can do.