Skip to content

Commit c1f65d9

Browse files
Copilotxperiandri
andauthored
Migrate integration tests to in-process hosts via WebApplicationFactory and remove external server orchestration from build
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Data.GraphQL/sessions/af990f0d-81e6-406b-b157-008ad1f734f1 Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
1 parent 09ddc53 commit c1f65d9

9 files changed

Lines changed: 2046 additions & 87 deletions

Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
<PackageReference Update="GraphQL.Server.Ui.Voyager" Version="8.*" />
7777
<PackageReference Update="HotChocolate.AspNetCore" Version="15.*" />
7878
<PackageReference Update="Iced" Version="1.17.*" />
79+
<PackageReference Update="Microsoft.AspNetCore.Mvc.Testing" Version="$(AspNetCoreVersion)" />
7980
<PackageReference Update="Microsoft.Azure.Cosmos" Version="3.*" />
8081
<PackageReference Update="Microsoft.CodeCoverage" Version="17.3.*" />
8182
<PackageReference Update="Microsoft.Data.Sqlite" Version="$(MicrosoftExtensionsVersion)" />

build/Program.fs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,6 @@ Target.create "PackAndPush" ignore
406406
==> RestoreTarget
407407
==> BuildTarget
408408
==> RunUnitTestsTarget
409-
==> StartStarWarsServerTarget
410-
==> BuildIntegrationTestServerTarget
411-
==> StartIntegrationServerTarget
412-
==> UpdateIntrospectionFileTarget
413409
==> BuildIntegrationTestsTarget
414410
==> RunIntegrationTestsTarget
415411
==> "All"

tests/FSharp.Data.GraphQL.IntegrationTests/FSharp.Data.GraphQL.IntegrationTests.fsproj

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
1011
<PackageReference Include="Microsoft.Extensions.Http" />
1112
<PackageReference Include="Microsoft.NET.Test.Sdk" />
1213
<PackageReference Include="xunit" />
@@ -15,30 +16,37 @@
1516

1617
<ItemGroup>
1718
<Content Include="introspection.json" />
19+
<Content Include="integration-introspection.json" />
1820
<Content Include="reserved_scalar_input_date_introspection.json" />
1921
<Content Include="reserved_scalar_object_date_introspection.json" />
2022
<None Include="operation.graphql">
2123
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2224
</None>
2325
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
2426
<Compile Include="Helpers.fs" />
27+
<Compile Include="TestHosts.fs" />
2528
<Compile Include="ReservedScalarNameProviderTests.fs" />
2629
<Compile Include="LocalProviderTests.fs" />
2730
<Compile Include="LocalProviderWithOptionalParametersOnlyTests.fs" />
2831
<Compile Include="SwapiLocalProviderTests.fs" />
2932
<Compile Include="SwapiRemoteProviderTests.fs" />
3033
</ItemGroup>
3134

35+
<ItemGroup>
36+
<ProjectReference Include="..\FSharp.Data.GraphQL.IntegrationTests.Server\FSharp.Data.GraphQL.IntegrationTests.Server.fsproj" />
37+
<ProjectReference Include="..\..\samples\star-wars-api\star-wars-api.fsproj" />
38+
</ItemGroup>
39+
3240
<ItemGroup>
3341
<Reference Include="FSharp.Data.GraphQL.Client">
3442
<HintPath Condition="Exists('..\..\src\FSharp.Data.GraphQL.Client\bin\Debug\netstandard2.0\FSharp.Data.GraphQL.Client.dll')">..\..\src\FSharp.Data.GraphQL.Client\bin\Debug\netstandard2.0\FSharp.Data.GraphQL.Client.dll</HintPath>
3543
<HintPath Condition="Exists('..\..\src\FSharp.Data.GraphQL.Client\bin\Release\netstandard2.0\FSharp.Data.GraphQL.Client.dll')">..\..\src\FSharp.Data.GraphQL.Client\bin\Release\netstandard2.0\FSharp.Data.GraphQL.Client.dll</HintPath>
3644
<HintPath Condition="Exists('..\..\bin\FSharp.Data.GraphQL.Client\netstandard2.0\FSharp.Data.GraphQL.Client.dll')">..\..\bin\FSharp.Data.GraphQL.Client\netstandard2.0\FSharp.Data.GraphQL.Client.dll</HintPath>
3745
</Reference>
3846
<Reference Include="FSharp.Data.GraphQL.Shared">
39-
<HintPath Condition="Exists('..\..\src\FSharp.Data.GraphQL.Client\bin\Debug\netstandard2.0\FSharp.Data.GraphQL.Shared.dll')">..\..\src\FSharp.Data.GraphQL.Client\bin\Debug\netstandard2.0\FSharp.Data.GraphQL.Shared.dll</HintPath>
40-
<HintPath Condition="Exists('..\..\src\FSharp.Data.GraphQL.Client\bin\Release\netstandard2.0\FSharp.Data.GraphQL.Shared.dll')">..\..\src\FSharp.Data.GraphQL.Client\bin\Release\netstandard2.0\FSharp.Data.GraphQL.Shared.dll</HintPath>
41-
<HintPath Condition="Exists('..\..\bin\FSharp.Data.GraphQL.Client\netstandard2.0\FSharp.Data.GraphQL.Shared.dll')">..\..\bin\FSharp.Data.GraphQL.Client\netstandard2.0\FSharp.Data.GraphQL.Shared.dll</HintPath>
47+
<HintPath Condition="Exists('..\..\src\FSharp.Data.GraphQL.Shared\bin\Debug\net10.0\FSharp.Data.GraphQL.Shared.dll')">..\..\src\FSharp.Data.GraphQL.Shared\bin\Debug\net10.0\FSharp.Data.GraphQL.Shared.dll</HintPath>
48+
<HintPath Condition="Exists('..\..\src\FSharp.Data.GraphQL.Shared\bin\Release\net10.0\FSharp.Data.GraphQL.Shared.dll')">..\..\src\FSharp.Data.GraphQL.Shared\bin\Release\net10.0\FSharp.Data.GraphQL.Shared.dll</HintPath>
49+
<HintPath Condition="Exists('..\..\bin\FSharp.Data.GraphQL.Shared\net10.0\FSharp.Data.GraphQL.Shared.dll')">..\..\bin\FSharp.Data.GraphQL.Shared\net10.0\FSharp.Data.GraphQL.Shared.dll</HintPath>
4250
</Reference>
4351
</ItemGroup>
4452
</Project>

tests/FSharp.Data.GraphQL.IntegrationTests/LocalProviderTests.fs

Lines changed: 38 additions & 34 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)