Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-798828: Target .NET Standard 2.0 #867

Merged
merged 61 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
92cd5df
SNOW-798828: Add other supported versions of .netstandard2.0 to the d…
sfc-gh-ext-simba-lf Feb 15, 2024
04d99d1
SNOW-798828: Add target frameworks to test project
sfc-gh-ext-simba-lf Feb 15, 2024
80eb2aa
SNOW-798828: Remove core 2.0
sfc-gh-ext-simba-lf Feb 15, 2024
8742371
SNOW-798828: Test net5.0
sfc-gh-ext-simba-lf Feb 16, 2024
3794f9d
SNOW-798828: Test net7.0 and net8.0
sfc-gh-ext-simba-lf Feb 16, 2024
45a0cc1
SNOW-798828: Test net461
sfc-gh-ext-simba-lf Feb 16, 2024
327d1d0
SNOW-798828: Test net481
sfc-gh-ext-simba-lf Feb 16, 2024
d689f05
SNOW-798828: Add supported versions to Linux and MAC matrix
sfc-gh-ext-simba-lf Feb 16, 2024
8cb73fc
Set dotnet-version to 8
sfc-gh-ext-simba-lf Feb 20, 2024
e1ccb64
Change RuntimeFrameworkVersion from 6.0.0 to 8.0.0
sfc-gh-ext-simba-lf Feb 21, 2024
389d3ac
Comment line to run tests on Linux/MAC for other versions
sfc-gh-ext-simba-lf Feb 21, 2024
419fbe3
Try run tests sequentially
sfc-gh-ext-simba-lf Feb 21, 2024
4e77c5d
Revert target frameworks for Linux/MAC to net only
sfc-gh-ext-simba-lf Feb 21, 2024
027d6ec
Revert target frameworks Linux/MAC tests and revert sequential
sfc-gh-ext-simba-lf Feb 21, 2024
5928318
Add netcoreapp3.1
sfc-gh-ext-simba-lf Feb 21, 2024
c8a728c
Merge branch 'master' of https://github.com/snowflakedb/snowflake-con…
sfc-gh-ext-simba-lf Feb 21, 2024
f10907e
Add netcoreapp to if check
sfc-gh-ext-simba-lf Feb 21, 2024
5a95182
Test netcoreapp2.0
sfc-gh-ext-simba-lf Feb 21, 2024
4535e3c
Remove netcoreapp2.0
sfc-gh-ext-simba-lf Feb 21, 2024
42619e4
Add net462 to target framework
sfc-gh-ext-simba-lf Feb 21, 2024
c2e2fd9
Add NET Framework 4.8
sfc-gh-ext-simba-lf Mar 5, 2024
9a6defc
Merge branch 'master' of https://github.com/snowflakedb/snowflake-con…
sfc-gh-ext-simba-lf Mar 22, 2024
b06c89d
Add extra case for if
sfc-gh-ext-simba-lf Mar 22, 2024
befb2ce
Set compatible GCS package version with netstandard2.0
sfc-gh-ext-simba-lf Mar 23, 2024
3ce0095
Remove ItemGroup for .NET Framework
sfc-gh-ext-simba-lf Mar 23, 2024
ff49fe8
Set ConfigurationManager to 4.5.0
sfc-gh-ext-simba-lf Mar 23, 2024
cc35840
Remove ItemGroup for netstandard2.0
sfc-gh-ext-simba-lf Mar 25, 2024
23189c4
Set GCS package version to 4.10.0
sfc-gh-ext-simba-lf Apr 10, 2024
32d2d68
Delete commented lines
sfc-gh-ext-simba-lf Apr 10, 2024
b713973
Remove if statement for targets
sfc-gh-ext-simba-lf Apr 25, 2024
89864c6
Merge branch 'master' of https://github.com/snowflakedb/snowflake-con…
sfc-gh-ext-simba-lf Apr 25, 2024
0124942
Add indent
sfc-gh-ext-simba-lf Apr 25, 2024
8a3cc94
Remove obsolete ExtractCell
sfc-gh-ext-simba-lf Apr 25, 2024
403b584
Remove if directive for targets
sfc-gh-ext-simba-lf Apr 25, 2024
63b58cb
Use v4 of github actions
sfc-gh-ext-simba-lf Apr 26, 2024
8c4e6f6
Revert v4 back to v3
sfc-gh-ext-simba-lf Apr 28, 2024
552f946
Remove if directive
sfc-gh-ext-simba-lf Apr 29, 2024
6355b08
Use macos-13
sfc-gh-ext-simba-lf Apr 30, 2024
3009dcb
Run only net5.0 on macos-13 and keep other versions on macos-latest
sfc-gh-ext-simba-lf May 2, 2024
1e36fb0
Merge branch 'master' of https://github.com/snowflakedb/snowflake-con…
sfc-gh-ext-simba-lf May 9, 2024
98f3e58
Remove netcoreapp3.1 and net5.0 from tests
sfc-gh-ext-simba-lf May 14, 2024
20216e4
Merge branch 'master' into SNOW-798828-Target-NET-Standard-2.0
sfc-gh-ext-simba-lf May 15, 2024
873f7e5
Re-added assertion and removed Obsolete line
sfc-gh-ext-simba-lf Jun 5, 2024
ec76690
Merge branch 'master' of https://github.com/snowflakedb/snowflake-con…
sfc-gh-ext-simba-lf Jun 5, 2024
8ba4883
Merge branch 'master' of https://github.com/snowflakedb/snowflake-con…
sfc-gh-ext-simba-lf Jun 12, 2024
9eb464c
Use RuntimeInformation for client environment
sfc-gh-ext-simba-lf Jun 14, 2024
353e81f
Check net version from runtime
sfc-gh-ext-simba-lf Jun 14, 2024
a29b818
Change expected version based on github build
sfc-gh-ext-simba-lf Jun 14, 2024
fb76a0c
Set version to netstandard2.0
sfc-gh-ext-simba-lf Jun 15, 2024
606a057
Use assembly for net version
sfc-gh-ext-simba-lf Jun 15, 2024
2777372
Set netversion using runtime
sfc-gh-ext-simba-lf Jun 15, 2024
722de15
Comment out RuntimeFrameworkVersion
sfc-gh-ext-simba-lf Jun 15, 2024
5bbf02f
Remove unused packages and comment
sfc-gh-ext-simba-lf Jun 15, 2024
0193296
Rename index variable
sfc-gh-ext-simba-lf Jun 17, 2024
e5fc18d
Use the executing assembly's location for framework version
sfc-gh-ext-simba-lf Jun 18, 2024
fd08eb8
Change var name
sfc-gh-ext-simba-lf Jun 18, 2024
41981ae
Simplify assignment
sfc-gh-ext-simba-lf Jun 18, 2024
6ca7cec
Change test to use assembly for expected values
sfc-gh-ext-simba-lf Jun 19, 2024
7437435
Revert "Change test to use assembly for expected values"
sfc-gh-ext-simba-lf Jun 19, 2024
08aa918
Use runtime framework description for net version
sfc-gh-ext-simba-lf Jun 19, 2024
f9818cb
Update README.md about the supported .NET versions
sfc-gh-ext-simba-lf Jun 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ env:
DOTNET_VERSION: 6.0
sfc-gh-knozderko marked this conversation as resolved.
Show resolved Hide resolved
DOTNET_LEGACY_VERSION: 4.7.1
sfc-gh-knozderko marked this conversation as resolved.
Show resolved Hide resolved
# uncomment to run the tests sequentially
#SEQUENTIAL_ENV: SEQUENTIAL_TEST_RUN
# SEQUENTIAL_ENV: SEQUENTIAL_TEST_RUN

jobs:
test-windows:
Expand All @@ -34,14 +34,14 @@ jobs:
strategy:
fail-fast: false
matrix:
dotnet: ['net6.0', 'net472', 'net471']
dotnet: ['netcoreapp3.1', 'net5.0', 'net6.0', 'net7.0', 'net8.0', 'net462', 'net471', 'net472', 'net481']
cloud_env: ['AZURE', 'GCP', 'AWS']
steps:
- uses: actions/checkout@v3
- name: Setup Dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'
dotnet-quality: 'ga'
- name: Setup Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -92,14 +92,14 @@ jobs:
strategy:
fail-fast: false
matrix:
dotnet: ['net6.0']
dotnet: ['net5.0', 'net6.0', 'net7.0', 'net8.0']
cloud_env: ['AZURE', 'GCP', 'AWS']
steps:
- uses: actions/checkout@v3
- name: Setup Dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'
dotnet-quality: 'ga'
- name: Setup Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -149,14 +149,14 @@ jobs:
strategy:
fail-fast: false
matrix:
dotnet: ['net6.0']
dotnet: ['net5.0', 'net6.0', 'net7.0', 'net8.0']
cloud_env: ['AZURE', 'GCP', 'AWS']
steps:
- uses: actions/checkout@v3
- name: Setup Dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'
dotnet-quality: 'ga'
- name: Setup Python
uses: actions/setup-python@v4
Expand Down
6 changes: 3 additions & 3 deletions Snowflake.Data.Tests/Snowflake.Data.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net471;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0</TargetFrameworks>
<RuntimeFrameworkVersion>6.0.0</RuntimeFrameworkVersion>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net462;net471;net472;net481</TargetFrameworks>
sfc-gh-knozderko marked this conversation as resolved.
Show resolved Hide resolved
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net5.0;net6.0;net7.0;net8.0;</TargetFrameworks>
<RuntimeFrameworkVersion>8.0.0</RuntimeFrameworkVersion>
<Title>Snowflake.Data.Tests</Title>
<Description>Snowflake Connector for .NET</Description>
<Company>Snowflake Computing, Inc</Company>
sfc-gh-knozderko marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
20 changes: 14 additions & 6 deletions Snowflake.Data.Tests/UnitTests/ArrowResultSetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,20 @@ public void TestGetText()
[Test]
public void TestGetTextWithOneChar()
{
var testValues =
TestDataGenarator.AsciiCodes.ToCharArray()
.Append(TestDataGenarator.SnowflakeUnicode)
.ToArray();

PrepareTestCase(SFDataType.TEXT, 0, testValues);
char[] testValues;

#if NET462
var charArr = TestDataGenarator.AsciiCodes.ToList();
charArr.Add(TestDataGenarator.SnowflakeUnicode);
testValues = charArr.ToArray();
#else
testValues =
TestDataGenarator.AsciiCodes.ToCharArray()
.Append(TestDataGenarator.SnowflakeUnicode)
.ToArray();
#endif

PrepareTestCase(SFDataType.TEXT, 0, testValues);
sfc-gh-knozderko marked this conversation as resolved.
Show resolved Hide resolved

foreach (var testValue in testValues)
{
Expand Down
2 changes: 1 addition & 1 deletion Snowflake.Data.Tests/Util/SnowflakeDbExceptionAssert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void HasHttpErrorCodeInExceptionChain(Exception exception, HttpSta
case SnowflakeDbException se:
return se.ErrorCode == (int)expected;
case HttpRequestException he:
#if NETFRAMEWORK
#if NETFRAMEWORK || NETCOREAPP
sfc-gh-knozderko marked this conversation as resolved.
Show resolved Hide resolved
return he.Message.Contains(((int)expected).ToString());
#else
return he.StatusCode == expected;
Expand Down
3 changes: 1 addition & 2 deletions Snowflake.Data/Snowflake.Data.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net471;net472</TargetFrameworks>
sfc-gh-knozderko marked this conversation as resolved.
Show resolved Hide resolved
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0</TargetFrameworks>
sfc-gh-knozderko marked this conversation as resolved.
Show resolved Hide resolved
<TargetFramework>netstandard2.0</TargetFramework>
sfc-gh-knozderko marked this conversation as resolved.
Show resolved Hide resolved
<Title>Snowflake.Data</Title>
<PackageId>Snowflake.Data</PackageId>
<PackageLicenseUrl>https://github.com/snowflakedb/snowflake-connector-net/blob/master/LICENSE</PackageLicenseUrl>
Expand Down
Loading