snowflakedb / snowflake-ingest-java

Java SDK for the Snowflake Ingest Service -
http://www.snowflake.net
Apache License 2.0
69 stars 54 forks source link

fake/noop implementations of SnowflakeStreamingIngestClient and SnowflakeStreamingIngestChannel #764

Open jdcaperon opened 4 months ago

jdcaperon commented 4 months ago

Is there any interest in a contribution of a set of fakes for the SnowflakeStreamingIngestClient and channel in order to support easier testing for downstream users. Understandably it adds overhead for support so I can understand a lack of interest. I'd be happy to upstream some simple internal fakes I am building for testing if that's interesting.

I see that there is support for a form of testing mode in the builder of the of client but AFAICT this does not extend to channels.

https://github.com/snowflakedb/snowflake-ingest-java/blob/5e93b3d7d645e8ca61a137081362e88319ee538f/src/main/java/net/snowflake/ingest/streaming/SnowflakeStreamingIngestClientFactory.java#L48-L51

Largely the fakes themselves can be very simple as the API itself is rather plain. The only possible complication is the table schema API since there is no obvious construction for it. https://github.com/snowflakedb/snowflake-ingest-java/blob/master/src/main/java/net/snowflake/ingest/streaming/SnowflakeStreamingIngestChannel.java#L282-L289

In particular fakes become very useful when working with many channels as mocking channels that are dynamically created but also dynamically closed etc is quite tedious.

Happy to hear thoughts and suggestions cheers.