cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Is there a temporary AuraDB database for unit testing?

I've learned from documentation that you can create a local temporary neo4j database on localhost, which is self-cleaning after the unit-testing.

However I don't seem to be able to find a equivalent on AuraDB. Is there an API that allows you to programmatically create an ad hoc neo4j database within your AuraDB, and tears down after testing? I'm using Python driver. Thanks.

5 REPLIES 5

Have you considered using test containers based on Docker images. I use them for my unit tests in java. I really like them. I used to create an in-memory instance, but I learned to like this more. 

https://www.testcontainers.org/modules/databases/neo4j/

Sorry, I just realized you are using Python, so this does not apply. 

I just found this.  Maybe this or something else similar may work. 

https://github.com/testcontainers/testcontainers-python

 

Thanks for the reply. Is Docker as light-weight in memory footprint as AuraDB? The reason I chose AuraDB is because my server machine is very memory-constrained. I don't want to run another process for the database.

You will need Docker Destop running and the running neo4j container will have a memory footprint similar to running neo4j locally. This may not be a solution given what you say about limited memory. 

From what I read, you can create one instance per AuraDB free account. Are you the only one running tests, so there is not a concurrency issue with others running tests too?  If so, you could sign up for a free account that you will use for test purposes. After creating the one instance, run all your tests against it. You will need to clear all the data and set up your test data before each test. You can be a little wiser about tear-down/setup if you know a set of test data can be shared across tests in the same test file and it’s read only.

Have another free AuraDB account with an instance for your application. Just a thought.