1

I have an application that connects to AWS timestream. I'm currently using python and boto3 to connect to it and do some queries. My current approach to test the queries is to actually load some test data in AWS timestream in some specific tables and then run the queries. To do this I need a real AWS timestream connection and so on, so this looks more like a system integration test.

I want to run a component integration test. Meaning that I want to run the test without the need to connect to a real instance of AWS timestream. I'm coming from the Java world (Spring + Hibernate) where I usually replace a real DB connection (let's say I connect to Oracle DB) with a in-memory DB (like H2), with this approach I can run component integration tests out-of-the-box.

Now the problem that I see is that I can't find an in-memory DB that can use boto3. For example, the first thing that I do during my test is to create a client:

    write_client = session.client('timestream-write',
                              config=Config(read_timeout=20,
                                            max_pool_connections=5000,
                                            retries={'max_attempts': 10}))

I haven't found information about any in-memory DB for which I can replace timestream-write. Moreover, it looks like this is already a signal that I'm in the wrong direction with my whole test approach. My assumption here, is that to do what I want I will need to encapsulate the whole boto3 implementation in one and use a different implementation during tests. This won't make any sense either as I will probably will need to have another implementation to query the DB (without using boto3) which already sounds bad. Therefore, my question is: what is the correct way to do such component integration test? What options do I have?

hfc
  • 614
  • 1
  • 5
  • 13

0 Answers0