Skip to content

Garnet Nightly Tests #685

Garnet Nightly Tests

Garnet Nightly Tests #685

Workflow file for this run

name: Garnet Nightly Tests
on:
schedule:
- cron: '0 9 * * *' # Runs at 09:00 UTC, which is 1:00 AM PST
workflow_dispatch:
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
permissions:
contents: read
jobs:
build-test-all:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# ORIGINAL test: [ 'Garnet.test', 'Garnet.test.cluster', 'Tsavorite.test' ]
test: [ 'Garnet.test' ]
# ORIGINAL os: [ ubuntu-22.04, ubuntu-24.04, windows-2022, windows-2025 ]
os: [ windows-2022 ]
framework: [ 'net8.0', 'net9.0' ]
# ORIGINAL configuration: [ 'Debug', 'Release' ]
configuration: [ 'Release' ]
steps:
- name: Install Allure CLI
shell: pwsh
run: |
if ($env:RUNNER_OS -eq "Windows") {
Set-ExecutionPolicy RemoteSigned -Scope Process -Force
iwr -useb get.scoop.sh | iex
scoop install allure
$shimPath = "$env:USERPROFILE\scoop\shims"
echo "Adding Scoop shims to PATH: $shimPath"
echo "$shimPath" | Out-File -Append -Encoding utf8 $env:GITHUB_PATH
} elseif ($env:RUNNER_OS -eq "Linux") {
npm install -g allure-commandline --save-dev
} else {
Write-Host "Unsupported OS: $env:RUNNER_OS"
exit 1
}
- name: DEBUG DEBUG Verify Allure installation
run: allure --version
shell: pwsh
- name: Check out code
uses: actions/checkout@v4
- name: Set workaround for libaio on Ubuntu 24.04 (see https://askubuntu.com/questions/1512196/libaio1-on-noble/1512197#1512197)
run: |
sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1
if: ${{ matrix.os == 'ubuntu-24.04' }}
- name: Set environment variable for Linux
run: echo "RunAzureTests=yes" >> $GITHUB_ENV
if: ${{ matrix.os == 'ubuntu-24.04' }}
- name: Set environment variable for Windows
run: echo ("RunAzureTests=yes") >> $env:GITHUB_ENV
if: ${{ matrix.os == 'windows-2025' }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
- name: Setup Node.js for Azurite
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install and Run Azurite
shell: bash
run: |
npm install -g azurite
azurite &
- name: Install dependencies
run: dotnet restore
# DEBUG DEBUG - Set to continue-on-error: true for now as it is failing and needs to be addressed at some point
# DEBUG DEBUG - name: Check style format
# DEBUG DEBUG run: dotnet format --verify-no-changes --verbosity diagnostic
# DEBUG DEBUG continue-on-error: true
# DEBUG DEBUG - name: Build Tsavorite.test
# DEBUG DEBUG if: ${{ matrix.test == 'Tsavorite.test' }}
# DEBUG DEBUG run: dotnet build libs/storage/Tsavorite/cs/test/Tsavorite.test.csproj --configuration ${{ matrix.configuration }}
- name: Build Garnet
if: ${{ matrix.test != 'Tsavorite.test' }}
run: dotnet build --configuration ${{ matrix.configuration }}
- name: Run tests ${{ matrix.test }}
shell: pwsh
run: |
$resultsDir = "${{ matrix.test }}-${{ matrix.os }}-${{ matrix.framework }}-${{ matrix.configuration }}"
if ("${{ matrix.test }}" -eq "Tsavorite.test") {
dotnet test "libs/storage/Tsavorite/cs/test/Tsavorite.test.csproj" -f "${{ matrix.framework }}" `
--logger "console;verbosity=detailed" `
--logger "trx" `
--results-directory "$resultsDir"
} else {
dotnet test "test/${{ matrix.test }}" -f "${{ matrix.framework }}" `
--logger "console;verbosity=detailed" `
--logger "trx" `
--results-directory "$resultsDir"
}
timeout-minutes: 55
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.test }}-${{ matrix.os }}-${{ matrix.framework }}-${{ matrix.configuration }}
path: ${{ matrix.test }}-${{ matrix.os }}-${{ matrix.framework }}-${{ matrix.configuration }}
if: ${{ always() }}
- name: DEBUG DEBUG path existence using matrix variables
shell: pwsh
run: |
$source = "${{ github.workspace }}/test/Allure/TestData/${{ matrix.framework }}/allure-results"
Write-Host "Checking source path: $source"
if (Test-Path $source) {
Write-Host "Source path exists."
} else {
Write-Host "Source path does NOT exist."
}
if: ${{ always() }}
- name: DEBUG DEBUG Check if allure-results exists
shell: pwsh
run: |
$base = $env:GITHUB_WORKSPACE
$path = Join-Path -Path $base -ChildPath "test/${{ matrix.test }}/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results"
if (-Not (Test-Path $path)) {
Write-Host "No $path found for this matrix combination."
}
if: ${{ always() }}
- name: DEBUG DEBUG Verify allure-results were copied
shell: pwsh
run: |
$dest = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/${{ matrix.test }}/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results"
Write-Host "Contents of ${dest}:"
Get-ChildItem -Path $dest -Recurse | ForEach-Object { Write-Host $_.FullName }
if: ${{ always() }}
- name: Stage allure-results into test/Allure/AllResults
shell: pwsh
run: |
$source = Join-Path $env:GITHUB_WORKSPACE "test/${{ matrix.test }}/bin/${{ matrix.configuration }}/${{ matrix.framework }}/allure-results"
$target = Join-Path $env:GITHUB_WORKSPACE "test/Allure/AllResults"
New-Item -ItemType Directory -Path $target -Force
Get-ChildItem -Path $source -Recurse | Copy-Item -Destination $target -Force
if: ${{ always() }}
- name: Upload Allure Results to artifacts
uses: actions/upload-artifact@v4
with:
name: AllureResults-${{ matrix.os }}-${{ matrix.framework }}-${{ matrix.configuration }}-${{ matrix.test }}
path: test/Allure/AllResults
if: ${{ always() }}
generate-allure-report:
name: Generate Allure Report
runs-on: windows-2022 # makes it easy on how calls made so don't have to worry about windows and linux
needs: [ build-test-all ]
if: ${{ always() }}
steps:
- name: Checkout allure_data_history branch
uses: actions/checkout@v4
with:
ref: allure_data_history
path: history-branch
- name: Copy history from allure_data_history branch into CombinedResults
shell: pwsh
run: |
$source = "${{ github.workspace }}/history-branch/test/allure/history"
$target = "${{ github.workspace }}/test/Allure/CombinedResults/history"
if (Test-Path $source) {
New-Item -ItemType Directory -Path $target -Force
Copy-Item -Path $source -Destination $target -Recurse -Force
Write-Host "History copied from branch into CombinedResults"
} else {
Write-Host "No history found in branch, starting fresh"
}
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Allure CLI
shell: pwsh
run: |
if ($env:RUNNER_OS -eq "Windows") {
Set-ExecutionPolicy RemoteSigned -Scope Process -Force
iwr -useb get.scoop.sh | iex
scoop install allure
$shimPath = "$env:USERPROFILE\scoop\shims"
echo "Adding Scoop shims to PATH: $shimPath"
echo "$shimPath" | Out-File -Append -Encoding utf8 $env:GITHUB_PATH
} elseif ($env:RUNNER_OS -eq "Linux") {
npm install -g allure-commandline --save-dev
} else {
Write-Host "Unsupported OS: $env:RUNNER_OS"
exit 1
}
if: ${{ always() }}
- name: Download all test result artifacts
uses: actions/download-artifact@v4
with:
path: test/Allure/AllResults
if: ${{ always() }}
- name: DEBUG DEBUGShow working directory and contents
shell: pwsh
run: |
$cwd = Get-Location
Write-Host "Current directory: $cwd"
Get-ChildItem -Force
if: ${{ always() }}
- name: DEBUG DEBUGCheck if GenerateAllureReport.ps1 exists
shell: pwsh
run: |
$scriptPath = Join-Path $env:GITHUB_WORKSPACE "test/Allure/GenerateAllureReport.ps1"
if (Test-Path $scriptPath) {
Write-Host "Script found at $scriptPath"
} else {
Write-Host "Script NOT found at $scriptPath"
}
if: ${{ always() }}
- name: DEBUG DEBUGList contents of test/allure/AllResults
shell: pwsh
run: |
$target = Join-Path $env:GITHUB_WORKSPACE "test/allure/AllResults"
Get-ChildItem -Path $target -Recurse
if: ${{ always() }}
- name: Copy all results into one folder (CombinedResults)
shell: pwsh
run: |
$source = Join-Path $env:GITHUB_WORKSPACE "test/Allure/AllResults"
$target = Join-Path $env:GITHUB_WORKSPACE "test/Allure/CombinedResults"
New-Item -ItemType Directory -Path $target -Force
Get-ChildItem -Path $source -Recurse -File | ForEach-Object {
Copy-Item -Path $_.FullName -Destination $target -Force
}
if: ${{ always() }}
- name: DEBUG DEBUG List contents of test/allure/CombinedResults
shell: pwsh
run: |
$target = Join-Path $env:GITHUB_WORKSPACE "test/allure/CombinedResults"
Get-ChildItem -Path $target -Recurse
if: ${{ always() }}
- name: Run GenerateAllureReport.ps1
shell: pwsh
run: |
Set-Location "${{ github.workspace }}/test/Allure"
.\GenerateAllureReport.ps1
if: ${{ always() }}
- name: DEBUG DEBUG Upload Allure history to artifacts so can use for debugging
uses: actions/upload-artifact@v4
with:
name: allure-history
path: test/Allure/allure-report/history
if: ${{ always() }}
- name: Commit updated history to allure_data_history
shell: pwsh
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git fetch origin allure_data_history
git checkout allure_data_history
$source = "${{ github.workspace }}/test/Allure/allure-report/history"
$target = "${{ github.workspace }}/test/allure/history"
Remove-Item -Recurse -Force $target -ErrorAction SilentlyContinue
Copy-Item -Path $source -Destination $target -Recurse -Force
git add test/allure/history
git commit -m "Update Allure history [CI]"
git push origin allure_data_history
- name: Upload Allure HTML report
uses: actions/upload-artifact@v4
with:
name: allure-report
path: test/Allure/allure-report
if: ${{ always() }}
- name: Echo completion
run: echo Done!