cloud icon indicating copy to clipboard operation
cloud copied to clipboard

Mechanism to separate local and cloud tests

Open sd-hypredge opened this issue 2 years ago • 2 comments

We use a database that is SaaS in production and a local instance in development. We need the ability to NOT run our integration tests in serverless cloud against our SaaS DB, as it costs us money. while jest has the ability to define specific test regex, serverless cloud seems to be forcing its own path and regex. We need inputs/ guidance/capabilities on separating local tests from cloud tests

sd-hypredge avatar Mar 08 '22 00:03 sd-hypredge

We have been discussing moving some aspects of testing to local, but I'm curious is there any way you could start the integration test database in the cloud or is it all dockerized?

I wonder if we should consider having something like a way to plug in to a fargate task to spin up containers - @jeremydaly? It would incur probably 60 seconds of overhead to start and we'd have resonable limits on how long it could run..

Alternatively, a pattern here would be in your code - like, you'd use some kind of layering pattern to separate out your database stuff in to "drivers", that you can run locally against your database however you like, then use test doubles in the cloud tests. It's not perfect and maybe you have some tweaks but does that strategy make any sense?

dougmoscrop avatar Mar 08 '22 01:03 dougmoscrop

If the tests could run docker in serverless cloud, that would allow me to have a seamless experience. A rather easy way would be for the tests to figure out things for themselves using a flag.

if (serverlesscloud) { test_setup_steps_for_remote_execution } else local_setup

Maybe there is already such a flag that I can use in code ? Pardon my shallow knowledge here, I am just 3 days old to serverless cloud :) Its been great though

sd-hypredge avatar Mar 08 '22 03:03 sd-hypredge