Skip to content

Commit

Permalink
Add tests on the build, trimmed, self-contained command-line binaries
Browse files Browse the repository at this point in the history
.Net gets more and more trimming and compiling features going forward, and, if we e.g. should replace System.Commandline, which
never seems to get out of beta, with another command-line parsing library, I feel much more confident doing this if we have a lot of tests
on the packaged an build binaries too, in addition to the DLLs directly.

I reused the existing unit tests, being a bit creative with the .csproj files and includes. I _hope_ it is a good idea, and that we don't have to
duplicate up any new tests we should write on the migrations for both DLLs/libraries and command-line. Including the files should make the
tests be available for both automagically.

* Add test projects for all databases for compiled command-line grate executable
* Add running of these tests to the Build and Release build pipeline
* Extracted unit test project imports to separate .targets file
  • Loading branch information
erikbra committed Mar 1, 2024
1 parent e4370c7 commit 1c5840e
Show file tree
Hide file tree
Showing 47 changed files with 1,223 additions and 54 deletions.
154 changes: 110 additions & 44 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,8 @@ jobs:
matrix:
arch: [ "win-x64", "win-x86", "win-arm64",
"linux-musl-x64", "linux-musl-arm64", "linux-x64", "linux-arm64",
"osx-x64", "osx-arm64"
"osx-x64"
]

steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
Expand All @@ -126,24 +125,49 @@ jobs:
env:
VERSION: ${{ needs.set-version-number.outputs.nuGetVersion }}

- name: Publish .NET 6/7/8 dependent ${{ matrix.arch }}
run: dotnet publish ./src/grate/grate.csproj -r ${{ matrix.arch }} -c release --no-self-contained -o ./publish/${{ matrix.arch }}/dependent
env:
VERSION: ${{ needs.set-version-number.outputs.nuGetVersion }}

- name: Upload self-contained ${{ matrix.arch }}
if: ${{ needs.set-version-number.outputs.is-release == 'true' }}
#if: ${{ needs.set-version-number.outputs.is-release == 'true' }}
uses: actions/upload-artifact@v3
with:
name: grate-${{ matrix.arch }}-self-contained-${{ needs.set-version-number.outputs.nuGetVersion }}
path: ./publish/${{ matrix.arch }}/self-contained/*

- name: Upload .net dependent ${{ matrix.arch }}
if: ${{ needs.set-version-number.outputs.is-release == 'true' }}

build-standalone-mac-arm64:
name: Build cli
needs: set-version-number

# Use macos-14 to build osx-arm64, it runs on M1, see
# https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/
#
# I've earlier had problems with that the trimmed, self-contained binary for osx-arm64 that was built on Linux
# did not work when opened on an actual mac with arm64.

runs-on: macos-14
strategy:
matrix:
arch: [ "osx-arm64" ]

steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Publish self-contained ${{ matrix.arch }}
run: dotnet publish ./src/grate/grate.csproj -f net8.0 -r ${{ matrix.arch }} -c release --self-contained -p:SelfContained=true -o ./publish/${{ matrix.arch }}/self-contained
env:
VERSION: ${{ needs.set-version-number.outputs.nuGetVersion }}

- name: Upload self-contained ${{ matrix.arch }}
#if: ${{ needs.set-version-number.outputs.is-release == 'true' }}
uses: actions/upload-artifact@v3
with:
name: grate-${{ matrix.arch }}-framework-dependent-${{ needs.set-version-number.outputs.nuGetVersion }}
path: ./publish/${{ matrix.arch }}/dependent/*
name: grate-${{ matrix.arch }}-self-contained-${{ needs.set-version-number.outputs.nuGetVersion }}
path: ./publish/${{ matrix.arch }}/self-contained/*


build-msi:
name: Build MSI
Expand Down Expand Up @@ -248,7 +272,7 @@ jobs:
arch=$(echo ${{ matrix.arch }} | cut -d- -f2 | sed 's/x64/amd64/')
echo "::set-output name=arch::$arch"
- name: Create dpkg # Linux with powershell script? really?
- name: Create dpkg # Linux with powershell script? really? YES! :D
if: ${{ needs.set-version-number.outputs.is-release == 'true' }}
run: ./installers/deb/Create-Package.ps1 -grateExe ./${{ matrix.arch }}/grate -Version "${{ needs.set-version-number.outputs.nuGetVersion }}" -arch ${{ steps.get-arch.outputs.arch}}
env:
Expand All @@ -260,33 +284,6 @@ jobs:
name: grate_${{ needs.set-version-number.outputs.nuGetVersion }}-1_${{ steps.get-arch.outputs.arch}}.deb
path: ./installers/deb/grate_${{ needs.set-version-number.outputs.nuGetVersion }}-1_${{ steps.get-arch.outputs.arch }}.deb

# build-winget:
# name: Winget - Update package manifest in the OWC
# needs:
# - set-version-number
# - build-msi
# runs-on: windows-latest
# if: ${{ needs.set-version-number.outputs.is-release == 'true' }}

# steps:
# - name: Winget-Create
# run: |

# $version = "$($env:version)"

# # Download wingetcreate
# iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe

# $packageUrl="https://github.com/erikbra/grate/releases/download/$version/grate-$version.msi"

# echo "Running ./wingetcreate.exe update erikbra.grate -u $packageUrl -v $version -t `"$env:WINGET_GH_PAT`" --submit"
# ./wingetcreate.exe update erikbra.grate -u $packageUrl -v $version -t "$env:WINGET_GH_PAT" --submit
# env:
# WINGET_GH_PAT: ${{ secrets.WINGET_GH_PAT }}
# #version: "1.4.0"
# version: "${{ needs.set-version-number.outputs.nuGetVersion }}"


test:
name: Run tests

Expand All @@ -302,12 +299,81 @@ jobs:
with:
dotnet-version: 8.0.x
- name: Test
run: |
dotnet test \
unittests/${{ matrix.category }} \
--logger:"xunit;LogFilePath=/tmp/test-results/${{ matrix.category }}.xml" -- \
-MaxCpuCount 2
run: >
dotnet test
unittests/${{ matrix.category }}
--logger:"xunit;LogFilePath=/tmp/test-results/${{ matrix.category }}.xml" --
-MaxCpuCount 2
env:
LogLevel: Warning
TZ: UTC

integration-test:
name: Tests cli
needs:
- set-version-number
- build-standalone

strategy:
# We could really like to:
# - Start each database (on another host, using Docker, or other means, e.g. Azure SQL, etc
# - On all architectures available (windows-latest, linux-latest, macos-latest, and macos-14),
# - Run command-line tests against each database.
#
# This way, we can test against all variations of each database too, e.g. Azure SQL, SQL Server "on prem" (in docker),
# hosted Oracle databases, aws databases, etc. But we need to find a way to provision these databases both very fast,
# and cheap, for each one.
matrix:
category:
- CommandLine.SqlServer
- CommandLine.PostgreSQL
- CommandLine.MariaDB
- CommandLine.Sqlite
- CommandLine.Oracle
os:
# We can only run tests on Linux for now, until we start the database separately somewhere (azure, something)
# and run against an external database. Because the commandline tests are also for now _dependent_ on
# TestContainers, and running the database in a container using Docker. And Docker is only available on Linux
# on Github actions.
# - name: windows-latest
# arch: win-x64
# executable: grate.exe
- name: ubuntu-latest
arch: linux-x64
executable: grate
# - name: macos-latest
# arch: osx-x64
# executable: grate
# macos-14 is M1 (arm64)
# - name: macos-14
# arch: osx-x64
# executable: grate

runs-on: ${{ matrix.os.name }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: grate-${{ matrix.os.arch }}-self-contained-${{ needs.set-version-number.outputs.nuGetVersion }}
path: executables/${{ matrix.os.arch }}
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: chmod u+x
run: chmod u+x $GrateExecutablePath
if: ${{ matrix.os.arch != 'win-x64' }}
env:
GrateExecutablePath: ${{ github.workspace }}/executables/${{ matrix.os.arch }}/${{ matrix.os.executable }}
- name: Test
run: >
dotnet test
unittests/CommandLine/${{ matrix.category }}
--logger:"xunit;LogFilePath=/tmp/test-results/${{ matrix.os.arch }}/${{ matrix.category }}.xml" --
-MaxCpuCount 2
env:
LogLevel: Warning
GrateExecutablePath: ${{ github.workspace }}/executables/${{ matrix.os.arch }}/${{ matrix.os.executable }}
TZ: UTC

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,5 @@ MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
/grate/Properties/launchSettings.json

.DS_Store
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="xunit" Version="2.7.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7" />
<PackageVersion Include="xunit.runner.utility" Version="2.7.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="XunitXml.TestLogger" Version="3.1.20" />
Expand Down
96 changes: 96 additions & 0 deletions grate.sln
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "grate.core", "src\grate.cor
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "grate", "src\grate\grate.csproj", "{9D3377C2-1E3C-40C9-A5F1-DF41DFDFDD9D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Command line tests", "Command line tests", "{04731BDA-05F0-4275-AC70-3E60E87F9461}"
ProjectSection(SolutionItems) = preProject
unittests\CommandLine\IncludeTests.targets = unittests\CommandLine\IncludeTests.targets
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandLine.Common", "unittests\CommandLine\CommandLine.Common\CommandLine.Common.csproj", "{DB220C5D-7B52-4389-B568-793FCD4286AA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandLine.MariaDB", "unittests\CommandLine\CommandLine.MariaDB\CommandLine.MariaDB.csproj", "{088D2F44-26AE-4DCE-9668-8B8A38EDD5EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandLine.Sqlite", "unittests\CommandLine\CommandLine.Sqlite\CommandLine.Sqlite.csproj", "{ABFC5823-ACCF-4CFC-9EDA-90F7DD8A930B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandLine.Oracle", "unittests\CommandLine\CommandLine.Oracle\CommandLine.Oracle.csproj", "{BD31AD42-D1A0-4131-9DD5-7DA83F3F34A8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandLine.PostgreSQL", "unittests\CommandLine\CommandLine.PostgreSQL\CommandLine.PostgreSQL.csproj", "{89CBE842-BD34-4833-96B4-9E410C5C6AD7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandLine.SqlServer", "unittests\CommandLine\CommandLine.SqlServer\CommandLine.SqlServer.csproj", "{3CD81B8C-9348-4F45-9E50-12713D47B1FB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -233,6 +250,78 @@ Global
{9D3377C2-1E3C-40C9-A5F1-DF41DFDFDD9D}.Release|x64.Build.0 = Release|Any CPU
{9D3377C2-1E3C-40C9-A5F1-DF41DFDFDD9D}.Release|x86.ActiveCfg = Release|Any CPU
{9D3377C2-1E3C-40C9-A5F1-DF41DFDFDD9D}.Release|x86.Build.0 = Release|Any CPU
{DB220C5D-7B52-4389-B568-793FCD4286AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DB220C5D-7B52-4389-B568-793FCD4286AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DB220C5D-7B52-4389-B568-793FCD4286AA}.Debug|x64.ActiveCfg = Debug|Any CPU
{DB220C5D-7B52-4389-B568-793FCD4286AA}.Debug|x64.Build.0 = Debug|Any CPU
{DB220C5D-7B52-4389-B568-793FCD4286AA}.Debug|x86.ActiveCfg = Debug|Any CPU
{DB220C5D-7B52-4389-B568-793FCD4286AA}.Debug|x86.Build.0 = Debug|Any CPU
{DB220C5D-7B52-4389-B568-793FCD4286AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DB220C5D-7B52-4389-B568-793FCD4286AA}.Release|Any CPU.Build.0 = Release|Any CPU
{DB220C5D-7B52-4389-B568-793FCD4286AA}.Release|x64.ActiveCfg = Release|Any CPU
{DB220C5D-7B52-4389-B568-793FCD4286AA}.Release|x64.Build.0 = Release|Any CPU
{DB220C5D-7B52-4389-B568-793FCD4286AA}.Release|x86.ActiveCfg = Release|Any CPU
{DB220C5D-7B52-4389-B568-793FCD4286AA}.Release|x86.Build.0 = Release|Any CPU
{088D2F44-26AE-4DCE-9668-8B8A38EDD5EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{088D2F44-26AE-4DCE-9668-8B8A38EDD5EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{088D2F44-26AE-4DCE-9668-8B8A38EDD5EE}.Debug|x64.ActiveCfg = Debug|Any CPU
{088D2F44-26AE-4DCE-9668-8B8A38EDD5EE}.Debug|x64.Build.0 = Debug|Any CPU
{088D2F44-26AE-4DCE-9668-8B8A38EDD5EE}.Debug|x86.ActiveCfg = Debug|Any CPU
{088D2F44-26AE-4DCE-9668-8B8A38EDD5EE}.Debug|x86.Build.0 = Debug|Any CPU
{088D2F44-26AE-4DCE-9668-8B8A38EDD5EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{088D2F44-26AE-4DCE-9668-8B8A38EDD5EE}.Release|Any CPU.Build.0 = Release|Any CPU
{088D2F44-26AE-4DCE-9668-8B8A38EDD5EE}.Release|x64.ActiveCfg = Release|Any CPU
{088D2F44-26AE-4DCE-9668-8B8A38EDD5EE}.Release|x64.Build.0 = Release|Any CPU
{088D2F44-26AE-4DCE-9668-8B8A38EDD5EE}.Release|x86.ActiveCfg = Release|Any CPU
{088D2F44-26AE-4DCE-9668-8B8A38EDD5EE}.Release|x86.Build.0 = Release|Any CPU
{ABFC5823-ACCF-4CFC-9EDA-90F7DD8A930B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ABFC5823-ACCF-4CFC-9EDA-90F7DD8A930B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ABFC5823-ACCF-4CFC-9EDA-90F7DD8A930B}.Debug|x64.ActiveCfg = Debug|Any CPU
{ABFC5823-ACCF-4CFC-9EDA-90F7DD8A930B}.Debug|x64.Build.0 = Debug|Any CPU
{ABFC5823-ACCF-4CFC-9EDA-90F7DD8A930B}.Debug|x86.ActiveCfg = Debug|Any CPU
{ABFC5823-ACCF-4CFC-9EDA-90F7DD8A930B}.Debug|x86.Build.0 = Debug|Any CPU
{ABFC5823-ACCF-4CFC-9EDA-90F7DD8A930B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ABFC5823-ACCF-4CFC-9EDA-90F7DD8A930B}.Release|Any CPU.Build.0 = Release|Any CPU
{ABFC5823-ACCF-4CFC-9EDA-90F7DD8A930B}.Release|x64.ActiveCfg = Release|Any CPU
{ABFC5823-ACCF-4CFC-9EDA-90F7DD8A930B}.Release|x64.Build.0 = Release|Any CPU
{ABFC5823-ACCF-4CFC-9EDA-90F7DD8A930B}.Release|x86.ActiveCfg = Release|Any CPU
{ABFC5823-ACCF-4CFC-9EDA-90F7DD8A930B}.Release|x86.Build.0 = Release|Any CPU
{BD31AD42-D1A0-4131-9DD5-7DA83F3F34A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD31AD42-D1A0-4131-9DD5-7DA83F3F34A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD31AD42-D1A0-4131-9DD5-7DA83F3F34A8}.Debug|x64.ActiveCfg = Debug|Any CPU
{BD31AD42-D1A0-4131-9DD5-7DA83F3F34A8}.Debug|x64.Build.0 = Debug|Any CPU
{BD31AD42-D1A0-4131-9DD5-7DA83F3F34A8}.Debug|x86.ActiveCfg = Debug|Any CPU
{BD31AD42-D1A0-4131-9DD5-7DA83F3F34A8}.Debug|x86.Build.0 = Debug|Any CPU
{BD31AD42-D1A0-4131-9DD5-7DA83F3F34A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD31AD42-D1A0-4131-9DD5-7DA83F3F34A8}.Release|Any CPU.Build.0 = Release|Any CPU
{BD31AD42-D1A0-4131-9DD5-7DA83F3F34A8}.Release|x64.ActiveCfg = Release|Any CPU
{BD31AD42-D1A0-4131-9DD5-7DA83F3F34A8}.Release|x64.Build.0 = Release|Any CPU
{BD31AD42-D1A0-4131-9DD5-7DA83F3F34A8}.Release|x86.ActiveCfg = Release|Any CPU
{BD31AD42-D1A0-4131-9DD5-7DA83F3F34A8}.Release|x86.Build.0 = Release|Any CPU
{89CBE842-BD34-4833-96B4-9E410C5C6AD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{89CBE842-BD34-4833-96B4-9E410C5C6AD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{89CBE842-BD34-4833-96B4-9E410C5C6AD7}.Debug|x64.ActiveCfg = Debug|Any CPU
{89CBE842-BD34-4833-96B4-9E410C5C6AD7}.Debug|x64.Build.0 = Debug|Any CPU
{89CBE842-BD34-4833-96B4-9E410C5C6AD7}.Debug|x86.ActiveCfg = Debug|Any CPU
{89CBE842-BD34-4833-96B4-9E410C5C6AD7}.Debug|x86.Build.0 = Debug|Any CPU
{89CBE842-BD34-4833-96B4-9E410C5C6AD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{89CBE842-BD34-4833-96B4-9E410C5C6AD7}.Release|Any CPU.Build.0 = Release|Any CPU
{89CBE842-BD34-4833-96B4-9E410C5C6AD7}.Release|x64.ActiveCfg = Release|Any CPU
{89CBE842-BD34-4833-96B4-9E410C5C6AD7}.Release|x64.Build.0 = Release|Any CPU
{89CBE842-BD34-4833-96B4-9E410C5C6AD7}.Release|x86.ActiveCfg = Release|Any CPU
{89CBE842-BD34-4833-96B4-9E410C5C6AD7}.Release|x86.Build.0 = Release|Any CPU
{3CD81B8C-9348-4F45-9E50-12713D47B1FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3CD81B8C-9348-4F45-9E50-12713D47B1FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3CD81B8C-9348-4F45-9E50-12713D47B1FB}.Debug|x64.ActiveCfg = Debug|Any CPU
{3CD81B8C-9348-4F45-9E50-12713D47B1FB}.Debug|x64.Build.0 = Debug|Any CPU
{3CD81B8C-9348-4F45-9E50-12713D47B1FB}.Debug|x86.ActiveCfg = Debug|Any CPU
{3CD81B8C-9348-4F45-9E50-12713D47B1FB}.Debug|x86.Build.0 = Debug|Any CPU
{3CD81B8C-9348-4F45-9E50-12713D47B1FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3CD81B8C-9348-4F45-9E50-12713D47B1FB}.Release|Any CPU.Build.0 = Release|Any CPU
{3CD81B8C-9348-4F45-9E50-12713D47B1FB}.Release|x64.ActiveCfg = Release|Any CPU
{3CD81B8C-9348-4F45-9E50-12713D47B1FB}.Release|x64.Build.0 = Release|Any CPU
{3CD81B8C-9348-4F45-9E50-12713D47B1FB}.Release|x86.ActiveCfg = Release|Any CPU
{3CD81B8C-9348-4F45-9E50-12713D47B1FB}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -256,5 +345,12 @@ Global
{69DE6B9D-F937-4AF4-A75E-40F5507B4C83} = {34C2458F-1244-4AF5-B5B5-B349CAEB17A5}
{3BAF5373-6009-405B-AC9D-C8FFFB263E6B} = {34C2458F-1244-4AF5-B5B5-B349CAEB17A5}
{9D3377C2-1E3C-40C9-A5F1-DF41DFDFDD9D} = {34C2458F-1244-4AF5-B5B5-B349CAEB17A5}
{04731BDA-05F0-4275-AC70-3E60E87F9461} = {CE4BF96D-E795-49EC-BB36-EDCC7E542685}
{DB220C5D-7B52-4389-B568-793FCD4286AA} = {04731BDA-05F0-4275-AC70-3E60E87F9461}
{088D2F44-26AE-4DCE-9668-8B8A38EDD5EE} = {04731BDA-05F0-4275-AC70-3E60E87F9461}
{ABFC5823-ACCF-4CFC-9EDA-90F7DD8A930B} = {04731BDA-05F0-4275-AC70-3E60E87F9461}
{BD31AD42-D1A0-4131-9DD5-7DA83F3F34A8} = {04731BDA-05F0-4275-AC70-3E60E87F9461}
{89CBE842-BD34-4833-96B4-9E410C5C6AD7} = {04731BDA-05F0-4275-AC70-3E60E87F9461}
{3CD81B8C-9348-4F45-9E50-12713D47B1FB} = {04731BDA-05F0-4275-AC70-3E60E87F9461}
EndGlobalSection
EndGlobal
2 changes: 2 additions & 0 deletions src/grate.core/Configuration/FoldersConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public FoldersConfiguration()
public MigrationsFolder? DropDatabase { get; set; }

public static FoldersConfiguration Empty => new();

public override string ToString() => string.Join(';', Values);

public static IFoldersConfiguration Default(IKnownFolderNames? folderNames = null)
{
Expand Down
2 changes: 2 additions & 0 deletions src/grate.core/Configuration/MigrationsFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ public MigrationsFolder(
: this(name, name, type, connectionType, transactionHandling)
{ }

public override string ToString() =>
$"{Name}=path:{Path},type:{Type},connectionType:{ConnectionType},transactionHandling:{TransactionHandling}";
}
1 change: 1 addition & 0 deletions src/grate.core/Infrastructure/GrateEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ private bool IsForCurrentEnvironment(string path) =>
public static bool IsEnvironmentFile(string fileName) => fileName.Contains(EnvironmentMarker, InvariantCultureIgnoreCase);
private static string FileName(string path) => new FileInfo(path).Name;

public override string ToString() => Current;
}
5 changes: 5 additions & 0 deletions src/grate.core/grate.core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<InternalsVisibleTo Include="Sqlite" />
<InternalsVisibleTo Include="SqlServer" />
<InternalsVisibleTo Include="SqlServerCaseSensitive" />
<InternalsVisibleTo Include="CommandLine.MariaDB" />
<InternalsVisibleTo Include="CommandLine.Oracle" />
<InternalsVisibleTo Include="CommandLine.PostgreSQL" />
<InternalsVisibleTo Include="CommandLine.Sqlite" />
<InternalsVisibleTo Include="CommandLine.SqlServer" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions src/grate/grate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@

<ItemGroup>
<InternalsVisibleTo Include="Basic_tests" />
<InternalsVisibleTo Include="CommandLine.Common" />
<InternalsVisibleTo Include="CommandLine.MariaDB" />
<InternalsVisibleTo Include="CommandLine.Oracle" />
<InternalsVisibleTo Include="CommandLine.PostgreSQL" />
<InternalsVisibleTo Include="CommandLine.Sqlite" />
<InternalsVisibleTo Include="CommandLine.SqlServer" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 1c5840e

Please sign in to comment.