Conversation
ray-kast
left a comment
There was a problem hiding this comment.
Gonna make some ergonomic fixes and review our options for scaffolding tests
3951ed4 to
045878d
Compare
| @@ -0,0 +1,27 @@ | |||
| delete from metadatas where address = any(array [ | |||
There was a problem hiding this comment.
Normally unit tests involving databases are done in transaction that leave the db empty after each unit test but since we are only doing read operations seeding with a shared set of data works for our use case.
There was a problem hiding this comment.
Seconding this. I like the migration setup. It would be awesome to be able to define a migration per test in such a way that we could run up and down for a specific migration for each test, just to keep the db minimally populated with test-specific data.
This is a great start, though!
austinmilt
left a comment
There was a problem hiding this comment.
looks awesome!
| dotenv::from_filename(".env.dev").expect("Failed to load .env.dev"); | ||
| dotenv::from_filename(".env").expect("Failed to load .env"); |
There was a problem hiding this comment.
should this also read from .env.local?
There was a problem hiding this comment.
I chose not to as an attempt to enforce consistency in the test setup. Unsure if that will pay off, but if we need .env.local at some point I'll cave and add it.
| @@ -0,0 +1,27 @@ | |||
| delete from metadatas where address = any(array [ | |||
There was a problem hiding this comment.
Seconding this. I like the migration setup. It would be awesome to be able to define a migration per test in such a way that we could run up and down for a specific migration for each test, just to keep the db minimally populated with test-specific data.
This is a great start, though!
53f46fa to
080e74f
Compare
080e74f to
b1f2acd
Compare
This PR adds initial setup for running tests against DB queries. Right now it's primarily testing the collections queries. This will ensure that if fields required for deserialing
Nftchange, the build will fail.