-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add Akka.Streams.Kafka.Testkit to support other specs #263
base: dev
Are you sure you want to change the base?
Conversation
|
||
namespace Akka.Streams.Kafka.Testkit.Dsl | ||
{ | ||
public static class ConsumerControlFactory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helper functions for consumer controls
|
||
namespace Akka.Streams.Kafka.Testkit | ||
{ | ||
public static class Extensions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved from Kafka.Test
|
||
namespace Akka.Streams.Kafka.Testkit.Fixture | ||
{ | ||
public abstract class FixtureBase: IAsyncLifetime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified Fixture so that it is flexible enough to support multi-broker cluster
|
||
namespace Akka.Streams.Kafka.Testkit | ||
{ | ||
public class MessageSinkLogger : ILoggingAdapter, IDisposable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ILoggingAdapter for Xunit IMessageSink
/// Specialized deserializer for MemberAssignment. | ||
/// C# AdminClient returns raw bytes that needs to be deserialized into a proper object | ||
/// </summary> | ||
public class MemberAssignment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dotnet Kafka admin client does not deserialize MemberAssignment struct, need to make a custom deserializer for it.
{ | ||
public static class BinaryUtils | ||
{ | ||
public static short ReadInt16BE(this BinaryReader reader) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helper functions to deserialize big-endian bytes, no support in dotnet
@@ -31,8 +32,8 @@ public BugFix240SupervisionStrategy(ITestOutputHelper output, KafkaFixture fixtu | |||
[Fact] | |||
public async Task SupervisionStrategy_Decider_on_Producer_Upstream_should_work() | |||
{ | |||
var topic = CreateTopic(1); | |||
var group = CreateGroup(1); | |||
var topic = CreateTopicName(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these changes in the test classes are cosmetic, making sure that the names are more in step with its intent, creating a topic name and group id, instead vague topic and group which can also means actual topic and group
namespace Akka.Streams.Kafka.Tests | ||
{ | ||
[CollectionDefinition(Name)] | ||
public sealed class KafkaSpecsFixture : ICollectionFixture<KafkaFixture> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collection fixture moved here, separated from the testkit
|
||
namespace Akka.Streams.Kafka.Tests | ||
{ | ||
public sealed class RepeatAttribute : DataAttribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helper attribute for Xunit theory, used to repeat a test X numbers of times, useful for testing racy tests
TimeSpan eosCommitInterval, | ||
IImmutableDictionary<string, string> properties, | ||
Func<ProducerSettings<TKey, TValue>, Task<ProducerSettings<TKey, TValue>>> enrichAsync, | ||
Func<ProducerSettings<TKey, TValue>, IProducer<TKey, TValue>> producerFactory, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added EnrichAsync (not implemented yet) and ProducerFactory
All the changes to the *Test.cs are cosmetic changes, old tests are still using the old KafkaIntegrationTest base class. New ported tests should use the new KafkaSpec base class. The new abstracted fixture should allow for testing multi-broker kafka cluster. Whats missing compared to the JVM implementation is fixture readiness check, they have methods to make sure that the brokers/cluster are ready before starting their test. Dotnet client does not have some of the admin features needed to query these states and the new fixture need to be enhanced with script injection to do these tests right in the container instances themselves. |
This is all meant to be internal right? Not for distribution to users? |
No description provided.