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

testing dotnet framework #972

Closed
wants to merge 14 commits into from
Closed
244 changes: 123 additions & 121 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: DotNet Build and Test
# Triggers the workflow on push or pull request events but only for the master branch
on:
push:
branches: [ master ]
branches: [ master, test_master ]
pull_request:
branches: [ master ]
branches: [ master, test_master ]
workflow_dispatch:
inputs:
logLevel:
Expand All @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
dotnet: ['net8.0','net6.0', 'net472', 'net471']
dotnet: ['net472', 'net471']
cloud_env: ['AZURE', 'GCP', 'AWS']
steps:
- name: Checkout code
Expand All @@ -41,7 +41,6 @@ jobs:
with:
dotnet-version: |
6.0.x
8.0.x
dotnet-quality: 'ga'
- name: Setup Python
uses: actions/setup-python@v4
Expand All @@ -64,6 +63,9 @@ jobs:
- name: Run Tests
run: |
cd Snowflake.Data.Tests
echo "printing exiting dlls"
ls "bin\Debug\*"
ls "bin\Debug\${{ matrix.dotnet }}\*"
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
env:
snowflake_cloud_env: ${{ matrix.cloud_env }}
Expand All @@ -86,120 +88,120 @@ jobs:
fail_ci_if_error: true
files: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml

test-linux:
name: Tests on Linux
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dotnet: ['net6.0', 'net8.0']
cloud_env: ['AZURE', 'GCP', 'AWS']
steps:
- uses: actions/checkout@v3
- name: Setup Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
dotnet-quality: 'ga'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Setup dotnet-coverage
run: dotnet tool install --global dotnet-coverage --version 17.8.4
- name: Decrypt Parameters
shell: bash
env:
PARAMETER_SECRET: ${{ secrets.PARAMETER_SECRET }}
run: |
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETER_SECRET" \
./.github/workflows/parameters/parameters_${{ matrix.cloud_env }}.json.gpg > Snowflake.Data.Tests/parameters.json
- name: Build Driver
run: |
dotnet restore
dotnet build
- name: Run Tests
run: |
cd Snowflake.Data.Tests
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
env:
snowflake_cloud_env: ${{ matrix.cloud_env }}
net_version: ${{ matrix.dotnet }}
- name: Upload Code Coverage Report
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
- name: Upload Test Performance Report
uses: actions/upload-artifact@v3
with:
name: tests-performance
path: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
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 }}
fail_ci_if_error: true
files: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml

test-mac:
name: Tests on MAC
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
dotnet: ['net6.0', 'net8.0']
cloud_env: ['AZURE', 'GCP', 'AWS']
steps:
- uses: actions/checkout@v4
- name: Setup Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
dotnet-quality: 'ga'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Setup dotnet-coverage
run: dotnet tool install --global dotnet-coverage --version 17.8.4
- name: Decrypt Parameters
shell: bash
env:
PARAMETER_SECRET: ${{ secrets.PARAMETER_SECRET }}
run: |
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETER_SECRET" \
./.github/workflows/parameters/parameters_${{ matrix.cloud_env }}.json.gpg > Snowflake.Data.Tests/parameters.json
- name: Build Driver
run: |
dotnet restore
dotnet build
- name: Run Tests
run: |
cd Snowflake.Data.Tests
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
env:
snowflake_cloud_env: ${{ matrix.cloud_env }}
net_version: ${{ matrix.dotnet }}
- name: Upload Code Coverage Report
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
- name: Upload Test Performance Report
uses: actions/upload-artifact@v3
with:
name: tests-performance
path: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
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 }}
fail_ci_if_error: true
files: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
# test-linux:
# name: Tests on Linux
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# dotnet: ['net6.0', 'net8.0']
# cloud_env: ['AZURE', 'GCP', 'AWS']
# steps:
# - uses: actions/checkout@v3
# - name: Setup Dotnet
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: |
# 6.0.x
# 8.0.x
# dotnet-quality: 'ga'
# - name: Setup Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.x'
# - name: Setup dotnet-coverage
# run: dotnet tool install --global dotnet-coverage --version 17.8.4
# - name: Decrypt Parameters
# shell: bash
# env:
# PARAMETER_SECRET: ${{ secrets.PARAMETER_SECRET }}
# run: |
# gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETER_SECRET" \
# ./.github/workflows/parameters/parameters_${{ matrix.cloud_env }}.json.gpg > Snowflake.Data.Tests/parameters.json
# - name: Build Driver
# run: |
# dotnet restore
# dotnet build
# - name: Run Tests
# run: |
# cd Snowflake.Data.Tests
# 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
# env:
# snowflake_cloud_env: ${{ matrix.cloud_env }}
# net_version: ${{ matrix.dotnet }}
# - name: Upload Code Coverage Report
# uses: actions/upload-artifact@v3
# with:
# name: code-coverage-report
# path: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
# - name: Upload Test Performance Report
# uses: actions/upload-artifact@v3
# with:
# name: tests-performance
# path: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v3
# 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 }}
# fail_ci_if_error: true
# files: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
#
# test-mac:
# name: Tests on MAC
# runs-on: macos-latest
# strategy:
# fail-fast: false
# matrix:
# dotnet: ['net6.0', 'net8.0']
# cloud_env: ['AZURE', 'GCP', 'AWS']
# steps:
# - uses: actions/checkout@v4
# - name: Setup Dotnet
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: |
# 6.0.x
# 8.0.x
# dotnet-quality: 'ga'
# - name: Setup Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.x'
# - name: Setup dotnet-coverage
# run: dotnet tool install --global dotnet-coverage --version 17.8.4
# - name: Decrypt Parameters
# shell: bash
# env:
# PARAMETER_SECRET: ${{ secrets.PARAMETER_SECRET }}
# run: |
# gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETER_SECRET" \
# ./.github/workflows/parameters/parameters_${{ matrix.cloud_env }}.json.gpg > Snowflake.Data.Tests/parameters.json
# - name: Build Driver
# run: |
# dotnet restore
# dotnet build
# - name: Run Tests
# run: |
# cd Snowflake.Data.Tests
# 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
# env:
# snowflake_cloud_env: ${{ matrix.cloud_env }}
# net_version: ${{ matrix.dotnet }}
# - name: Upload Code Coverage Report
# uses: actions/upload-artifact@v3
# with:
# name: code-coverage-report
# path: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
# - name: Upload Test Performance Report
# uses: actions/upload-artifact@v3
# with:
# name: tests-performance
# path: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v3
# 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 }}
# fail_ci_if_error: true
# files: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml
3 changes: 3 additions & 0 deletions Snowflake.Data.Tests/Snowflake.Data.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<AssemblyOriginatorKeyFile>..\sign\publicKey.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<DelaySign>true</DelaySign>
<!--<PlatformTarget>x64</PlatformTarget>-->
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JunitXml.TestLogger" Version="3.1.12" />
Expand All @@ -38,6 +39,8 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Web" />
<Reference Include="System.Net.Http.WebRequest" />
<!--<FrameworkReference Include="Microsoft.AspNetCore.App" />-->
<!--<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />-->
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Snowflake.Data/Snowflake.Data.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0;net471;net472</TargetFrameworks>
<TargetFrameworks>net6.0;net471;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0;net8.0</TargetFrameworks>
<Title>Snowflake.Data</Title>
<PackageId>Snowflake.Data</PackageId>
Expand All @@ -14,7 +14,7 @@
<Authors>Snowflake</Authors>
<Version>3.1.0</Version>
<DebugType>Full</DebugType>
<LangVersion>7.3</LangVersion>
<LangVersion>9</LangVersion>
<AssemblyOriginatorKeyFile>..\sign\publicKey.snk</AssemblyOriginatorKeyFile>
<DelaySign>true</DelaySign>
<SignAssembly>true</SignAssembly>
Expand Down
Loading