Skip to content

tests

tests #2150

Workflow file for this run

name: tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
# For detect flaky tests
schedule:
- cron: "45 * * * *"
jobs:
unit-tests:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, windows-2022, macos-12 ]
dotnet-version: [ 6.0.x, 7.0.x ]
include:
- dotnet-version: 6.0.x
dotnet-target-framework: net6.0
- dotnet-version: 7.0.x
dotnet-target-framework: net7.0
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Test
run: |
cd src
dotnet test --filter "Category=Unit" -f ${{ matrix.dotnet-target-framework }}
ado-net-tests:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
ydb-version: [ 'trunk' ]
dotnet-version: [ 6.0.x, 7.0.x ]
include:
- dotnet-version: 6.0.x
dotnet-target-framework: net6.0
- dotnet-version: 7.0.x
dotnet-target-framework: net7.0
services:
ydb:
image: cr.yandex/yc/yandex-docker-local-ydb:${{ matrix.ydb-version }}
ports:
- 2135:2135
- 2136:2136
- 8765:8765
env:
YDB_LOCAL_SURVIVE_RESTART: true
YDB_USE_IN_MEMORY_PDISKS: true
options: '--name ydb-local -h localhost'
env:
OS: ubuntu-22.04
YDB_VERSION: ${{ matrix.ydb-version }}
YDB_CONNECTION_STRING: grpc://localhost:2136/local
YDB_CONNECTION_STRING_SECURE: grpcs://localhost:2135/local
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Run ADO.NET tests
run: |
docker cp ydb-local:/ydb_certs/ca.pem ~/
cd src
dotnet test --filter "(FullyQualifiedName~Ado) | (FullyQualifiedName~Dapper)" -l "console;verbosity=normal"
core-integration-tests:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
ydb-version: [ 'trunk' ]
dotnet-version: [ 6.0.x, 7.0.x ]
include:
- dotnet-version: 6.0.x
dotnet-target-framework: net6.0
- dotnet-version: 7.0.x
dotnet-target-framework: net7.0
services:
ydb:
image: cr.yandex/yc/yandex-docker-local-ydb:${{ matrix.ydb-version }}
ports:
- 2135:2135
- 2136:2136
- 8765:8765
env:
YDB_LOCAL_SURVIVE_RESTART: true
YDB_USE_IN_MEMORY_PDISKS: true
options: '--name ydb-local -h localhost'
env:
OS: ubuntu-22.04
YDB_VERSION: ${{ matrix.ydb-version }}
YDB_CONNECTION_STRING: grpc://localhost:2136/local
YDB_CONNECTION_STRING_SECURE: grpcs://localhost:2135/local
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Integration test
run: |
docker cp ydb-local:/ydb_certs/ca.pem ~/
cd src
dotnet test --filter "Category=Integration" -f ${{ matrix.dotnet-target-framework }} -l "console;verbosity=normal"
run-examples:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
ydb-version: [ 'latest', '24.1' ]
dotnet-version: [ 6.0.x, 7.0.x ]
include:
- dotnet-version: 6.0.x
dotnet-target-framework: net6.0
- dotnet-version: 7.0.x
dotnet-target-framework: net7.0
services:
ydb:
image: cr.yandex/yc/yandex-docker-local-ydb:${{ matrix.ydb-version }}
ports:
- 2135:2135
- 2136:2136
- 8765:8765
env:
YDB_LOCAL_SURVIVE_RESTART: true
YDB_USE_IN_MEMORY_PDISKS: true
options: '--name ydb-local -h localhost'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Run ADO.NET examples
run: |
docker cp ydb-local:/ydb_certs/ca.pem ~/
cd ./examples/src/AdoNet
dotnet run
- name: Run Dapper example
run: |
cd ./examples/src/DapperExample
dotnet run