Skip to content

Commit ba3461c

Browse files
committed
UnitTests: Fix hex check on metadata git hash
1 parent ad2f1e6 commit ba3461c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

API.IntegrationTests/API.IntegrationTests.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,13 @@
1515
<PackageReference Include="Testcontainers.Redis" />
1616
<PackageReference Include="TUnit" />
1717
</ItemGroup>
18+
19+
<!-- Git stuff -->
20+
<Target Name="SetHash" AfterTargets="InitializeSourceControlInformation">
21+
<ItemGroup>
22+
<AssemblyAttribute Include="OpenShock.Common.Utils.GitHashAttribute">
23+
<_Parameter1>$(SourceRevisionId)</_Parameter1>
24+
</AssemblyAttribute>
25+
</ItemGroup>
26+
</Target>
1827
</Project>

API.IntegrationTests/Tests/MetadataTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public async Task GetMetadata_ShouldMatchBackendInfoResponseContract()
3838

3939
// Validate Commit
4040
var commit = data.GetProperty("commit").GetString();
41-
await Assert.That(commit).Matches("[a-zA-Z0-9]{4,64}");
41+
await Assert.That(commit).Matches("[a-fA-F0-9]{4,64}");
4242

4343
// Validate CurrentTime
4444
var currentTime = data.GetProperty("currentTime").GetDateTimeOffset();

0 commit comments

Comments
 (0)