@@ -2,8 +2,6 @@ module Program
22
33open System
44open System.IO
5- open System.Net .Http
6- open System.Text .Json
75
86open Fake.Core
97open Fake.Core .TargetOperators
@@ -123,26 +121,6 @@ let runTests (project : string) (args : string) =
123121 |> _. WithCommon( DotNetCli.setVersion))
124122 project
125123
126- let starWarsServerStream = StreamRef.Empty
127-
128- let [<Literal>] StartStarWarsServerTarget = " StartStarWarsServer"
129- Target.create StartStarWarsServerTarget <| fun _ ->
130- Target.activateFinal " StopStarWarsServer"
131-
132- let project =
133- " samples"
134- </> " star-wars-api"
135- </> " star-wars-api.fsproj"
136-
137- startGraphQLServer project 8086 starWarsServerStream
138-
139- let [<Literal>] StopStarWarsServerTarget = " StopStarWarsServer"
140- Target.createFinal StopStarWarsServerTarget <| fun _ ->
141- try
142- starWarsServerStream.Value.Write ([| 0 uy |], 0 , 1 )
143- with e ->
144- printfn " %s " e.Message
145-
146124let integrationTestServerProjectPath =
147125 " tests"
148126 </> " FSharp.Data.GraphQL.IntegrationTests.Server"
@@ -179,58 +157,35 @@ Target.createFinal StopIntegrationServerTarget <| fun _ ->
179157 with e ->
180158 printfn " %s " e.Message
181159
182- let [<Literal>] UpdateIntrospectionFileTarget = " UpdateIntrospectionFile"
183- Target.create UpdateIntrospectionFileTarget <| fun _ ->
184- let client = new HttpClient ()
185- ( task {
186- let! result = client.GetAsync ( " http://localhost:8086" )
187- let! contentStream = result.Content.ReadAsStreamAsync ()
188- let! jsonDocument = JsonDocument.ParseAsync contentStream
189- let file =
190- new FileStream ( " tests/FSharp.Data.GraphQL.IntegrationTests/introspection.json" , FileMode.Create, FileAccess.Write, FileShare.None)
191- let encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping
192- let jsonWriterOptions = JsonWriterOptions ( Indented = true , Encoder = encoder)
193- let writer = new Utf8JsonWriter ( file, jsonWriterOptions)
194- jsonDocument.WriteTo writer
195- do ! writer.FlushAsync ()
196- do ! writer.DisposeAsync ()
197- do ! file.DisposeAsync ()
198- result.Dispose ()
199- })
200- .Wait ()
201- client.Dispose ()
202-
203- let unitTestsProjectPath =
204- " tests"
205- </> " FSharp.Data.GraphQL.Tests"
206- </> " FSharp.Data.GraphQL.Tests.fsproj"
207-
208160let integrationTestsProjectPath =
209161 " tests"
210162 </> " FSharp.Data.GraphQL.IntegrationTests"
211163 </> " FSharp.Data.GraphQL.IntegrationTests.fsproj"
212164
213- let [<Literal>] BuildIntegrationTestsTarget = " BuildIntegrationTests "
214- Target.create BuildIntegrationTestsTarget <| fun _ ->
165+ let [<Literal>] UpdateIntrospectionFileTarget = " UpdateIntrospectionFile "
166+ Target.create UpdateIntrospectionFileTarget <| fun _ ->
215167 integrationTestsProjectPath
216- |> DotNet.build ( fun options -> {
168+ |> DotNet.test ( fun options -> {
217169 options with
170+ Framework = Some DotNetMoniker
218171 Configuration = configuration
172+ Common = { DotNetCli.setVersion options.Common with CustomParams = Some " --filter FullyQualifiedName~IntrospectionUpdateTests" }
219173 MSBuildParams = {
220174 options.MSBuildParams with
221175 DisableInternalBinLog = true
176+ Verbosity = Some Normal
222177 }
223- Common = DotNetCli.setVersion options.Common
224178 })
225179
180+ let unitTestsProjectPath =
181+ " tests"
182+ </> " FSharp.Data.GraphQL.Tests"
183+ </> " FSharp.Data.GraphQL.Tests.fsproj"
184+
226185let [<Literal>] RunUnitTestsTarget = " RunUnitTests"
227186Target.create RunUnitTestsTarget <| fun _ ->
228187 runTests unitTestsProjectPath " "
229188
230- let [<Literal>] RunIntegrationTestsTarget = " RunIntegrationTests"
231- Target.create RunIntegrationTestsTarget <| fun _ ->
232- runTests integrationTestsProjectPath " " //"--filter Execution=Sync"
233-
234189let prepareDocGen () =
235190 Shell.rm " docs/release-notes.md"
236191 Shell.cp " RELEASE_NOTES.md" " docs/RELEASE_NOTES.md"
@@ -406,12 +361,7 @@ Target.create "PackAndPush" ignore
406361==> RestoreTarget
407362==> BuildTarget
408363==> RunUnitTestsTarget
409- ==> StartStarWarsServerTarget
410- ==> BuildIntegrationTestServerTarget
411- ==> StartIntegrationServerTarget
412364==> UpdateIntrospectionFileTarget
413- ==> BuildIntegrationTestsTarget
414- ==> RunIntegrationTestsTarget
415365==> " All"
416366=?> ( GenerateDocsTarget, Environment.environVar " GITHUB_ACTIONS" = " True" )
417367|> ignore
0 commit comments