From dff02f641596d5bc987aeef58005131dd0d45fa6 Mon Sep 17 00:00:00 2001 From: Juan Martinez Ramirez Date: Thu, 11 Apr 2024 14:35:23 -0600 Subject: [PATCH 1/4] Add matrix values to check current and latest version of AWS --- .github/workflows/main.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d0bd7c6bd..94a700123 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,6 +36,7 @@ jobs: matrix: dotnet: ['net6.0', 'net472', 'net471'] cloud_env: ['AZURE', 'GCP', 'AWS'] + pkg_version: ['current', 'latest'] steps: - name: Checkout code uses: actions/checkout@v3 @@ -57,9 +58,17 @@ jobs: 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 + - name: Build Driver Current + if: ${{ matrix.pkg_version == 'current' }} + run: | + cd Snowflake.Data.Tests + dotnet restore + dotnet build -f ${{ matrix.dotnet }} + - name: Build Driver Latest + if: ${{ matrix.pkg_version == 'latest' }} run: | cd Snowflake.Data.Tests + dotnet add ./../Snowflake.Data/Snowflake.Data.csproj package AWSSDK.S3 dotnet restore dotnet build -f ${{ matrix.dotnet }} - name: Run Tests From 55a1fa51a6b2b14eac0a874d4f6214565dd830f8 Mon Sep 17 00:00:00 2001 From: Juan Martinez Ramirez Date: Thu, 11 Apr 2024 15:09:34 -0600 Subject: [PATCH 2/4] Update reports names to include package version --- .github/workflows/main.yml | 29 +++++++++++++++++------------ Snowflake.Data.Tests/SFBaseTest.cs | 3 ++- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 94a700123..fdfa7f766 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,27 +74,28 @@ jobs: - name: Run Tests run: | cd Snowflake.Data.Tests - 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 + dotnet-coverage collect "dotnet test --framework ${{ matrix.dotnet }} --no-build -l console;verbosity=normal" --output windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.pkg_version }}_coverage.xml --output-format cobertura --settings coverage.config env: snowflake_cloud_env: ${{ matrix.cloud_env }} + pkg_version: ${{ matrix.pkg_version }} net_version: ${{ matrix.dotnet }} - name: Upload Code Coverage Report uses: actions/upload-artifact@v3 with: name: code-coverage-report - path: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml + path: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.pkg_version }}_coverage.xml - name: Upload Test Performance Report uses: actions/upload-artifact@v3 with: name: tests-performance - path: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_performance.csv + path: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.pkg_version }}_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\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_coverage.xml + files: Snowflake.Data.Tests\windows_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.pkg_version }}_coverage.xml test-linux: name: Tests on Linux @@ -104,6 +105,7 @@ jobs: matrix: dotnet: ['net6.0'] cloud_env: ['AZURE', 'GCP', 'AWS'] + pkg_version: ['current'] steps: - uses: actions/checkout@v3 - name: Setup Dotnet @@ -131,27 +133,28 @@ jobs: - 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 + dotnet-coverage collect "dotnet test --framework ${{ matrix.dotnet }} --no-build -l console;verbosity=normal" --output linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.pkg_version }}_coverage.xml --output-format cobertura --settings coverage.config env: snowflake_cloud_env: ${{ matrix.cloud_env }} + pkg_version: ${{ matrix.pkg_version }} 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 + path: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.pkg_version }}_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 + path: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.pkg_version }}_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 + files: Snowflake.Data.Tests/linux_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.pkg_version }}_coverage.xml test-mac: name: Tests on MAC @@ -161,6 +164,7 @@ jobs: matrix: dotnet: ['net6.0'] cloud_env: ['AZURE', 'GCP', 'AWS'] + pkg_version: ['current'] steps: - uses: actions/checkout@v3 - name: Setup Dotnet @@ -188,24 +192,25 @@ jobs: - 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 + dotnet-coverage collect "dotnet test --framework ${{ matrix.dotnet }} --no-build -l console;verbosity=normal" --output macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.pkg_version }}_coverage.xml --output-format cobertura --settings coverage.config env: snowflake_cloud_env: ${{ matrix.cloud_env }} + pkg_version: ${{ matrix.pkg_version }} 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 + path: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.pkg_version }}_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 + path: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.pkg_version }}_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 + files: Snowflake.Data.Tests/macos_${{ matrix.dotnet }}_${{ matrix.cloud_env }}_${{ matrix.pkg_version }}_coverage.xml diff --git a/Snowflake.Data.Tests/SFBaseTest.cs b/Snowflake.Data.Tests/SFBaseTest.cs index 6aacb94f9..1ba8ff430 100755 --- a/Snowflake.Data.Tests/SFBaseTest.cs +++ b/Snowflake.Data.Tests/SFBaseTest.cs @@ -246,12 +246,13 @@ public void CreateTestTimeArtifact() var dotnetVersion = Environment.GetEnvironmentVariable("net_version"); var cloudEnv = Environment.GetEnvironmentVariable("snowflake_cloud_env"); + var pkgVersion = Environment.GetEnvironmentVariable("pgk_version"); var separator = Path.DirectorySeparatorChar; // We have to go up 3 times as the working directory path looks as follows: // Snowflake.Data.Tests/bin/debug/{.net_version}/ - File.WriteAllText($"..{separator}..{separator}..{separator}{GetOs()}_{dotnetVersion}_{cloudEnv}_performance.csv", resultText); + File.WriteAllText($"..{separator}..{separator}..{separator}{GetOs()}_{dotnetVersion}_{cloudEnv}_{pkgVersion}_performance.csv", resultText); } private static string s_connectionString => string.Format(ConnectionStringFmt, From bfd824087c0fd56a344986a790044a0d2ed99139 Mon Sep 17 00:00:00 2001 From: Juan Martinez Ramirez Date: Fri, 12 Apr 2024 14:32:00 -0600 Subject: [PATCH 3/4] Typo environment variable --- Snowflake.Data.Tests/SFBaseTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Snowflake.Data.Tests/SFBaseTest.cs b/Snowflake.Data.Tests/SFBaseTest.cs index 1ba8ff430..ce1a9b91e 100755 --- a/Snowflake.Data.Tests/SFBaseTest.cs +++ b/Snowflake.Data.Tests/SFBaseTest.cs @@ -246,7 +246,7 @@ public void CreateTestTimeArtifact() var dotnetVersion = Environment.GetEnvironmentVariable("net_version"); var cloudEnv = Environment.GetEnvironmentVariable("snowflake_cloud_env"); - var pkgVersion = Environment.GetEnvironmentVariable("pgk_version"); + var pkgVersion = Environment.GetEnvironmentVariable("pkg_version"); var separator = Path.DirectorySeparatorChar; From 3a93cb59a0cf229e1bcd8dec19aa9b16ba0f5422 Mon Sep 17 00:00:00 2001 From: Juan Martinez Ramirez Date: Tue, 16 Apr 2024 07:13:15 -0600 Subject: [PATCH 4/4] Added latest check for others cloud providers --- .github/workflows/main.yml | 36 +++++++++++++++++++++++----- Snowflake.Data/Snowflake.Data.csproj | 1 - 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fdfa7f766..ae21d9a8c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,6 +69,8 @@ jobs: run: | cd Snowflake.Data.Tests dotnet add ./../Snowflake.Data/Snowflake.Data.csproj package AWSSDK.S3 + dotnet add ./../Snowflake.Data/Snowflake.Data.csproj package Google.Cloud.Storage.V1 + dotnet add ./../Snowflake.Data/Snowflake.Data.csproj package Azure.Storage.Blobs dotnet restore dotnet build -f ${{ matrix.dotnet }} - name: Run Tests @@ -105,7 +107,7 @@ jobs: matrix: dotnet: ['net6.0'] cloud_env: ['AZURE', 'GCP', 'AWS'] - pkg_version: ['current'] + pkg_version: ['current', 'latest'] steps: - uses: actions/checkout@v3 - name: Setup Dotnet @@ -126,10 +128,21 @@ jobs: 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 + - name: Build Driver Current + if: ${{ matrix.pkg_version == 'current' }} + run: | + cd Snowflake.Data.Tests + dotnet restore + dotnet build -f ${{ matrix.dotnet }} + - name: Build Driver Latest + if: ${{ matrix.pkg_version == 'latest' }} run: | + cd Snowflake.Data.Tests + dotnet add ./../Snowflake.Data/Snowflake.Data.csproj package AWSSDK.S3 + dotnet add ./../Snowflake.Data/Snowflake.Data.csproj package Google.Cloud.Storage.V1 + dotnet add ./../Snowflake.Data/Snowflake.Data.csproj package Azure.Storage.Blobs dotnet restore - dotnet build + dotnet build -f ${{ matrix.dotnet }} - name: Run Tests run: | cd Snowflake.Data.Tests @@ -164,7 +177,7 @@ jobs: matrix: dotnet: ['net6.0'] cloud_env: ['AZURE', 'GCP', 'AWS'] - pkg_version: ['current'] + pkg_version: ['current', 'latest'] steps: - uses: actions/checkout@v3 - name: Setup Dotnet @@ -185,10 +198,21 @@ jobs: 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 + - name: Build Driver Current + if: ${{ matrix.pkg_version == 'current' }} + run: | + cd Snowflake.Data.Tests + dotnet restore + dotnet build -f ${{ matrix.dotnet }} + - name: Build Driver Latest + if: ${{ matrix.pkg_version == 'latest' }} run: | + cd Snowflake.Data.Tests + dotnet add ./../Snowflake.Data/Snowflake.Data.csproj package AWSSDK.S3 + dotnet add ./../Snowflake.Data/Snowflake.Data.csproj package Google.Cloud.Storage.V1 + dotnet add ./../Snowflake.Data/Snowflake.Data.csproj package Azure.Storage.Blobs dotnet restore - dotnet build + dotnet build -f ${{ matrix.dotnet }} - name: Run Tests run: | cd Snowflake.Data.Tests diff --git a/Snowflake.Data/Snowflake.Data.csproj b/Snowflake.Data/Snowflake.Data.csproj index 0621c5fb0..2ff69e17b 100644 --- a/Snowflake.Data/Snowflake.Data.csproj +++ b/Snowflake.Data/Snowflake.Data.csproj @@ -23,7 +23,6 @@ -