Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/verify-code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: dotnet restore ${{ env.SOLUTION_FILE }} /p:Configuration=Release /p:NuGetAudit=false --verbosity minimal

- name: Build
run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release /p:RunAnalyzers=false
run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release /p:RunAnalyzers=false /p:GeneratePackageOnBuild=false

- name: CleanupCode (on PR diff)
if: ${{ github.event_name == 'pull_request' }}
Expand All @@ -60,12 +60,12 @@ jobs:

Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash in pull request."
dotnet jb cleanupcode --version
dotnet regitlint -s $env:SOLUTION_FILE --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="Steeltoe Full Cleanup" --jb --no-updates --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
dotnet regitlint -s $env:SOLUTION_FILE --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="Steeltoe Full Cleanup" --jb --no-updates --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --properties:GeneratePackageOnBuild=false --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff

- name: CleanupCode (on branch)
if: ${{ github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'workflow_dispatch' }}
shell: pwsh
run: |
Write-Output 'Running code cleanup on all files.'
dotnet jb cleanupcode --version
dotnet regitlint -s $env:SOLUTION_FILE --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="Steeltoe Full Cleanup" --jb --no-updates --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --verbosity=WARN --fail-on-diff --print-diff
dotnet regitlint -s $env:SOLUTION_FILE --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="Steeltoe Full Cleanup" --jb --no-updates --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --properties:GeneratePackageOnBuild=false --jb --verbosity=WARN --fail-on-diff --print-diff
8 changes: 4 additions & 4 deletions cleanupcode.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $solutionFile = 'src/Steeltoe.All.slnx'

dotnet tool restore
dotnet restore $solutionFile /p:NuGetAudit=false
dotnet build $solutionFile --no-restore --configuration Release /p:RunAnalyzers=false
dotnet build $solutionFile --no-restore --configuration Release /p:RunAnalyzers=false /p:GeneratePackageOnBuild=false

if ($revision) {
$headCommitHash = git rev-parse HEAD
Expand All @@ -22,16 +22,16 @@ if ($revision) {
if ($baseCommitHash -eq $headCommitHash) {
Write-Output "Running code cleanup on staged/unstaged files."
dotnet jb cleanupcode --version
dotnet regitlint -s $solutionFile --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="Steeltoe Full Cleanup" --jb --no-updates --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --verbosity=WARN -f staged,modified
dotnet regitlint -s $solutionFile --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="Steeltoe Full Cleanup" --jb --no-updates --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --properties:GeneratePackageOnBuild=false --jb --verbosity=WARN -f staged,modified
}
else {
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash, including staged/unstaged files."
dotnet jb cleanupcode --version
dotnet regitlint -s $solutionFile --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="Steeltoe Full Cleanup" --jb --no-updates --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --verbosity=WARN -f staged,modified,commits -a $headCommitHash -b $baseCommitHash
dotnet regitlint -s $solutionFile --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="Steeltoe Full Cleanup" --jb --no-updates --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --properties:GeneratePackageOnBuild=false --jb --verbosity=WARN -f staged,modified,commits -a $headCommitHash -b $baseCommitHash
}
}
else {
Write-Output "Running code cleanup on all files."
dotnet jb cleanupcode --version
dotnet regitlint -s $solutionFile --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="Steeltoe Full Cleanup" --jb --no-updates --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --verbosity=WARN
dotnet regitlint -s $solutionFile --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="Steeltoe Full Cleanup" --jb --no-updates --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --properties:GeneratePackageOnBuild=false --jb --verbosity=WARN
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace Steeltoe.Connectors.MySql.DynamicTypeAccess;
/// </summary>
internal sealed class MySqlPackageResolver : PackageResolver
{
private static readonly (string AssemblyName, string PackageName) MySqlConnector = new("MySqlConnector", "MySqlConnector");
private static readonly (string AssemblyName, string PackageName) Oracle = new("MySql.Data", "MySql.Data");
private static readonly (string AssemblyName, string PackageName) MySqlConnector = ("MySqlConnector", "MySqlConnector");
private static readonly (string AssemblyName, string PackageName) Oracle = ("MySql.Data", "MySql.Data");

internal static readonly MySqlPackageResolver MySqlConnectorOnly = new(MySqlConnector.AssemblyName, MySqlConnector.PackageName);
internal static readonly MySqlPackageResolver OracleOnly = new(Oracle.AssemblyName, Oracle.PackageName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace Steeltoe.Connectors.SqlServer.RuntimeTypeAccess;
/// </summary>
internal sealed class SqlServerPackageResolver : PackageResolver
{
private static readonly (string AssemblyName, string PackageName) MicrosoftData = new("Microsoft.Data.SqlClient", "Microsoft.Data.SqlClient");
private static readonly (string AssemblyName, string PackageName) SystemData = new("System.Data.SqlClient", "System.Data.SqlClient");
private static readonly (string AssemblyName, string PackageName) MicrosoftData = ("Microsoft.Data.SqlClient", "Microsoft.Data.SqlClient");
private static readonly (string AssemblyName, string PackageName) SystemData = ("System.Data.SqlClient", "System.Data.SqlClient");

internal static readonly SqlServerPackageResolver MicrosoftDataOnly = new(MicrosoftData.AssemblyName, MicrosoftData.PackageName);
internal static readonly SqlServerPackageResolver SystemDataOnly = new(SystemData.AssemblyName, SystemData.PackageName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public async Task PostgreSQL_Not_Connected_Returns_Down_Status()
string errorMessage = result.Details.Should().ContainKey("error").WhoseValue.As<string>();

errorMessage.Should().Match(error =>
error.StartsWith("NpgsqlException: Failed to connect", StringComparison.Ordinal) ||
error.StartsWith("TimeoutException: ", StringComparison.Ordinal));
error.StartsWith("NpgsqlException: ", StringComparison.Ordinal) || error.StartsWith("TimeoutException: ", StringComparison.Ordinal));
}

[Fact(Skip = "Integration test - Requires local PostgreSQL server")]
Expand Down
10 changes: 6 additions & 4 deletions src/Discovery/test/Eureka.Test/EurekaDiscoveryClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@ public async Task GetInstancesAsync_ReturnsExpected()

var discoveryClient = webApplication.Services.GetRequiredService<EurekaDiscoveryClient>();

discoveryClient.Applications = new ApplicationInfoCollection([
discoveryClient.Applications =
[
new ApplicationInfo("app1", [
new InstanceInfo("id11", "app1", "localhost", "192.168.56.1", new DataCenterInfo(), TimeProvider.System)
{
Expand Down Expand Up @@ -520,7 +521,7 @@ public async Task GetInstancesAsync_ReturnsExpected()
Status = InstanceStatus.OutOfService
}
])
]);
];

IList<IServiceInstance> result = await discoveryClient.GetInstancesAsync("vapp1", TestContext.Current.CancellationToken);

Expand Down Expand Up @@ -555,7 +556,8 @@ public async Task GetApplication_ReturnsExpected()

var discoveryClient = webApplication.Services.GetRequiredService<EurekaDiscoveryClient>();

discoveryClient.Applications = new ApplicationInfoCollection([
discoveryClient.Applications =
[
new ApplicationInfo("app1", [
new InstanceInfo("id1", "app1", "localhost", "192.168.56.1", new DataCenterInfo(), TimeProvider.System)
{
Expand Down Expand Up @@ -584,7 +586,7 @@ public async Task GetApplication_ReturnsExpected()
Status = InstanceStatus.OutOfService
}
])
]);
];

ApplicationInfo? result = discoveryClient.GetApplication("app1");

Expand Down
Loading