Skip to content

Commit d6d72cf

Browse files
committed
run netfx test on windows only
1 parent 0cb48d2 commit d6d72cf

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

.github/workflows/build-and-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ jobs:
3434
uses: actions/setup-dotnet@v3
3535
with:
3636
dotnet-version: 6.x.x
37-
- name: Build and test
37+
- name: Build and test (includes netfx)
3838
working-directory: ./
39-
run: ./build.cmd runtests
39+
run: ./build.cmd runtestsnetfx

build/ProjectInfo.fs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,25 @@ let pkgDir = "pkg"
6262
/// binaries are built using this configuration.
6363
let configuration = "Release"
6464

65+
// test projects (.NET)
6566
let CoreTestProject = ProjectInfo.create("Plotly.NET.Tests", "tests/Plotly.NET.Tests/Plotly.NET.Tests.fsproj")
6667
let ImageExportTestProject = ProjectInfo.create("Plotly.NET.ImageExport.Tests", "tests/Plotly.NET.ImageExport.Tests/Plotly.NET.ImageExport.Tests.fsproj")
6768
let CSharpInteroperabilityTestProject = ProjectInfo.create("Plotly.NET.Tests.CSharpInteroperability", "tests/Plotly.NET.Tests.CSharpInteroperability/Plotly.NET.Tests.CSharpInteroperability.csproj")
6869
let CSharpTestProject = ProjectInfo.create("Plotly.NET.CSharp.Tests", "tests/Plotly.NET.CSharp.Tests/Plotly.NET.CSharp.Tests.csproj")
69-
let StrongNameTestProject = ProjectInfo.create("Plotly.NET.Tests.StrongName", "tests/Plotly.NET.Tests.StrongName/Plotly.NET.Tests.StrongName.fsproj")
7070

7171
/// contains project info about all test projects
7272
let testProjects =
7373
[
7474
CoreTestProject
7575
ImageExportTestProject
7676
CSharpTestProject
77+
]
78+
79+
// test projects (.NET framework)
80+
let StrongNameTestProject = ProjectInfo.create("Plotly.NET.Tests.StrongName", "tests/Plotly.NET.Tests.StrongName/Plotly.NET.Tests.StrongName.fsproj")
81+
82+
let testProjectsNetFX =
83+
[
7784
StrongNameTestProject
7885
]
7986

build/TestTasks.fs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ let buildTests = BuildTask.create "BuildTests" [clean; build] {
1818
)
1919
}
2020

21+
let buildTestsNetFX = BuildTask.create "BuildTestsNetFX" [clean; build] {
22+
testProjectsNetFX
23+
|> List.iter (fun pInfo ->
24+
let proj = pInfo.ProjFile
25+
proj
26+
|> DotNet.build (fun p ->
27+
p
28+
|> DotNet.Options.withCustomParams (Some "--no-dependencies")
29+
)
30+
)
31+
}
32+
2133
/// runs the individual test projects via `dotnet test`
2234
let runTests =
2335
BuildTask.create "RunTests" [ clean; build; buildTests ] {
@@ -33,6 +45,22 @@ let runTests =
3345
testProjectInfo.ProjFile)
3446
}
3547

48+
/// runs the individual test projects via `dotnet test`
49+
let runTestsWithNetFX =
50+
BuildTask.create "RunTestsNetFX" [ clean; build; buildTests; buildTestsNetFX] {
51+
testProjects
52+
@ testProjectsNetFX
53+
|> Seq.iter (fun testProjectInfo ->
54+
Fake.DotNet.DotNet.test
55+
(fun testParams ->
56+
{ testParams with
57+
Logger = Some "console;verbosity=detailed"
58+
Configuration = DotNet.BuildConfiguration.fromString configuration
59+
NoBuild = true
60+
})
61+
testProjectInfo.ProjFile)
62+
}
63+
3664
// to do: use this once we have actual tests
3765
let runTestsWithCodeCov =
3866
BuildTask.create "RunTestsWithCodeCov" [ clean; build ] {

0 commit comments

Comments
 (0)