Skip to content

Commit b071938

Browse files
Merge branch 'master' of https://github.com/snowflakedb/snowflake-connector-net into SNOW-2038030-Fix-Session-Close
# Conflicts: # Snowflake.Data.Tests/UnitTests/SFStatementTest.cs
2 parents bd2acc8 + a034791 commit b071938

File tree

349 files changed

+9629
-2392
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

349 files changed

+9629
-2392
lines changed

.github/workflows/jira_issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
summary: '${{ github.event.issue.title }}'
3838
description: |
3939
${{ github.event.issue.body }} \\ \\ _Created from GitHub Action_ for ${{ github.event.issue.html_url }}
40-
fields: '{ "customfield_11401": {"id": "14723"}, "assignee": {"id": "712020:e1f41916-da57-4fe8-b317-116d5229aa51"}, "components":[{"id":"19287"}], "labels": ["oss"], "priority": {"id": "10001"} }'
40+
fields: '{ "customfield_11401": {"id": "14723"}, "assignee": {"id": "712020:e527ae71-55cc-4e02-9217-1ca4ca8028a2"}, "components":[{"id":"19287"}], "labels": ["oss"], "priority": {"id": "10001"} }'
4141

4242
- name: Update GitHub Issue
4343
uses: ./jira/gajira-issue-update

.github/workflows/main.yml

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: DotNet Build and Test
33
# Triggers the workflow on push or pull request events but only for the master branch
44
on:
55
push:
6-
branches: [ master ]
6+
branches: [ master, oauth_flows ]
77
pull_request:
8-
branches: [ master ]
8+
branches: [ master, oauth_flows ]
99
workflow_dispatch:
1010
inputs:
1111
logLevel:
@@ -36,6 +36,12 @@ jobs:
3636
steps:
3737
- name: Checkout code
3838
uses: actions/checkout@v4
39+
- name: Setup Java
40+
uses: actions/setup-java@v4
41+
with:
42+
distribution: 'temurin'
43+
java-version: 17
44+
java-package: 'jre'
3945
- name: Setup Dotnet
4046
uses: actions/setup-dotnet@v4
4147
with:
@@ -66,7 +72,7 @@ jobs:
6672
- name: Run Tests
6773
run: |
6874
cd Snowflake.Data.Tests
69-
dotnet-coverage collect "dotnet test --framework ${{ matrix.dotnet }} --no-build -l console;verbosity=normal" --output windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml --output-format cobertura --settings coverage.config
75+
dotnet-coverage collect "dotnet test --framework ${{ matrix.dotnet }} --no-build --logger junit;LogFilePath=windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_results.junit.xml --verbosity normal" --output windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml --output-format cobertura --settings coverage.config
7076
env:
7177
snowflake_cloud_env: ${{ matrix.cloud_env }}
7278
net_version: ${{ matrix.dotnet }}
@@ -75,12 +81,16 @@ jobs:
7581
with:
7682
name: code-coverage-report_windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
7783
path: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
78-
7984
- name: Upload Test Performance Report
8085
uses: actions/upload-artifact@v4
8186
with:
8287
name: tests-performance_windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
8388
path: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv
89+
- name: Upload test results to Codecov
90+
if: ${{!cancelled()}}
91+
uses: codecov/test-results-action@v1
92+
with:
93+
token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }}
8494
- name: Upload coverage reports to Codecov
8595
uses: codecov/codecov-action@v4
8696
with:
@@ -99,6 +109,12 @@ jobs:
99109
cloud_env: ['AZURE', 'GCP', 'AWS']
100110
steps:
101111
- uses: actions/checkout@v4
112+
- name: Setup Java
113+
uses: actions/setup-java@v4
114+
with:
115+
distribution: 'temurin'
116+
java-version: 17
117+
java-package: 'jre'
102118
- name: Setup Dotnet
103119
uses: actions/setup-dotnet@v4
104120
with:
@@ -128,7 +144,7 @@ jobs:
128144
- name: Run Tests
129145
run: |
130146
cd Snowflake.Data.Tests
131-
dotnet-coverage collect "dotnet test --framework ${{ matrix.dotnet }} --no-build -l console;verbosity=normal" --output linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml --output-format cobertura --settings coverage.config
147+
dotnet-coverage collect "dotnet test --framework ${{ matrix.dotnet }} --no-build --logger junit;LogFilePath=linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_results.junit.xml --verbosity normal" --output linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml --output-format cobertura --settings coverage.config
132148
env:
133149
snowflake_cloud_env: ${{ matrix.cloud_env }}
134150
net_version: ${{ matrix.dotnet }}
@@ -142,6 +158,11 @@ jobs:
142158
with:
143159
name: tests-performance_linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
144160
path: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv
161+
- name: Upload test results to Codecov
162+
if: ${{!cancelled()}}
163+
uses: codecov/test-results-action@v1
164+
with:
165+
token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }}
145166
- name: Upload coverage reports to Codecov
146167
uses: codecov/codecov-action@v4
147168
with:
@@ -160,6 +181,12 @@ jobs:
160181
cloud_env: ['AZURE', 'GCP', 'AWS']
161182
steps:
162183
- uses: actions/checkout@v4
184+
- name: Setup Java
185+
uses: actions/setup-java@v4
186+
with:
187+
distribution: 'temurin'
188+
java-version: 17
189+
java-package: 'jre'
163190
- name: Setup Dotnet
164191
uses: actions/setup-dotnet@v4
165192
with:
@@ -189,7 +216,7 @@ jobs:
189216
- name: Run Tests
190217
run: |
191218
cd Snowflake.Data.Tests
192-
dotnet-coverage collect "dotnet test --framework ${{ matrix.dotnet }} --no-build -l console;verbosity=normal" --output macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml --output-format cobertura --settings coverage.config
219+
dotnet-coverage collect "dotnet test --framework ${{ matrix.dotnet }} --no-build --logger junit;LogFilePath=windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_results.junit.xml --verbosity normal" --output macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml --output-format cobertura --settings coverage.config
193220
env:
194221
snowflake_cloud_env: ${{ matrix.cloud_env }}
195222
net_version: ${{ matrix.dotnet }}
@@ -203,6 +230,11 @@ jobs:
203230
with:
204231
name: tests-performance_macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
205232
path: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv
233+
- name: Upload test results to Codecov
234+
if: ${{!cancelled()}}
235+
uses: codecov/test-results-action@v1
236+
with:
237+
token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }}
206238
- name: Upload coverage reports to Codecov
207239
uses: codecov/codecov-action@v4
208240
with:
Binary file not shown.
Binary file not shown.
Binary file not shown.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,4 +316,5 @@ Snowflake.Data.Tests/unix_*_performance.csv
316316
/parameters.json
317317
parameters*.json
318318
Snowflake.Data.Tests/toml_config_folder
319-
*.toml
319+
*.toml
320+
*.p8

Jenkinsfile

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import groovy.json.JsonOutput
22

3-
43
timestamps {
54
node('regular-memory-node') {
65
stage('checkout') {
@@ -13,8 +12,8 @@ timestamps {
1312
stage('Build') {
1413
withCredentials([
1514
usernamePassword(credentialsId: '063fc85b-62a6-4181-9d72-873b43488411', usernameVariable: 'AWS_ACCESS_KEY_ID', passwordVariable: 'AWS_SECRET_ACCESS_KEY'),
16-
string(credentialsId: 'a791118f-a1ea-46cd-b876-56da1b9bc71c',variable: 'NEXUS_PASSWORD')
17-
]) {
15+
string(credentialsId: 'a791118f-a1ea-46cd-b876-56da1b9bc71c', variable: 'NEXUS_PASSWORD')
16+
]) {
1817
sh '''\
1918
|#!/bin/bash -e
2019
|export GIT_BRANCH=${GIT_BRANCH}
@@ -23,32 +22,47 @@ timestamps {
2322
'''.stripMargin()
2423
}
2524
}
26-
params = [
27-
string(name: 'svn_revision', value: 'bptp-built'),
25+
26+
def params = [
27+
string(name: 'svn_revision', value: 'bptp-stable'),
2828
string(name: 'branch', value: 'main'),
2929
string(name: 'client_git_commit', value: scmInfo.GIT_COMMIT),
3030
string(name: 'client_git_branch', value: scmInfo.GIT_BRANCH),
3131
string(name: 'TARGET_DOCKER_TEST_IMAGE', value: 'dotnet-ubuntu204-net9'),
3232
string(name: 'parent_job', value: env.JOB_NAME),
3333
string(name: 'parent_build_number', value: env.BUILD_NUMBER)
3434
]
35+
3536
stage('Test') {
36-
build job: 'RT-LanguageDotnet-PC',parameters: params
37+
parallel(
38+
'Test': {
39+
stage('Test') {
40+
build job: 'RT-LanguageDotnet-PC', parameters: params
41+
}
42+
},
43+
'Test Authentication': {
44+
stage('Test Authentication') {
45+
withCredentials([
46+
string(credentialsId: 'a791118f-a1ea-46cd-b876-56da1b9bc71c', variable: 'NEXUS_PASSWORD'),
47+
string(credentialsId: 'sfctest0-parameters-secret', variable: 'PARAMETERS_SECRET')
48+
]) {
49+
sh '''\
50+
|#!/bin/bash -e
51+
|$WORKSPACE/ci/test_authentication.sh
52+
'''.stripMargin()
53+
}
54+
}
55+
}
56+
)
3757
}
3858
}
3959
}
4060

41-
4261
pipeline {
4362
agent { label 'regular-memory-node' }
4463
options { timestamps() }
4564
environment {
46-
COMMIT_SHA_LONG = sh(returnStdout: true, script: "echo \$(git rev-parse " + "HEAD)").trim()
47-
48-
// environment variables for semgrep_agent (for findings / analytics page)
49-
// remove .git at the end
50-
// remove SCM URL + .git at the end
51-
65+
COMMIT_SHA_LONG = sh(returnStdout: true, script: "echo \$(git rev-parse HEAD)").trim()
5266
BASELINE_BRANCH = "${env.CHANGE_TARGET}"
5367
}
5468
stages {
@@ -61,7 +75,7 @@ pipeline {
6175
}
6276

6377
def wgetUpdateGithub(String state, String folder, String targetUrl, String seconds) {
64-
def ghURL = "https://api.github.com/repos/snowflakedb/snowflake-connector-net/statuses/$COMMIT_SHA_LONG"
65-
def data = JsonOutput.toJson([state: "${state}", context: "jenkins/${folder}",target_url: "${targetUrl}"])
66-
sh "wget ${ghURL} --spider -q --header='Authorization: token $GIT_PASSWORD' --post-data='${data}'"
67-
}
78+
def ghURL = "https://api.github.com/repos/snowflakedb/snowflake-connector-net/statuses/$COMMIT_SHA_LONG"
79+
def data = JsonOutput.toJson([state: "${state}", context: "jenkins/${folder}", target_url: "${targetUrl}"])
80+
sh "wget ${ghURL} --spider -q --header='Authorization: token $GIT_PASSWORD' --post-data='${data}'"
81+
}

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ Logging description and configuration:
143143
Method of validating the connection's certificates in the .NET driver differs from the rest of the Snowflake drivers.
144144
Read more in [certificate validation](doc/CertficateValidation.md) docs.
145145

146+
## Cache
147+
148+
Storing tokens in cache for SSO/MFA authentication.
149+
150+
Read more in [cache](doc/Cache.md) docs.
151+
146152
---------------
147153

148154
## Notice
@@ -185,5 +191,4 @@ Note that the driver is now targeting .NET Standard 2.0. When upgrading, you mig
185191

186192
See more:
187193
* [Security Policy](SECURITY.md)
188-
* [Security Advisories](/security/advisories)
189-
194+
* [Security Advisories](../../security/advisories)

Snowflake.Data.Tests/App.config

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
<?xml version="1.0" encoding="utf-8" ?>
2-
<!--
3-
Copyright (c) 2012-2017 Snowflake Computing Inc. All rights reserved.
4-
-->
52
<configuration>
63
<configSections>
74
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />

0 commit comments

Comments
 (0)