From 65a55aae03d34a84fd615872ce6033d889cae98c Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Fri, 1 Dec 2023 18:56:20 +0100 Subject: [PATCH 1/6] cleanup: delete xunit test output from the repository --- .../SqlClient.DesignTime.Tests.dll.html | 57 --- .../SqlClient.DesignTime.Tests.dll.xml | 1 - .../SqlClient.SqlServerTypes.Tests.dll.html | 81 ---- .../SqlClient.SqlServerTypes.Tests.dll.xml | 9 - .../SqlClient.Tests/SqlClient.Tests.dll.html | 425 ------------------ tests/SqlClient.Tests/SqlClient.Tests.dll.xml | 2 - 6 files changed, 575 deletions(-) delete mode 100644 tests/SqlClient.Tests/SqlClient.DesignTime.Tests.dll.html delete mode 100644 tests/SqlClient.Tests/SqlClient.DesignTime.Tests.dll.xml delete mode 100644 tests/SqlClient.Tests/SqlClient.SqlServerTypes.Tests.dll.html delete mode 100644 tests/SqlClient.Tests/SqlClient.SqlServerTypes.Tests.dll.xml delete mode 100644 tests/SqlClient.Tests/SqlClient.Tests.dll.html delete mode 100644 tests/SqlClient.Tests/SqlClient.Tests.dll.xml diff --git a/tests/SqlClient.Tests/SqlClient.DesignTime.Tests.dll.html b/tests/SqlClient.Tests/SqlClient.DesignTime.Tests.dll.html deleted file mode 100644 index 44980055..00000000 --- a/tests/SqlClient.Tests/SqlClient.DesignTime.Tests.dll.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - xUnit.net Test Results - - - -

Assemblies Run

-
c:\code\FSharp.Data.SqlClient\src\SqlClient.Tests\SqlClient.DesignTime.Tests\bin\Release\net461\SqlClient.DesignTime.Tests.dll
-

Summary

-
- Tests run: 3   - Failures: 0, - Skipped: 0, - Run time: 0.439s

All tests

-
Click test class name to expand/collapse test details
-

0.439s -  DesignTimeConnectionStringTests -  (3 tests)

- - - \ No newline at end of file diff --git a/tests/SqlClient.Tests/SqlClient.DesignTime.Tests.dll.xml b/tests/SqlClient.Tests/SqlClient.DesignTime.Tests.dll.xml deleted file mode 100644 index 9ba41699..00000000 --- a/tests/SqlClient.Tests/SqlClient.DesignTime.Tests.dll.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/tests/SqlClient.Tests/SqlClient.SqlServerTypes.Tests.dll.html b/tests/SqlClient.Tests/SqlClient.SqlServerTypes.Tests.dll.html deleted file mode 100644 index 2f3eff91..00000000 --- a/tests/SqlClient.Tests/SqlClient.SqlServerTypes.Tests.dll.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - xUnit.net Test Results - - - -

Assemblies Run

-
c:\code\FSharp.Data.SqlClient\src\SqlClient.Tests\SqlClient.SqlServerTypes.Tests\bin\Release\net461\SqlClient.SqlServerTypes.Tests.dll
-

Summary

-
- Tests run: 3   - Failures: 2, - Skipped: 0, - Run time: 0.25s

Failed tests

-
0.007s -  FSharp.Data.SpatialTypesTests.spatialTypes : System.IO.FileLoadException : Could not load file or assembly 'FSharp.Core, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
-   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
-   at System.Type.GetType(String typeName, Boolean throwOnError)
-   at FSharp.Data.ISqlCommand Implementation..ctor(DesignTimeConfig cfg, FSharpChoice`3 connection, Int32 commandTimeout)
-   at FSharp.Data.SpatialTypesTests.spatialTypes()
-
-
0.225s -  FSharp.Data.SpatialTypesTests.SqlHierarchyIdParam : System.IO.FileLoadException : Could not load file or assembly 'FSharp.Core, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
-   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
-   at System.Type.GetType(String typeName, Boolean throwOnError)
-   at FSharp.Data.ISqlCommand Implementation..ctor(DesignTimeConfig cfg, FSharpChoice`3 connection, Int32 commandTimeout)
-   at FSharp.Data.SpatialTypesTests.SqlHierarchyIdParam()
-

All tests

-
Click test class name to expand/collapse test details
-

0.250s -  FSharp.Data.SpatialTypesTests -  (3 tests)

-
-
0.018s -  FSharp.Data.SpatialTypesTests.GEOMETRY and GEOGRAPHY sp params
-
0.007s -  FSharp.Data.SpatialTypesTests.spatialTypes : System.IO.FileLoadException : Could not load file or assembly 'FSharp.Core, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
-   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
-   at System.Type.GetType(String typeName, Boolean throwOnError)
-   at FSharp.Data.ISqlCommand Implementation..ctor(DesignTimeConfig cfg, FSharpChoice`3 connection, Int32 commandTimeout)
-   at FSharp.Data.SpatialTypesTests.spatialTypes()
-
-
0.225s -  FSharp.Data.SpatialTypesTests.SqlHierarchyIdParam : System.IO.FileLoadException : Could not load file or assembly 'FSharp.Core, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
-   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
-   at System.Type.GetType(String typeName, Boolean throwOnError)
-   at FSharp.Data.ISqlCommand Implementation..ctor(DesignTimeConfig cfg, FSharpChoice`3 connection, Int32 commandTimeout)
-   at FSharp.Data.SpatialTypesTests.SqlHierarchyIdParam()
-
-
- - \ No newline at end of file diff --git a/tests/SqlClient.Tests/SqlClient.SqlServerTypes.Tests.dll.xml b/tests/SqlClient.Tests/SqlClient.SqlServerTypes.Tests.dll.xml deleted file mode 100644 index 447cd6c8..00000000 --- a/tests/SqlClient.Tests/SqlClient.SqlServerTypes.Tests.dll.xml +++ /dev/null @@ -1,9 +0,0 @@ -System.IO.FileLoadException : Could not load file or assembly 'FSharp.Core, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) - at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) - at System.Type.GetType(String typeName, Boolean throwOnError) - at FSharp.Data.ISqlCommand Implementation..ctor(DesignTimeConfig cfg, FSharpChoice`3 connection, Int32 commandTimeout) - at FSharp.Data.SpatialTypesTests.SqlHierarchyIdParam()System.IO.FileLoadException : Could not load file or assembly 'FSharp.Core, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) - at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) - at System.Type.GetType(String typeName, Boolean throwOnError) - at FSharp.Data.ISqlCommand Implementation..ctor(DesignTimeConfig cfg, FSharpChoice`3 connection, Int32 commandTimeout) - at FSharp.Data.SpatialTypesTests.spatialTypes() \ No newline at end of file diff --git a/tests/SqlClient.Tests/SqlClient.Tests.dll.html b/tests/SqlClient.Tests/SqlClient.Tests.dll.html deleted file mode 100644 index 5904b774..00000000 --- a/tests/SqlClient.Tests/SqlClient.Tests.dll.html +++ /dev/null @@ -1,425 +0,0 @@ - - - - - xUnit.net Test Results - - - -

Assemblies Run

-
c:\code\FSharp.Data.SqlClient\src\SqlClient.Tests\bin\Release\net461\SqlClient.Tests.dll
-

Summary

-
- Tests run: 144   - Failures: 0, - Skipped: 4, - Run time: 2.944s

Skipped tests

-
Skipped -  FSharp.Data.TVPTests.InputIsEnumeratedExactlyOnce : Flucky
-
Skipped -  FSharp.Data.TVPTests.UsingTVPInQuery : Fails at runtime :(
-
Skipped -  FSharp.Data.TypeProviderTest.CommandTimeout : Don't execute for usual runs. Too slow.
-
Skipped -  FSharp.Data.TypeProviderTest.ConcurrentReaders : Thread safe execution is not supported yet

All tests

-
Click test class name to expand/collapse test details
-

0.267s -  FSharp.Data.CreateCommandTest -  (13 tests)

- -

1.187s -  FSharp.Data.DataTablesTests -  (24 tests)

- -

0.374s -  FSharp.Data.DynamicRecordTests -  (11 tests)

- -

0.038s -  FSharp.Data.EnumTests -  (9 tests)

- -

0.020s -  FSharp.Data.OptionalParamsTests -  (4 tests)

- -

0.343s -  FSharp.Data.ProgrammabilityTest -  (18 tests)

- -

0.006s -  FSharp.Data.ResultTypeTests -  (1 test)

- -

0.034s -  FSharp.Data.SpReturnValueTests -  (4 tests)

- -

0.008s -  FSharp.Data.SqlClient.ConfigurationTests -  (1 test)

- -

0.127s -  FSharp.Data.SynonymsTests -  (3 tests)

- -

0.049s -  FSharp.Data.TempTableTests -  (3 tests)

- -

0.028s -  FSharp.Data.The undeclared parameter 'X' is used more than once in the batch being analyzed -  (4 tests)

- -

0.124s -  FSharp.Data.TransactionTests -  (12 tests)

- -

0.069s -  FSharp.Data.TVPTests -  (12 tests)

- -

0.177s -  FSharp.Data.TypeProviderTest -  (20 tests)

- -

0.093s -  FSharp.Data.UnitsOfMeasure -  (5 tests)

- - - \ No newline at end of file diff --git a/tests/SqlClient.Tests/SqlClient.Tests.dll.xml b/tests/SqlClient.Tests/SqlClient.Tests.dll.xml deleted file mode 100644 index 82fcfe65..00000000 --- a/tests/SqlClient.Tests/SqlClient.Tests.dll.xml +++ /dev/null @@ -1,2 +0,0 @@ -FluckyData Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True -Fails at runtime :(Thread safe execution is not supported yetDon't execute for usual runs. Too slow. \ No newline at end of file From 5e6e213c9f320d8fcb884b80c1d8da95ee254285 Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Fri, 1 Dec 2023 20:24:54 +0100 Subject: [PATCH 2/6] adjust all tests to be under FSharp.Data.SqlClient.Tests namespace, removing all the conditional about "legacy namespace" support in context of tests. --- .../SqlClient.DesignTime.Tests.fsproj | 1 - .../SpatialTypesTests.fs | 8 ++------ .../SqlClient.SqlServerTypes.Tests.fsproj | 1 - tests/SqlClient.Tests/ConfigurationTest.fs | 4 +++- tests/SqlClient.Tests/ConnectionStrings.fs | 2 +- tests/SqlClient.Tests/CreateCommand.fs | 8 +++++--- tests/SqlClient.Tests/DataTablesTests.fs | 3 ++- tests/SqlClient.Tests/DynamicRecordTests.fs | 2 +- tests/SqlClient.Tests/FreeVarDoubleDeclTests.fs | 8 +++----- tests/SqlClient.Tests/OptionalParamsTests.fs | 10 ++++------ tests/SqlClient.Tests/ProgrammabilityTests.fs | 8 +++----- tests/SqlClient.Tests/ResultTypeTests.fs | 8 +++----- tests/SqlClient.Tests/SpReturnValueTests.fs | 8 +++----- tests/SqlClient.Tests/SqlEnumTests.fs | 13 ++++++------- tests/SqlClient.Tests/SynonymsTests.fs | 5 ++++- tests/SqlClient.Tests/TVPTests.fs | 8 +++----- tests/SqlClient.Tests/TempTableTests.fs | 7 ++----- tests/SqlClient.Tests/TransactionTests.fs | 6 ++++-- tests/SqlClient.Tests/TypeProviderTest.fs | 10 ++++------ tests/SqlClient.Tests/UnitsOfMeasure.fs | 8 +++++--- 20 files changed, 58 insertions(+), 70 deletions(-) diff --git a/tests/SqlClient.DesignTime.Tests/SqlClient.DesignTime.Tests.fsproj b/tests/SqlClient.DesignTime.Tests/SqlClient.DesignTime.Tests.fsproj index 2e0a8487..60381fde 100644 --- a/tests/SqlClient.DesignTime.Tests/SqlClient.DesignTime.Tests.fsproj +++ b/tests/SqlClient.DesignTime.Tests/SqlClient.DesignTime.Tests.fsproj @@ -8,7 +8,6 @@ false true 101 - $(DefineConstants);WITH_LEGACY_NAMESPACE diff --git a/tests/SqlClient.SqlServerTypes.Tests/SpatialTypesTests.fs b/tests/SqlClient.SqlServerTypes.Tests/SpatialTypesTests.fs index abb339c5..d880bbfd 100644 --- a/tests/SqlClient.SqlServerTypes.Tests/SpatialTypesTests.fs +++ b/tests/SqlClient.SqlServerTypes.Tests/SpatialTypesTests.fs @@ -1,10 +1,6 @@ -#if WITH_LEGACY_NAMESPACE -module FSharp.Data.SpatialTypesTests -open FSharp.Data.SqlClient -#else -module FSharp.Data.SqlClient.SpatialTypesTests -#endif +module FSharp.Data.SqlClient.Tests.SpatialTypesTests +open FSharp.Data open Xunit open Microsoft.SqlServer.Types open System.Data.SqlTypes diff --git a/tests/SqlClient.SqlServerTypes.Tests/SqlClient.SqlServerTypes.Tests.fsproj b/tests/SqlClient.SqlServerTypes.Tests/SqlClient.SqlServerTypes.Tests.fsproj index afe37d35..3c408cf0 100644 --- a/tests/SqlClient.SqlServerTypes.Tests/SqlClient.SqlServerTypes.Tests.fsproj +++ b/tests/SqlClient.SqlServerTypes.Tests/SqlClient.SqlServerTypes.Tests.fsproj @@ -10,7 +10,6 @@ for the time necessary of the transition, this enables more coverage of the type aliases working the way expected in client code --> $(NoWarn);0044 - $(DefineConstants);WITH_LEGACY_NAMESPACE diff --git a/tests/SqlClient.Tests/ConfigurationTest.fs b/tests/SqlClient.Tests/ConfigurationTest.fs index c9618390..5959843e 100644 --- a/tests/SqlClient.Tests/ConfigurationTest.fs +++ b/tests/SqlClient.Tests/ConfigurationTest.fs @@ -1,7 +1,9 @@ -module FSharp.Data.SqlClient.ConfigurationTests +module FSharp.Data.SqlClient.Tests.ConfigurationTests open Xunit open FSharp.Data +open FSharp.Data.SqlClient +open FSharp.Data.SqlClient.Tests open System.Configuration let adventureWorks = ConfigurationManager.ConnectionStrings.["AdventureWorks"].ConnectionString diff --git a/tests/SqlClient.Tests/ConnectionStrings.fs b/tests/SqlClient.Tests/ConnectionStrings.fs index ff336be5..e8129a1b 100644 --- a/tests/SqlClient.Tests/ConnectionStrings.fs +++ b/tests/SqlClient.Tests/ConnectionStrings.fs @@ -1,4 +1,4 @@ -module FSharp.Data.ConnectionStrings +module FSharp.Data.SqlClient.Tests.ConnectionStrings [] let server = @"." diff --git a/tests/SqlClient.Tests/CreateCommand.fs b/tests/SqlClient.Tests/CreateCommand.fs index b17ace81..6ae94644 100644 --- a/tests/SqlClient.Tests/CreateCommand.fs +++ b/tests/SqlClient.Tests/CreateCommand.fs @@ -1,8 +1,10 @@ -module FSharp.Data.CreateCommandTest - +module FSharp.Data.SqlClient.Tests.CreateCommandTest +open FSharp.Data +open FSharp.Data.SqlClient +open FSharp.Data.SqlClient.Tests open Xunit -type DB = FSharp.Data.ProgrammabilityTest.AdventureWorks +type DB = FSharp.Data.SqlClient.Tests.ProgrammabilityTest.AdventureWorks [] let getSingleRowNoParams() = diff --git a/tests/SqlClient.Tests/DataTablesTests.fs b/tests/SqlClient.Tests/DataTablesTests.fs index 2c89ff7d..d1389e2c 100644 --- a/tests/SqlClient.Tests/DataTablesTests.fs +++ b/tests/SqlClient.Tests/DataTablesTests.fs @@ -1,4 +1,4 @@ -namespace FSharp.Data +namespace FSharp.Data.SqlClient.Tests open System open System.Configuration @@ -7,6 +7,7 @@ open System.Data.SqlClient open System.Data open FSharp.Data open FSharp.Data.SqlClient +open FSharp.Data.SqlClient.Tests open Xunit open ProgrammabilityTest diff --git a/tests/SqlClient.Tests/DynamicRecordTests.fs b/tests/SqlClient.Tests/DynamicRecordTests.fs index 4b9d31ca..b8bf00fd 100644 --- a/tests/SqlClient.Tests/DynamicRecordTests.fs +++ b/tests/SqlClient.Tests/DynamicRecordTests.fs @@ -1,4 +1,4 @@ -module FSharp.Data.DynamicRecordTests +module FSharp.Data.Tests.DynamicRecordTests open System open System.Dynamic diff --git a/tests/SqlClient.Tests/FreeVarDoubleDeclTests.fs b/tests/SqlClient.Tests/FreeVarDoubleDeclTests.fs index ba81491d..72ef737e 100644 --- a/tests/SqlClient.Tests/FreeVarDoubleDeclTests.fs +++ b/tests/SqlClient.Tests/FreeVarDoubleDeclTests.fs @@ -1,9 +1,7 @@ -#if WITH_LEGACY_NAMESPACE -module FSharp.Data.``The undeclared parameter 'X' is used more than once in the batch being analyzed`` +module FSharp.Data.SqlClient.Tests.``The undeclared parameter 'X' is used more than once in the batch being analyzed`` +open FSharp.Data open FSharp.Data.SqlClient -#else -module FSharp.Data.SqlClient.``The undeclared parameter 'X' is used more than once in the batch being analyzed`` -#endif +open FSharp.Data.SqlClient.Tests open System open Xunit diff --git a/tests/SqlClient.Tests/OptionalParamsTests.fs b/tests/SqlClient.Tests/OptionalParamsTests.fs index 413db117..133ecd40 100644 --- a/tests/SqlClient.Tests/OptionalParamsTests.fs +++ b/tests/SqlClient.Tests/OptionalParamsTests.fs @@ -1,10 +1,8 @@ -#if WITH_LEGACY_NAMESPACE -module FSharp.Data.OptionalParamsTests -open FSharp.Data.SqlClient -#else -module FSharp.Data.SqlClient.OptionalParamsTests -#endif +module FSharp.Data.SqlClient.Tests.OptionalParamsTests +open FSharp.Data +open FSharp.Data.SqlClient +open FSharp.Data.SqlClient.Tests open Xunit [] diff --git a/tests/SqlClient.Tests/ProgrammabilityTests.fs b/tests/SqlClient.Tests/ProgrammabilityTests.fs index 7238e665..42c7a7d9 100644 --- a/tests/SqlClient.Tests/ProgrammabilityTests.fs +++ b/tests/SqlClient.Tests/ProgrammabilityTests.fs @@ -1,9 +1,7 @@ -#if WITH_LEGACY_NAMESPACE -module FSharp.Data.ProgrammabilityTest +module FSharp.Data.SqlClient.Tests.ProgrammabilityTest +open FSharp.Data open FSharp.Data.SqlClient -#else -module FSharp.Data.SqlClient.ProgrammabilityTest -#endif +open FSharp.Data.SqlClient.Tests open System open System.Data.SqlClient diff --git a/tests/SqlClient.Tests/ResultTypeTests.fs b/tests/SqlClient.Tests/ResultTypeTests.fs index b17c8660..90505ec7 100644 --- a/tests/SqlClient.Tests/ResultTypeTests.fs +++ b/tests/SqlClient.Tests/ResultTypeTests.fs @@ -1,9 +1,7 @@ -#if WITH_LEGACY_NAMESPACE -module FSharp.Data.ResultTypeTests +module FSharp.Data.SqlClient.Tests.ResultTypeTests +open FSharp.Data open FSharp.Data.SqlClient -#else -module FSharp.Data.SqlClient.ResultTypeTests -#endif +open FSharp.Data.SqlClient.Tests open FSharp.Data open Xunit diff --git a/tests/SqlClient.Tests/SpReturnValueTests.fs b/tests/SqlClient.Tests/SpReturnValueTests.fs index d996c812..879dd708 100644 --- a/tests/SqlClient.Tests/SpReturnValueTests.fs +++ b/tests/SqlClient.Tests/SpReturnValueTests.fs @@ -1,9 +1,7 @@ -#if WITH_LEGACY_NAMESPACE -module FSharp.Data.SpReturnValueTests +module FSharp.Data.SqlClient.Tests.SpReturnValueTests +open FSharp.Data open FSharp.Data.SqlClient -#else -module FSharp.Data.SqlClient.SpReturnValueTests -#endif +open FSharp.Data.SqlClient.Tests open System open Xunit diff --git a/tests/SqlClient.Tests/SqlEnumTests.fs b/tests/SqlClient.Tests/SqlEnumTests.fs index 77043929..53402010 100644 --- a/tests/SqlClient.Tests/SqlEnumTests.fs +++ b/tests/SqlClient.Tests/SqlEnumTests.fs @@ -1,12 +1,10 @@ -#if WITH_LEGACY_NAMESPACE -module FSharp.Data.EnumTests -open FSharp.Data.SqlClient -#else -module FSharp.Data.SqlClient.EnumTests -#endif +module FSharp.Data.SqlClient.Tests.EnumTests +#if USE_SYSTEM_DATA_COMMON_DBPROVIDERFACTORIES open System open Xunit - +open FSharp.Data +open FSharp.Data.SqlClient +open FSharp.Data.SqlClient.Tests type EnumMapping = SqlEnumProvider<"SELECT * FROM (VALUES(('One'), 1), ('Two', 2)) AS T(Tag, Value)", ConnectionStrings.LocalHost, Kind = SqlEnumKind.CLI> [] @@ -151,3 +149,4 @@ let ProductWeightAndSizeUnitsOfMeasure() = let bigBikes = allBikes |> List.choose ( fun x -> if x.Size = Some 52. then Some x.Name else None) Assert.Equal<_ list>( ["Mountain-500 Silver, 52"; "Mountain-500 Black, 52"], bigBikes) +#endif \ No newline at end of file diff --git a/tests/SqlClient.Tests/SynonymsTests.fs b/tests/SqlClient.Tests/SynonymsTests.fs index c1fefa1b..2063e1cb 100644 --- a/tests/SqlClient.Tests/SynonymsTests.fs +++ b/tests/SqlClient.Tests/SynonymsTests.fs @@ -1,8 +1,11 @@ -module FSharp.Data.SynonymsTests +module FSharp.Data.SqlClient.Tests.SynonymsTests open System open System.Data open System.Data.SqlClient +open FSharp.Data +open FSharp.Data.SqlClient +open FSharp.Data.SqlClient.Tests open ProgrammabilityTest open Xunit diff --git a/tests/SqlClient.Tests/TVPTests.fs b/tests/SqlClient.Tests/TVPTests.fs index 4bae1bf0..2bde0a5c 100644 --- a/tests/SqlClient.Tests/TVPTests.fs +++ b/tests/SqlClient.Tests/TVPTests.fs @@ -1,9 +1,7 @@ -#if WITH_LEGACY_NAMESPACE -module FSharp.Data.TVPTests +module FSharp.Data.SqlClient.Tests.TVPTests +open FSharp.Data open FSharp.Data.SqlClient -#else -module FSharp.Data.SqlClient.TVPTests -#endif +open FSharp.Data.SqlClient.Tests open FSharp.Data open Xunit diff --git a/tests/SqlClient.Tests/TempTableTests.fs b/tests/SqlClient.Tests/TempTableTests.fs index 08150930..52deeac2 100644 --- a/tests/SqlClient.Tests/TempTableTests.fs +++ b/tests/SqlClient.Tests/TempTableTests.fs @@ -1,9 +1,6 @@ -#if WITH_LEGACY_NAMESPACE -module FSharp.Data.TempTableTests +module FSharp.Data.SqlClient.Tests.TempTableTests open FSharp.Data.SqlClient -#else -module FSharp.Data.SqlClient.TempTableTests -#endif +open FSharp.Data.SqlClient.Tests open FSharp.Data open Xunit diff --git a/tests/SqlClient.Tests/TransactionTests.fs b/tests/SqlClient.Tests/TransactionTests.fs index 7d31a560..e1b6b07c 100644 --- a/tests/SqlClient.Tests/TransactionTests.fs +++ b/tests/SqlClient.Tests/TransactionTests.fs @@ -1,4 +1,4 @@ -module FSharp.Data.TransactionTests +module FSharp.Data.SqlClient.Tests.TransactionTests open System open System.Data @@ -7,8 +7,10 @@ open System.Data.SqlClient open Xunit -open FSharp.Data.TypeProviderTest +open FSharp.Data.SqlClient.Tests.TypeProviderTest +open FSharp.Data open FSharp.Data.SqlClient +open FSharp.Data.SqlClient.Tests [] let ``Closing ConnectionStrings.AdventureWorks on complete``() = diff --git a/tests/SqlClient.Tests/TypeProviderTest.fs b/tests/SqlClient.Tests/TypeProviderTest.fs index a788a4a4..dadc32ca 100644 --- a/tests/SqlClient.Tests/TypeProviderTest.fs +++ b/tests/SqlClient.Tests/TypeProviderTest.fs @@ -1,10 +1,8 @@ -#if WITH_LEGACY_NAMESPACE -module FSharp.Data.TypeProviderTest -open FSharp.Data.SqlClient -#else -module FSharp.Data.SqlClient.TypeProviderTest -#endif +module FSharp.Data.SqlClient.Tests.TypeProviderTest +open FSharp.Data +open FSharp.Data.SqlClient +open FSharp.Data.SqlClient.Tests open System open System.Data open System.Data.SqlClient diff --git a/tests/SqlClient.Tests/UnitsOfMeasure.fs b/tests/SqlClient.Tests/UnitsOfMeasure.fs index d9d6c65c..902d003e 100644 --- a/tests/SqlClient.Tests/UnitsOfMeasure.fs +++ b/tests/SqlClient.Tests/UnitsOfMeasure.fs @@ -1,8 +1,10 @@ -module FSharp.Data.UnitsOfMeasure +module FSharp.Data.SqlClient.Tests.UnitsOfMeasure open Xunit - -type DB = FSharp.Data.ProgrammabilityTest.AdventureWorks +open FSharp.Data +open FSharp.Data.SqlClient +open FSharp.Data.SqlClient.Tests +type DB = FSharp.Data.SqlClient.Tests.ProgrammabilityTest.AdventureWorks type UOM = DB.Sales.``Units of Measure`` From a2f2323682d8cea169de52c6a95a0f2ae48b2f7b Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Sat, 2 Dec 2023 02:42:25 +0100 Subject: [PATCH 3/6] ode to msbuild and DRY, also attempt to add invariants about fsc.props setting. Keeping the VS2017 paths here as this is probably good template other F# project may rely upon. --- fsc.props | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/fsc.props b/fsc.props index f6b3061c..2beae133 100644 --- a/fsc.props +++ b/fsc.props @@ -1,50 +1,56 @@ - + + true true true - - C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0 + fsc.exe + + C:\Program Files\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\FSharp + + + C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp + + + C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp + + + C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp + C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\CommonExtensions\Microsoft\FSharp - fsc.exe C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp - fsc.exe C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp - fsc.exe C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp - fsc.exe C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\FSharp - fsc.exe C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp - fsc.exe C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp - fsc.exe C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp - fsc.exe C:\Program Files (x86)\Microsoft SDKs\F#\10.1\Framework\v4.0 - fsc.exe + + + C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0 /Library/Frameworks/Mono.framework/Versions/Current/Commands @@ -54,4 +60,9 @@ /usr/bin fsharpc + + \ No newline at end of file From 290510c38ab9080ec645b077c445690ea6520123 Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Fri, 1 Dec 2023 20:26:27 +0100 Subject: [PATCH 4/6] adjust .sln to have few more useful stuff in the solution explorer --- SqlClient.sln | 7 +++++-- Tests.sln | 12 ++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/SqlClient.sln b/SqlClient.sln index 719109ad..04fb41e8 100644 --- a/SqlClient.sln +++ b/SqlClient.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28010.2041 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34309.116 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{FD7933BD-2A90-49EB-A4B2-95F9D3076BBD}" ProjectSection(SolutionItems) = preProject @@ -17,7 +17,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject build.cmd = build.cmd build.fsx = build.fsx + Directory.Build.props = Directory.Build.props + fsc.props = fsc.props LICENSE.md = LICENSE.md + netfx.props = netfx.props README.md = README.md RELEASE_NOTES.md = RELEASE_NOTES.md EndProjectSection diff --git a/Tests.sln b/Tests.sln index 81407f17..82fdcb1c 100644 --- a/Tests.sln +++ b/Tests.sln @@ -1,11 +1,12 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28010.2041 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34310.174 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{E35ED000-5A6C-49E1-82CF-55CB8C16C2AB}" ProjectSection(SolutionItems) = preProject paket.dependencies = paket.dependencies + paket.lock = paket.lock EndProjectSection EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "SqlClient.Tests", "tests\SqlClient.Tests\SqlClient.Tests.fsproj", "{36665EFF-56A2-46C2-852D-6D26DF492D79}" @@ -14,6 +15,13 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "SqlClient.DesignTime.Tests" EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "SqlClient.SqlServerTypes.Tests", "tests\SqlClient.SqlServerTypes.Tests\SqlClient.SqlServerTypes.Tests.fsproj", "{CF3D9433-B20A-4E5A-9401-F6518CBAD34E}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution items", "Solution items", "{0005CBDB-E976-46EE-89A0-CEE3F25A9365}" + ProjectSection(SolutionItems) = preProject + Directory.Build.props = Directory.Build.props + fsc.props = fsc.props + netfx.props = netfx.props + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU From b694311ade7ef612a2dab58bcd2e5d6222bc374f Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Fri, 1 Dec 2023 20:31:17 +0100 Subject: [PATCH 5/6] few launch settings to make it possible to launch in debug vscode --- src/SqlClient/Properties/launchSettings.json | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/SqlClient/Properties/launchSettings.json b/src/SqlClient/Properties/launchSettings.json index c5369615..4fea3ca3 100644 --- a/src/SqlClient/Properties/launchSettings.json +++ b/src/SqlClient/Properties/launchSettings.json @@ -1,9 +1,19 @@ { "profiles": { - "SqlClient": { + "debug vs2022": { "commandName": "Executable", - "executablePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Common7\\IDE\\devenv.exe", - "commandLineArgs": "..\\..\\Tests.sln" + "executablePath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\devenv.exe", + "commandLineArgs": "..\\Tests.sln" + }, + "debug vscode": { + "commandName": "Executable", + "executablePath": "C:\\Users\\gauth\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe", + "commandLineArgs": "..\\" + }, + "debug rider": { + "commandName": "Executable", + "executablePath": "C:\\Users\\gauth\\AppData\\Local\\JetBrains\\Toolbox\\apps\\Rider\\ch-0\\232.10203.29\\bin\\rider64.exe", + "commandLineArgs": "..\\..\\..\\..\\..\\tests.sln" } } } \ No newline at end of file From ee1356482e4bac2460078eb288b433fc75fed882 Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Sat, 2 Dec 2023 17:15:59 +0100 Subject: [PATCH 6/6] Update fsc.props --- fsc.props | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fsc.props b/fsc.props index 2beae133..b9f63025 100644 --- a/fsc.props +++ b/fsc.props @@ -1,6 +1,5 @@ - - + true @@ -60,9 +59,8 @@ /usr/bin fsharpc - - - \ No newline at end of file +