Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update master #201

Merged
merged 2 commits into from
Jan 16, 2025
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
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ updates:
OpenTelemetry:
patterns:
- "OpenTelemetry.*"
Serilog:
patterns:
- "Serilog"
- "Serilog.*"
Hangfire:
patterns:
- "Hangfire"
- "Hangfire.*"
Testcontainers:
patterns:
- "Testcontainers.*"
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Dependabot Auto-Merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'

steps:
- name: Dependabot Metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Dependabot Auto-Merge PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.4" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.1" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="9.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="9.0.0" />
<PackageReference Include="Serilog.sinks.Console" Version="6.0.0" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions samples/SampleStressTest/SampleStressTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.1" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/SampleWebApplication/SampleWebApplication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@

<ItemGroup>
<PackageReference Include="MinVer" Version="6.0.0" PrivateAssets="All" />
<PackageReference Include="Serilog" Version="4.1.0" />
<PackageReference Include="Azure.Data.Tables" Version="12.9.1" />
<PackageReference Include="Serilog" Version="4.2.0" />
<PackageReference Include="Azure.Data.Tables" Version="12.10.0" />
<PackageReference Include="ulid" Version="1.3.4" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;

using FluentAssertions;

using Serilog.Sinks.AzureTableStorage.Extensions;

using Xunit;
Expand All @@ -25,7 +23,7 @@ public DateTimeExtensionsTests(ITestOutputHelper output)
public void GeneratePartitionKeyDateTimeNowRound(DateTime dateTime, DateTime expected, TimeSpan span)
{
var rounded = DateTimeExtensions.Round(dateTime, span);
rounded.Should().Be(expected);
Assert.Equal(expected, rounded);
}

public static IEnumerable<object[]> GetDateRounding()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;

using FluentAssertions;

using Serilog.Sinks.AzureTableStorage.Extensions;

using Xunit;
Expand All @@ -26,20 +24,20 @@ public void GenerateRowKeyDateTimeOffsetNow()
var dateTime = new DateTimeOffset(2024, 4, 1, 23, 0, 0, TimeSpan.FromHours(-5));

var rowKey = DefaultKeyGenerator.GenerateRowKey(dateTime);
rowKey.Should().NotBeNull();
Assert.NotNull(rowKey);

var parsed = Ulid.TryParse(rowKey, out var ulid);
parsed.Should().BeTrue();
ulid.Should().NotBeNull();
Assert.True(parsed);
Assert.NotEqual(default, ulid);

var reversed = dateTime.ToUniversalTime().ToReverseChronological();
var ulidDate = ulid.Time;

ulidDate.Year.Should().Be(reversed.Year);
ulidDate.Month.Should().Be(reversed.Month);
ulidDate.Day.Should().Be(reversed.Day);
ulidDate.Hour.Should().Be(reversed.Hour);
ulidDate.Minute.Should().Be(reversed.Minute);
Assert.Equal(reversed.Year, ulidDate.Year);
Assert.Equal(reversed.Month, ulidDate.Month);
Assert.Equal(reversed.Day, ulidDate.Day);
Assert.Equal(reversed.Hour, ulidDate.Hour);
Assert.Equal(reversed.Minute, ulidDate.Minute);
}


Expand All @@ -49,8 +47,8 @@ public void GeneratePartitionKeyDateTimeOffsetNow()
var dateTime = new DateTimeOffset(2024, 4, 1, 23, 0, 0, TimeSpan.FromHours(-5));

var partitionKey = DefaultKeyGenerator.GeneratePartitionKey(dateTime);
partitionKey.Should().NotBeNull();
partitionKey.Should().Be("2516902703999999999");
Assert.NotNull(partitionKey);
Assert.Equal("2516902703999999999", partitionKey);
}

[Fact]
Expand All @@ -60,17 +58,17 @@ public void GeneratePartitionKeyDateTimeNow()
var eventTime = dateTime.UtcDateTime;

var partitionKey = DefaultKeyGenerator.GeneratePartitionKey(eventTime);
partitionKey.Should().NotBeNull();
partitionKey.Should().Be("2516902703999999999");
Assert.NotNull(partitionKey);
Assert.Equal("2516902703999999999", partitionKey);
}

[Theory]
[MemberData(nameof(GetDateRounding))]
public void GeneratePartitionKeyDateTimeNowRound(DateTimeOffset dateTime, string expected)
{
var partitionKey = DefaultKeyGenerator.GeneratePartitionKey(dateTime);
partitionKey.Should().NotBeNull();
partitionKey.Should().Be(expected);
Assert.NotNull(partitionKey);
Assert.Equal(expected, partitionKey);
}

public static IEnumerable<object[]> GetDateRounding()
Expand Down Expand Up @@ -108,8 +106,8 @@ public void GeneratePartitionKeyQueryDateOnly()
var date = new DateOnly(2024, 4, 1);

var partitionKeyQuery = DefaultKeyGenerator.GeneratePartitionKeyQuery(date, TimeSpan.FromHours(-5));
partitionKeyQuery.Should().NotBeNull();
partitionKeyQuery.Should().Be("(PartitionKey ge '2516902667999999999') and (PartitionKey lt '2516903531999999999')");
Assert.NotNull(partitionKeyQuery);
Assert.Equal("(PartitionKey ge '2516902667999999999') and (PartitionKey lt '2516903531999999999')", partitionKeyQuery);
}

[Fact]
Expand All @@ -122,8 +120,8 @@ public void GeneratePartitionKeyQueryDateTime()
var endTime = endDate.UtcDateTime;

var partitionKeyQuery = DefaultKeyGenerator.GeneratePartitionKeyQuery(startTime, endTime);
partitionKeyQuery.Should().NotBeNull();
partitionKeyQuery.Should().Be("(PartitionKey ge '2516902667999999999') and (PartitionKey lt '2516903531999999999')");
Assert.NotNull(partitionKeyQuery);
Assert.Equal("(PartitionKey ge '2516902667999999999') and (PartitionKey lt '2516903531999999999')", partitionKeyQuery);
}

[Fact]
Expand All @@ -133,8 +131,8 @@ public void GeneratePartitionKeyQueryDateTimeOffset()
var endTime = new DateTimeOffset(2024, 4, 2, 0, 0, 0, TimeSpan.FromHours(-5));

var partitionKeyQuery = DefaultKeyGenerator.GeneratePartitionKeyQuery(startTime, endTime);
partitionKeyQuery.Should().NotBeNull();
partitionKeyQuery.Should().Be("(PartitionKey ge '2516902667999999999') and (PartitionKey lt '2516903531999999999')");
Assert.NotNull(partitionKeyQuery);
Assert.Equal("(PartitionKey ge '2516902667999999999') and (PartitionKey lt '2516903531999999999')", partitionKeyQuery);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit" Version="2.9.3" />
</ItemGroup>

</Project>
Loading