Skip to content

Commit

Permalink
Produce __test\results.xml file. Fixes bchavez#337.
Browse files Browse the repository at this point in the history
Update F# FAKE lock file and fake-cli tool.
  • Loading branch information
bchavez committed Nov 29, 2020
1 parent bb3d656 commit 5219e22
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 388 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"fake-cli": {
"version": "5.20.2",
"version": "5.20.3",
"commands": [
"fake"
]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ The minimum requirements to build **Bogus** from source code are as follows:
* `build nuget` - builds **NuGet** packages.
* `build test` - runs all unit tests.

Upon a successful build, the following folders will be created:
The following folders will be created depending on the build task executed:
* `\__compile` - binary output folder for the compiler.
* `\__package` - output folder for zip and **NuGet** packages.
* `\__test` - test results folder.
Expand Down
82 changes: 8 additions & 74 deletions Source/Builder/Builder.fsproj
Original file line number Diff line number Diff line change
@@ -1,78 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>2e878ddf-5585-48f2-85e0-748579278c9a</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Builder2</RootNamespace>
<AssemblyName>Builder2</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFSharpCoreVersion>4.4.0.0</TargetFSharpCoreVersion>
<Name>Builder</Name>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<DocumentationFile>bin\Debug\Builder2.XML</DocumentationFile>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<DocumentationFile>bin\Release\Builder2.XML</DocumentationFile>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '11.0'">
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" />
<ItemGroup>
<None Include="build.fsx" />
<None Include="Utils.fsx" />
<Content Include="gulpfile.js" />
<None Include="package.json" />
</ItemGroup>

<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Compile Include="build.fsx" />
<Compile Include="Utils.fsx" />
</ItemGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

</Project>
3 changes: 3 additions & 0 deletions Source/Builder/Utils.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ module BuildContext =
let IsTaggedBuild =
Fake.BuildServer.AppVeyor.Environment.RepoTag

let InAppVeyor =
Environment.environVarAsBoolOrDefault "APPVEYOR" false


open System
open System.IO
Expand Down
18 changes: 13 additions & 5 deletions Source/Builder/build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ nuget Fake.DotNet.Testing.xUnit2
nuget Fake.BuildServer.AppVeyor
nuget SharpCompress = 0.22.0
nuget FSharp.Data = 2.4.6
nuget FSharp.Data
nuget secure-file = 1.0.31
Expand Down Expand Up @@ -203,10 +203,18 @@ Target.create "Clean" (fun _ ->

open Fake.DotNet.Testing

let RunTests() =
let RunTests(isManualTest : bool) =
let config (opts: DotNet.TestOptions) =
let logArg = if isManualTest then
let path = sprintf "xunit;LogFilePath=%s" Files.TestResultFile
Some path
else
None

{opts with
NoBuild = true }
NoBuild = true
Logger = logArg }

DotNet.test config TestProject.Folder

open Fake.BuildServer
Expand All @@ -218,13 +226,13 @@ Target.create "ci" (fun _ ->
Target.description "PROJECT TEST TASK"
Target.create "test" (fun _ ->
Trace.trace "TEST"
RunTests()
RunTests(true)
)

Target.description "CI TEST TASK"
Target.create "citest" (fun _ ->
Trace.trace "CI TEST"
RunTests()
RunTests(false)

//Files.TestResultFile
//|> Trace.publish( ImportData.Xunit )
Expand Down
Loading

0 comments on commit 5219e22

Please sign in to comment.