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

Bump FluentAssertions and add analyzers #5087

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ public void Extract_IHeadersCollection(
Origin = null,
SamplingPriority = samplingPriority,
IsRemote = true,
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeNull();
}
Expand Down Expand Up @@ -233,7 +234,8 @@ public void Extract_CarrierAndDelegate(
Origin = null,
SamplingPriority = samplingPriority,
IsRemote = true,
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeNull();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ public void Extract_IHeadersCollection(string header, ulong traceIdUpper, ulong
Origin = null,
SamplingPriority = samplingPriority,
IsRemote = true,
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeNull();
}
Expand Down Expand Up @@ -181,7 +182,8 @@ public void Extract_CarrierAndDelegate(string header, ulong traceIdUpper, ulong
Origin = null,
SamplingPriority = samplingPriority,
IsRemote = true,
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeNull();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ public void Extract_IHeadersCollection()
SamplingPriority = SamplingPriority,
PropagatedTags = PropagatedTagsCollection,
IsRemote = true,
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeNull();
}
Expand Down Expand Up @@ -259,7 +260,8 @@ public void Extract_CarrierAndDelegate()
SamplingPriority = SamplingPriority,
PropagatedTags = PropagatedTagsCollection,
IsRemote = true,
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeNull();
}
Expand Down Expand Up @@ -288,7 +290,8 @@ public void Extract_ReadOnlyDictionary()
SamplingPriority = SamplingPriority,
PropagatedTags = PropagatedTagsCollection,
IsRemote = true,
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeNull();
}
Expand Down Expand Up @@ -325,7 +328,8 @@ public void Extract_TraceIdOnly()
RawSpanId = "0000000000000000",
PropagatedTags = EmptyPropagatedTags,
IsRemote = true,
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeNull();
}
Expand Down Expand Up @@ -397,7 +401,8 @@ public void Extract_InvalidSpanId(string spanId)
SamplingPriority = SamplingPriority,
PropagatedTags = PropagatedTagsCollection,
IsRemote = true,
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeNull();
}
Expand Down Expand Up @@ -437,7 +442,8 @@ public void Extract_InvalidSamplingPriority(string samplingPriority, int? expect
SamplingPriority = expectedSamplingPriority,
PropagatedTags = PropagatedTagsCollection,
IsRemote = true,
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeNull();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ public void Extract_ReadOnlyDictionary()
SamplingPriority = SamplingPriority,
PropagatedTags = PropagatedTagsCollection,
AdditionalW3CTraceState = AdditionalW3CTraceState,
});
},
opts => opts.ExcludingMissingMembers());
}

[Fact]
Expand Down Expand Up @@ -134,7 +135,8 @@ public void Extract_TraceIdOnly()
RawTraceId = RawTraceId,
RawSpanId = "0000000000000000",
PropagatedTags = EmptyPropagatedTags,
});
},
opts => opts.ExcludingMissingMembers());

// TODO: add this to all tests
result.Baggage.Should().BeNull();
Expand Down Expand Up @@ -220,7 +222,8 @@ public void Extract_InvalidSpanId(string spanId)
SamplingPriority = SamplingPriority,
PropagatedTags = PropagatedTagsCollection,
AdditionalW3CTraceState = AdditionalW3CTraceState,
});
},
opts => opts.ExcludingMissingMembers());
}

[Theory]
Expand Down Expand Up @@ -261,7 +264,8 @@ public void Extract_InvalidSamplingPriority(string samplingPriority, int? expect
SamplingPriority = expectedSamplingPriority,
PropagatedTags = PropagatedTagsCollection,
AdditionalW3CTraceState = AdditionalW3CTraceState,
});
},
opts => opts.ExcludingMissingMembers());
}

private static Mock<IReadOnlyDictionary<string, string>> SetupMockReadOnlyDictionary()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ public void Extract_B3_IHeadersCollection()
Origin = null,
SamplingPriority = SamplingPriorityValues.AutoKeep,
IsRemote = true,
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeNull();
}
Expand Down Expand Up @@ -397,7 +398,8 @@ public void Extract_B3SingleHeader_IHeadersCollection()
Origin = null,
SamplingPriority = SamplingPriorityValues.AutoKeep,
IsRemote = true,
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeNull();
}
Expand Down Expand Up @@ -432,7 +434,8 @@ public void Extract_W3C_IHeadersCollection_traceparent()
PropagatedTags = EmptyPropagatedTags,
IsRemote = true,
LastParentId = ZeroLastParentId,
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeNull();
}
Expand Down Expand Up @@ -473,7 +476,8 @@ public void Extract_W3C_IHeadersCollection_traceparent_tracestate()
ParentId = null,
IsRemote = true,
LastParentId = ZeroLastParentId,
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeNull();
}
Expand Down Expand Up @@ -518,7 +522,8 @@ public void Extract_Datadog_IHeadersCollection()
SamplingPriority = SamplingPriorityValues.AutoKeep,
PropagatedTags = PropagatedTagsCollection,
IsRemote = true,
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeNull();
}
Expand Down Expand Up @@ -680,7 +685,8 @@ public void TraceContextPrecedence_Respected_WhenHavingMatchingTraceIds(bool ext
ParentId = null,
IsRemote = true,
LastParentId = w3CHeaderFirst ? "0123456789abcdef" : null, // if we have Datadog headers don't use p
});
},
opts => opts.ExcludingMissingMembers());
}

[Theory]
Expand Down Expand Up @@ -734,7 +740,8 @@ public void TraceContextPrecedence_Correct_WithDifferentTracestate(bool extractF
ParentId = null,
IsRemote = true,
LastParentId = w3CHeaderFirst ? "0123456789abcdef" : null, // if we have Datadog headers don't use p
});
},
opts => opts.ExcludingMissingMembers());
}

[Theory]
Expand Down Expand Up @@ -788,7 +795,8 @@ public void TraceContextPrecedence_ExtractedState_WhenMissingDD_OnTracestate(boo
ParentId = null,
IsRemote = true,
LastParentId = w3CHeaderFirst ? ZeroLastParentId : null,
});
},
opts => opts.ExcludingMissingMembers());
}

[Theory]
Expand Down Expand Up @@ -844,7 +852,8 @@ public void TraceContextPrecedence_ConsistentBehaviour_WithDifferentParentId(boo
ParentId = null,
IsRemote = true,
LastParentId = expectW3cParentIds ? "0123456789abcdef" : null,
});
},
opts => opts.ExcludingMissingMembers());
}

[Theory]
Expand Down Expand Up @@ -902,7 +911,8 @@ public void TraceContextPrecedence_ConsistentBehaviour_WithDifferentTraceIds(boo
ParentId = null,
IsRemote = true,
LastParentId = w3CHeaderFirst ? ZeroLastParentId : null,
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeEquivalentTo(new Baggage([new KeyValuePair<string, string>("usr", "customer")]));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ public void Extract_IHeadersCollection()
Parent = null,
ParentId = null,
LastParentId = ZeroLastParentId,
});
},
opts => opts.ExcludingMissingMembers());
}

[Theory]
Expand Down Expand Up @@ -417,7 +418,8 @@ public void Extract_IHeadersCollection_HandlesMultipleEmptyTraceState(params str
Parent = null,
ParentId = null,
LastParentId = ZeroLastParentId,
});
},
opts => opts.ExcludingMissingMembers());
}

[Fact]
Expand Down Expand Up @@ -456,7 +458,8 @@ public void Extract_CarrierAndDelegate()
Parent = null,
ParentId = null,
LastParentId = ZeroLastParentId
});
},
opts => opts.ExcludingMissingMembers());

result.Baggage.Should().BeNull();
}
Expand Down Expand Up @@ -531,7 +534,8 @@ public void Extract_Multiple_TraceState()
Parent = null,
ParentId = null,
LastParentId = "0123456789abcdef",
});
},
opts => opts.ExcludingMissingMembers());
}

[Fact]
Expand Down Expand Up @@ -570,7 +574,8 @@ public void Extract_No_TraceState()
Parent = null,
ParentId = null,
LastParentId = ZeroLastParentId,
});
},
opts => opts.ExcludingMissingMembers());
}

[Fact]
Expand Down Expand Up @@ -707,7 +712,8 @@ public void Extract_MatchingSampled1_UsesTracestateSamplingPriority(int sampling
Parent = null,
ParentId = null,
LastParentId = ZeroLastParentId,
});
},
opts => opts.ExcludingMissingMembers());
}

[Theory]
Expand Down Expand Up @@ -749,7 +755,8 @@ public void Extract_MatchingSampled0_UsesTracestateSamplingPriority(int sampling
Parent = null,
ParentId = null,
LastParentId = ZeroLastParentId,
});
},
opts => opts.ExcludingMissingMembers());
}

[Fact]
Expand Down Expand Up @@ -793,7 +800,8 @@ public void Extract_MismatchingSampled1_UsesSamplingPriorityOf1()
Parent = null,
ParentId = null,
LastParentId = ZeroLastParentId,
});
},
opts => opts.ExcludingMissingMembers());
}

[Fact]
Expand Down Expand Up @@ -837,7 +845,8 @@ public void Extract_MismatchingSampled1_Resets_DecisionMaker()
Parent = null,
ParentId = null,
LastParentId = ZeroLastParentId,
});
},
opts => opts.ExcludingMissingMembers());
}

[Fact]
Expand Down Expand Up @@ -876,7 +885,8 @@ public void Extract_MismatchingSampled0_UsesSamplingPriorityOf0()
Parent = null,
ParentId = null,
LastParentId = ZeroLastParentId,
});
},
opts => opts.ExcludingMissingMembers());
}

[Fact]
Expand Down Expand Up @@ -915,7 +925,8 @@ public void Extract_MismatchingSampled0_Resets_DecisionMaker()
Parent = null,
ParentId = null,
LastParentId = ZeroLastParentId,
});
},
opts => opts.ExcludingMissingMembers());
}

[Fact]
Expand Down Expand Up @@ -954,7 +965,8 @@ public void Extract_Sampled1_MissingSamplingPriority_UsesSamplingPriorityOf1()
Parent = null,
ParentId = null,
LastParentId = ZeroLastParentId,
});
},
opts => opts.ExcludingMissingMembers());
}

[Fact]
Expand Down Expand Up @@ -993,7 +1005,8 @@ public void Extract_Sampled0_MissingSamplingPriority_UsesSamplingPriorityOf0()
Parent = null,
ParentId = null,
LastParentId = ZeroLastParentId,
});
},
opts => opts.ExcludingMissingMembers());
}
}
}
6 changes: 5 additions & 1 deletion tracer/test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions" Version="7.0.0" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.34.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Moq" Version="4.16.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<ItemGroup>
<PackageReference Include="Azure.Data.Tables" Version="12.8.3" />
<PackageReference Include="DelegateDecompiler" Version="0.32.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions" Version="7.0.0" />
<PackageReference Include="MongoDB.Driver" Version="2.8.0" />
<PackageReference Include="Moq" Version="4.16.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftTestSDKVersion)" />
Expand Down
Loading