Exec tests #366
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Exec tests | |
on: | |
workflow_dispatch: | |
inputs: | |
outOfProc: | |
required: true | |
default: true | |
description: 'Execute Delta Kusto out-of-proc: true or false' | |
jobs: | |
clusterSetup: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Azure Login | |
run: az login --service-principal -u ${{ secrets.deploy_sp_id }} -p ${{ secrets.deploy_sp_secret }} --tenant ${{ secrets.tenant_id }} | |
- name: Azure Subscription Selection | |
run: az account set -n "${{ secrets.TEST_SUB }}" | |
# Add Kusto extension to Azure CLI | |
- name: Install Kusto extension | |
run: az extension add -n kusto | |
# Turn cluster on | |
- name: Turn on cluster (if off) | |
run: | | |
# Retrieve cluster name | |
clusterName=$(az kusto cluster list -g ${{ secrets.test_rg }} --query "[?tags.testLevel=='integration'].name" -o tsv) | |
state=$(az kusto cluster list -g ${{ secrets.test_rg }} --query "[?tags.testLevel=='integration'].state" -o tsv) | |
echo "Cluster Name: $clusterName" | |
echo "State: $state" | |
if [ "$state" == "Stopped" ] | |
then | |
# Actually start the cluster | |
echo "Start cluster" | |
az kusto cluster start -n $clusterName -g ${{ secrets.test_rg }} -n $clusterName | |
else | |
echo "Do nothing" | |
fi | |
linux: | |
needs: | |
- clusterSetup | |
runs-on: ubuntu-latest | |
env: | |
# See OS catalog here: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog | |
dotnetOs: linux-x64 | |
exec: delta-kusto | |
deltaDbPrefix: github_linux_ | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 7.x | |
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-restore | |
- name: Install dependencies | |
shell: bash | |
run: dotnet restore code | |
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build | |
- name: Build | |
shell: bash | |
run: dotnet build code --configuration Release --no-restore | |
# See https://github.com/dotnet/designs/blob/main/accepted/2020/single-file/design.md#user-experience | |
# & https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file | |
# & https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish | |
- name: Build single file executable | |
shell: bash | |
run: | | |
dotnet publish code/delta-kusto -c release -r $dotnetOs --self-contained \ | |
-p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true \ | |
-p:PublishTrimmed=true -p:PublishReadyToRun=true \ | |
-o bin | |
- name: Observe binaries | |
run: ls -l bin | |
- name: Azure CLI Version | |
run: az version | |
- name: Azure Login | |
run: az login --service-principal -u ${{ secrets.deploy_sp_id }} -p ${{ secrets.deploy_sp_secret }} --tenant ${{ secrets.tenant_id }} | |
- name: Azure Subscription Selection | |
run: az account set -n "${{ secrets.TEST_SUB }}" | |
- name: CLI Kusto Extension | |
run: az extension add -n kusto | |
# Set environment variables | |
- name: Set environment variables | |
shell: bash | |
run: | | |
# Fetch cluster context | |
clusterUri=$(az kusto cluster list -g ${{ secrets.test_rg }} --query "[?tags.testLevel=='integration'].uri" -o tsv) | |
deltaKustoSingleExecPath="$(pwd)/bin/$exec" | |
echo "Cluster Uri: $clusterUri" | |
echo "Exec path: $deltaKustoSingleExecPath" | |
echo "Delta DBs prefix: $deltaDbPrefix" | |
# Exec path | |
if [ ${{ github.event.inputs.outOfProc }} == "true" ] | |
then | |
echo "deltaKustoSingleExecPath=$deltaKustoSingleExecPath" >> $GITHUB_ENV | |
fi | |
# ADX integration | |
echo "deltaKustoClusterUri=$clusterUri" >> $GITHUB_ENV | |
echo "deltaKustoDbPrefix=$deltaDbPrefix" >> $GITHUB_ENV | |
echo "deltaKustoTenantId=${{ secrets.test_tenant_id }}" >> $GITHUB_ENV | |
echo "deltaKustoSpId=${{ secrets.deploy_sp_id }}" >> $GITHUB_ENV | |
echo "deltaKustoSpSecret=${{ secrets.deploy_sp_secret }}" >> $GITHUB_ENV | |
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test | |
- name: File-based integration tests (out-of-proc) | |
shell: bash | |
run: | | |
dotnet test code/DeltaKustoFileIntegrationTest \ | |
--configuration Release --no-build --verbosity normal | |
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test | |
- name: ADX-based integration tests (out-of-proc) | |
shell: bash | |
run: | | |
dotnet test code/DeltaKustoAdxIntegrationTest \ | |
--configuration Release --no-build --verbosity normal | |
mac: | |
needs: | |
- clusterSetup | |
# This can run in parallel with the other job as they target different databases | |
runs-on: macos-latest | |
env: | |
# See OS catalog here: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog | |
dotnetOs: osx-x64 | |
exec: delta-kusto | |
deltaDbPrefix: github_mac_os_ | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 7.x | |
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-restore | |
- name: Install dependencies | |
shell: bash | |
run: dotnet restore code | |
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build | |
- name: Build | |
shell: bash | |
run: dotnet build code --configuration Release --no-restore | |
# See https://github.com/dotnet/designs/blob/main/accepted/2020/single-file/design.md#user-experience | |
# & https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file | |
# & https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish | |
- name: Build single file executable | |
shell: bash | |
run: | | |
dotnet publish code/delta-kusto -c release -r $dotnetOs --self-contained \ | |
-p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true \ | |
-p:PublishTrimmed=true -p:PublishReadyToRun=true \ | |
-o bin | |
- name: Observe binaries | |
run: ls -l bin | |
- name: Azure CLI Version | |
run: az version | |
- name: Azure Login | |
run: az login --service-principal -u ${{ secrets.deploy_sp_id }} -p ${{ secrets.deploy_sp_secret }} --tenant ${{ secrets.tenant_id }} | |
- name: Azure Subscription Selection | |
run: az account set -n "${{ secrets.TEST_SUB }}" | |
- name: CLI Kusto Extension | |
run: az extension add -n kusto | |
# Set environment variables | |
- name: Set environment variables | |
shell: bash | |
run: | | |
# Fetch cluster context | |
clusterUri=$(az kusto cluster list -g ${{ secrets.test_rg }} --query "[?tags.testLevel=='integration'].uri" -o tsv) | |
deltaKustoSingleExecPath="$(pwd)/bin/$exec" | |
echo "Cluster Uri: $clusterUri" | |
echo "Exec path: $deltaKustoSingleExecPath" | |
echo "Delta DBs prefix: $deltaDbPrefix" | |
# Exec path | |
if [ ${{ github.event.inputs.outOfProc }} == "true" ] | |
then | |
echo "deltaKustoSingleExecPath=$deltaKustoSingleExecPath" >> $GITHUB_ENV | |
fi | |
# ADX integration | |
echo "deltaKustoClusterUri=$clusterUri" >> $GITHUB_ENV | |
echo "deltaKustoDbPrefix=$deltaDbPrefix" >> $GITHUB_ENV | |
echo "deltaKustoTenantId=${{ secrets.test_tenant_id }}" >> $GITHUB_ENV | |
echo "deltaKustoSpId=${{ secrets.deploy_sp_id }}" >> $GITHUB_ENV | |
echo "deltaKustoSpSecret=${{ secrets.deploy_sp_secret }}" >> $GITHUB_ENV | |
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test | |
- name: File-based integration tests (out-of-proc) | |
shell: bash | |
run: | | |
dotnet test code/DeltaKustoFileIntegrationTest \ | |
--configuration Release --no-build --verbosity normal | |
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test | |
- name: ADX-based integration tests (out-of-proc) | |
shell: bash | |
run: | | |
dotnet test code/DeltaKustoAdxIntegrationTest \ | |
--configuration Release --no-build --verbosity normal | |
windows: | |
needs: | |
- clusterSetup | |
runs-on: windows-latest | |
env: | |
# See OS catalog here: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog | |
dotnetOs: win-x64 | |
exec: delta-kusto.exe | |
deltaDbPrefix: github_win_ | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 7.x | |
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-restore | |
- name: Install dependencies | |
shell: bash | |
run: dotnet restore code | |
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build | |
- name: Build | |
shell: bash | |
run: dotnet build code --configuration Release --no-restore | |
# See https://github.com/dotnet/designs/blob/main/accepted/2020/single-file/design.md#user-experience | |
# & https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file | |
# & https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish | |
- name: Build single file executable | |
shell: bash | |
run: | | |
dotnet publish code/delta-kusto -c release -r $dotnetOs --self-contained \ | |
-p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true \ | |
-p:PublishTrimmed=true -p:PublishReadyToRun=true \ | |
-o bin | |
- name: Observe binaries | |
run: ls -l bin | |
- name: Azure CLI Version | |
run: az version | |
- name: Azure Login | |
run: az login --service-principal -u ${{ secrets.deploy_sp_id }} -p ${{ secrets.deploy_sp_secret }} --tenant ${{ secrets.tenant_id }} | |
- name: Azure Subscription Selection | |
run: az account set -n "${{ secrets.TEST_SUB }}" | |
- name: CLI Kusto Extension | |
run: az extension add -n kusto | |
# Set environment variables | |
- name: Set environment variables | |
shell: bash | |
run: | | |
# Fetch cluster context | |
clusterUri=$(az kusto cluster list -g ${{ secrets.test_rg }} --query "[?tags.testLevel=='integration'].uri" -o tsv) | |
deltaKustoSingleExecPath="$(pwd)/bin/$exec" | |
echo "Cluster Uri: $clusterUri" | |
echo "Exec path: $deltaKustoSingleExecPath" | |
echo "Delta DBs prefix: $deltaDbPrefix" | |
# Exec path | |
if [ ${{ github.event.inputs.outOfProc }} == "true" ] | |
then | |
echo "deltaKustoSingleExecPath=$deltaKustoSingleExecPath" >> $GITHUB_ENV | |
fi | |
# ADX integration | |
echo "deltaKustoClusterUri=$clusterUri" >> $GITHUB_ENV | |
echo "deltaKustoDbPrefix=$deltaDbPrefix" >> $GITHUB_ENV | |
echo "deltaKustoTenantId=${{ secrets.test_tenant_id }}" >> $GITHUB_ENV | |
echo "deltaKustoSpId=${{ secrets.deploy_sp_id }}" >> $GITHUB_ENV | |
echo "deltaKustoSpSecret=${{ secrets.deploy_sp_secret }}" >> $GITHUB_ENV | |
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test | |
- name: File-based integration tests (out-of-proc) | |
shell: bash | |
run: | | |
dotnet test code/DeltaKustoFileIntegrationTest \ | |
--configuration Release --no-build --verbosity normal | |
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test | |
- name: ADX-based integration tests (out-of-proc) | |
shell: bash | |
run: | | |
dotnet test code/DeltaKustoAdxIntegrationTest \ | |
--configuration Release --no-build --verbosity normal |