Skip to content

Commit

Permalink
Update reports names to include package version
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jmartinezramirez committed Apr 11, 2024
1 parent 3a6ff67 commit f715cb2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,27 +73,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
Expand All @@ -103,6 +104,7 @@ jobs:
matrix:
dotnet: ['net6.0']
cloud_env: ['AZURE', 'GCP', 'AWS']
pkg_version: ['current']
steps:
- uses: actions/checkout@v3
- name: Setup Dotnet
Expand Down Expand Up @@ -130,27 +132,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
Expand All @@ -160,6 +163,7 @@ jobs:
matrix:
dotnet: ['net6.0']
cloud_env: ['AZURE', 'GCP', 'AWS']
pkg_version: ['current']
steps:
- uses: actions/checkout@v3
- name: Setup Dotnet
Expand Down Expand Up @@ -187,24 +191,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
3 changes: 2 additions & 1 deletion Snowflake.Data.Tests/SFBaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f715cb2

Please sign in to comment.