From 6dd2fde7346c442e278863313eebbcbd21861298 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sat, 6 Sep 2025 09:16:02 +0000
Subject: [PATCH 1/4] Initial plan
From 6dbb5da8b941af17a565eff2e822a0e6def30d47 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sat, 6 Sep 2025 09:19:44 +0000
Subject: [PATCH 2/4] Initial analysis of CI issues
Co-authored-by: Thorium <229355+Thorium@users.noreply.github.com>
---
.paket/Paket.Restore.targets | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/.paket/Paket.Restore.targets b/.paket/Paket.Restore.targets
index 17aeb635..bbeec153 100644
--- a/.paket/Paket.Restore.targets
+++ b/.paket/Paket.Restore.targets
@@ -235,15 +235,14 @@
$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length)
$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])
$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])
- $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[2])
$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])
$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])
$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[6])
$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[7])
$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[8])
-
- %(PaketReferencesFileLinesInfo.PackageVersion)
+
+ %(PaketReferencesFileLinesInfo.PackageVersion)
All
runtime
$(ExcludeAssets);contentFiles
@@ -253,10 +252,6 @@
true
-
-
- %(PaketReferencesFileLinesInfo.PackageVersion)
-
From 1ad10b730353dcdf791b0ea8546a73f9e3ec0968 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sat, 6 Sep 2025 09:21:41 +0000
Subject: [PATCH 3/4] Update AppVeyor configuration for SQL Server 2022
Co-authored-by: Thorium <229355+Thorium@users.noreply.github.com>
---
appveyor.yml | 4 ++--
build.fsx | 4 ++--
tests/SqlProvider.Tests/SqlServerTests.fs | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/appveyor.yml b/appveyor.yml
index e458529f..1ba52765 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -5,8 +5,8 @@ build_script:
test: off
version: 0.0.1.{build}
image: Visual Studio 2022
-install:
- - cmd: choco install dotnetcore-sdk -y
+services:
+ - mssql2022
artifacts:
- path: bin
name: bin
diff --git a/build.fsx b/build.fsx
index 89ea5686..81bb3e8a 100644
--- a/build.fsx
+++ b/build.fsx
@@ -330,11 +330,11 @@ let setupMssql url saPassword =
(url,saPassword) |> ignore
Target.create "SetupMSSQL2008R2" (fun _ ->
- setupMssql "(local)\\SQL2008R2SP2" "Password12!"
+ setupMssql "(local)\\SQL2022" "Password12!"
)
Target.create "SetupMSSQL2017" (fun _ ->
- setupMssql "(local)\\SQL2017" "Password12!"
+ setupMssql "(local)\\SQL2022" "Password12!"
)
diff --git a/tests/SqlProvider.Tests/SqlServerTests.fs b/tests/SqlProvider.Tests/SqlServerTests.fs
index fc81c9c8..2ce6e9c0 100644
--- a/tests/SqlProvider.Tests/SqlServerTests.fs
+++ b/tests/SqlProvider.Tests/SqlServerTests.fs
@@ -12,8 +12,8 @@ let runtimeConnStr = connStr2008R2
#else
module SqlServerTests
-let [] connStr2008R2 = "Data Source=(local)\SQL2008R2SP2;User Id=sa;Password=Password12!; Initial Catalog=sqlprovider;"
-let [] connStr2017 = "Data Source=(local)\SQL2017;User Id=sa;Password=Password12!; Initial Catalog=sqlprovider;"
+let [] connStr2008R2 = "Data Source=(local)\SQL2022;User Id=sa;Password=Password12!; Initial Catalog=sqlprovider;"
+let [] connStr2017 = "Data Source=(local)\SQL2022;User Id=sa;Password=Password12!; Initial Catalog=sqlprovider;"
#endif
From 4373c57bde6d31a0131631025bcfa88b00cbfe62 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sat, 6 Sep 2025 09:23:20 +0000
Subject: [PATCH 4/4] Improve SQL Server setup reliability and add GitHub
Actions workflow
Co-authored-by: Thorium <229355+Thorium@users.noreply.github.com>
---
.github/workflows/dotnet.yml | 46 +++++++++++++++++++++++
build.fsx | 18 ++++++---
tests/SqlProvider.Tests/SqlServerTests.fs | 4 +-
3 files changed, 61 insertions(+), 7 deletions(-)
create mode 100644 .github/workflows/dotnet.yml
diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
new file mode 100644
index 00000000..9c0cd5a8
--- /dev/null
+++ b/.github/workflows/dotnet.yml
@@ -0,0 +1,46 @@
+name: .NET
+
+on:
+ push:
+ branches: [ "master" ]
+ pull_request:
+ branches: [ "master" ]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ services:
+ postgres:
+ image: postgres:13
+ env:
+ POSTGRES_PASSWORD: Password12!
+ POSTGRES_USER: postgres
+ POSTGRES_DB: sqlprovider
+ options: >-
+ --health-cmd pg_isready
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
+ ports:
+ - 5432:5432
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: 8.0.x
+
+ - name: Restore tools
+ run: dotnet tool restore
+
+ - name: Restore dependencies
+ run: dotnet paket restore
+
+ - name: Build
+ run: dotnet fake run build.fsx -t Build
+
+ - name: Test
+ run: dotnet fake run build.fsx -t RunTests
\ No newline at end of file
diff --git a/build.fsx b/build.fsx
index 81bb3e8a..5051eaed 100644
--- a/build.fsx
+++ b/build.fsx
@@ -285,9 +285,11 @@ let setupMssql url saPassword =
connBuilder.UserID <- "sa"
connBuilder.DataSource <- url
connBuilder.Password <- saPassword
+ connBuilder.TrustServerCertificate <- true
let runCmd query =
- // We wait up to 30 seconds for MSSQL to be initialized
+ // We wait up to 60 seconds for MSSQL to be initialized on AppVeyor
+ let maxAttempts = if Fake.Core.BuildServer.buildServer = AppVeyor then 60 else 30
let rec runCmd' attempt =
try
use conn = new SqlConnection(connBuilder.ConnectionString)
@@ -295,11 +297,15 @@ let setupMssql url saPassword =
use cmd = new SqlCommand(query, conn)
cmd.ExecuteNonQuery() |> ignore
with e ->
- printfn "Connection attempt %i: %A" attempt e
- Threading.Thread.Sleep 1000
- if attempt < 30 then runCmd' (attempt + 1)
+ printfn "Connection attempt %i/%i: %A" attempt maxAttempts e
+ if attempt < maxAttempts then
+ Threading.Thread.Sleep 1000
+ runCmd' (attempt + 1)
+ else
+ printfn "Failed to connect to SQL Server after %i attempts. Last error: %A" maxAttempts e
+ reraise()
- runCmd' 0
+ runCmd' 1
let runScript fileLines =
@@ -330,10 +336,12 @@ let setupMssql url saPassword =
(url,saPassword) |> ignore
Target.create "SetupMSSQL2008R2" (fun _ ->
+ printfn "Setting up MSSQL for AppVeyor (compatibility target for SQL2008R2)"
setupMssql "(local)\\SQL2022" "Password12!"
)
Target.create "SetupMSSQL2017" (fun _ ->
+ printfn "Setting up MSSQL for AppVeyor (compatibility target for SQL2017)"
setupMssql "(local)\\SQL2022" "Password12!"
)
diff --git a/tests/SqlProvider.Tests/SqlServerTests.fs b/tests/SqlProvider.Tests/SqlServerTests.fs
index 2ce6e9c0..7e3995ed 100644
--- a/tests/SqlProvider.Tests/SqlServerTests.fs
+++ b/tests/SqlProvider.Tests/SqlServerTests.fs
@@ -12,8 +12,8 @@ let runtimeConnStr = connStr2008R2
#else
module SqlServerTests
-let [] connStr2008R2 = "Data Source=(local)\SQL2022;User Id=sa;Password=Password12!; Initial Catalog=sqlprovider;"
-let [] connStr2017 = "Data Source=(local)\SQL2022;User Id=sa;Password=Password12!; Initial Catalog=sqlprovider;"
+let [] connStr2008R2 = "Data Source=(local)\SQL2022;User Id=sa;Password=Password12!; Initial Catalog=sqlprovider; TrustServerCertificate=true;"
+let [] connStr2017 = "Data Source=(local)\SQL2022;User Id=sa;Password=Password12!; Initial Catalog=sqlprovider; TrustServerCertificate=true;"
#endif