flipp-oss / deimos

Framework to work with Kafka, Avro and ActiveRecord
Other
59 stars 22 forks source link

Deimos.unit_test! and Deimos.integration_test! don't reset values correctly #175

Closed dorner closed 1 month ago

dorner commented 1 year ago

The approach suggested by the documentation is as follows:

Deimos.unit_test!
example.run
Deimos.config.reset!

However, reset! will also blow away all producer and consumer configs. This is not what we want to happen. We should introduce a new method, as_unit_test that uses Deimos.with_config instead, e.g.

    Deimos.with_config(
      'logger' => Logger.new(STDOUT),
      'consumers.reraise_errors' => true,
      'kafka.seed_brokers' => ['test_broker'],
      'schema.backend' => Deimos.schema_backend_class.mock_backend,
      'producers.backend' => :test
    ) do
      yield
    end
dorner commented 1 month ago

Going to be handled in v2.