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-1644121: Fix build warnings #1011

Merged
merged 7 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/jira_close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: snowflakedb/gh-actions
ref: jira_v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jira_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: ((github.event_name == 'issue_comment' && github.event.comment.body == 'recreate jira' && github.event.comment.user.login == 'sfc-gh-mkeller') || (github.event_name == 'issues' && github.event.pull_request.user.login != 'whitesource-for-github-com[bot]'))
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: snowflakedb/gh-actions
ref: jira_v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
runs-on: windows-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-quality: 'ga'
Expand Down
41 changes: 21 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
cloud_env: ['AZURE', 'GCP', 'AWS']
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Dotnet
uses: actions/setup-dotnet@v4
with:
Expand All @@ -44,7 +44,7 @@ jobs:
8.0.x
dotnet-quality: 'ga'
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Setup dotnet-coverage
Expand All @@ -69,17 +69,18 @@ jobs:
snowflake_cloud_env: ${{ matrix.cloud_env }}
net_version: ${{ matrix.dotnet }}
- name: Upload Code Coverage Report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
name: code-coverage-report_windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
path: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml

- name: Upload Test Performance Report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: tests-performance
name: tests-performance_windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
path: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
# without the token code cov may fail because of Github limits https://github.com/codecov/codecov-action/issues/557
token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }}
Expand All @@ -95,7 +96,7 @@ jobs:
dotnet: ['net6.0', 'net7.0', 'net8.0']
cloud_env: ['AZURE', 'GCP', 'AWS']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Dotnet
uses: actions/setup-dotnet@v4
with:
Expand All @@ -104,7 +105,7 @@ jobs:
8.0.x
dotnet-quality: 'ga'
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Setup dotnet-coverage
Expand All @@ -128,17 +129,17 @@ jobs:
snowflake_cloud_env: ${{ matrix.cloud_env }}
net_version: ${{ matrix.dotnet }}
- name: Upload Code Coverage Report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
name: code-coverage-report_linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
path: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
- name: Upload Test Performance Report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: tests-performance
name: tests-performance_linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
path: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
# without the token code cov may fail because of Github limits https://github.com/codecov/codecov-action/issues/557
token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }}
Expand All @@ -163,7 +164,7 @@ jobs:
8.0.x
dotnet-quality: 'ga'
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Setup dotnet-coverage
Expand All @@ -187,17 +188,17 @@ jobs:
snowflake_cloud_env: ${{ matrix.cloud_env }}
net_version: ${{ matrix.dotnet }}
- name: Upload Code Coverage Report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
name: code-coverage-report_macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
path: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
- name: Upload Test Performance Report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: tests-performance
name: tests-performance_macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}
path: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
# without the token code cov may fail because of Github limits https://github.com/codecov/codecov-action/issues/557
token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snyk-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout action
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: snowflakedb/whitesource-actions
token: ${{ secrets.WHITESOURCE_ACTION_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/snyk-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
if: ${{ github.event.pull_request.user.login == 'sfc-gh-snyk-sca-sa' }}
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- name: checkout action
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: snowflakedb/whitesource-actions
token: ${{ secrets.WHITESOURCE_ACTION_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ static async Task InvalidConnectionTaskAsync(string connectionString, int times)
{
// intentionally not using await so the connection
// will be disposed with invalid underlying session
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
conn.OpenAsync();
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
};
// wait 100ms each time so the invalid sessions are generated
// roughly at the same speed as connections for query tasks
Expand Down
2 changes: 1 addition & 1 deletion Snowflake.Data.Tests/IntegrationTests/SFDbAdaptorIT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SFDbAdaptorIT : SFBaseTest
private SnowflakeDbCommand _command;

[SetUp]
public void BeforeTest()
public new void BeforeTest()
{
_adapter = new SnowflakeDbDataAdapter();
_command = new SnowflakeDbCommand();
Expand Down
4 changes: 2 additions & 2 deletions Snowflake.Data.Tests/IntegrationTests/SFDbFactoryIT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SFDbFactoryIT : SFBaseTest
DbConnection _connection;

[SetUp]
public void BeforeTest()
public new void BeforeTest()
{
#if NETFRAMEWORK
_factory = DbProviderFactories.GetFactory("Snowflake.Data");
Expand All @@ -35,7 +35,7 @@ public void BeforeTest()
}

[TearDown]
public void AfterTest()
public new void AfterTest()
{
_connection.Close();
}
Expand Down
4 changes: 4 additions & 0 deletions Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
_forceTimeoutForNonLoginRequestsOnly && !message.RequestUri.AbsolutePath.Equals(RestPath.SF_LOGIN_PATH))
{
// Override the http timeout and set to 1ms to force all http request to timeout and retry
// Disable warning as this is the way to be compliant with netstandard2.0
// API reference: https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httprequestmessage?view=netstandard-2.0
#pragma warning disable CS0618 // Type or member is obsolete
message.Properties[BaseRestRequest.HTTP_REQUEST_TIMEOUT_KEY] = TimeSpan.FromTicks(0);
#pragma warning restore CS0618 // Type or member is obsolete
}

return await (base.SendAsync(message, restTimeout, externalCancellationToken).ConfigureAwait(false));
Expand Down
Loading
Loading