Pg_tmp – Run tests on an isolated, temporary PostgreSQL database

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • integresql

    IntegreSQL manages isolated PostgreSQL databases for your integration tests.

  • I haven't had a change to try it yet, but IntegreSQL[0] looks like this on steroids. It allows you to create a template (runs migrations and seed dates), and then uses Postgres's built in cloning functionality to maintain a pool of fresh databases. They claim 500ms to clone a database without the pool, and that the pool pretty much hides the latency entirely.

    [0]: https://github.com/allaboutapps/integresql

  • entr

    Run arbitrary commands when files change

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • rush

    Production-driven prototyping. This starter is setup in a production-friendly way and will setup tests + dev environment exactly like a live project will work. Works the same both on your laptop or Github CI, so you can go from hacking on your laptop to a full gitops environment. (by RedCarpetUp)

  • for python - i have a fully setup template that creates a scratch postgresql db, loads the schema and then tears it down.

    its pre-integrated with Black, types, etc

    https://github.com/RedCarpetUp/rush

  • localstripe

    A fake but stateful Stripe server that you can run locally, for testing purposes.

  • Anyway, I won't go as far as saying that mocks are useful, sometimes a mock is the easiest and best way -- but I can say that I spend most of my time writing E2E tests, and I trust them a lot and they give me trust in my codebase much more than mocks or unit tests do. I barely write unit tests anymore to check edge cases, because if I really cared I'd just generate them -- and I don't really have to care because I use strong type systems where possible (Typescript for JS, I avoid PHP/Python/Ruby, Rust, Haskell).

    Here comes the hot-take -- unit tests (and their rise in popularity/necessity) is actually a direct reflection of the adoption of non-compile-time-type-checked dynamically interpreted languages, and burdensome class-based "type systems". Correct usage of good, expressive and concise (where possible) type systems encourages you to make invalid/nonsensical states impossible, and people got excited about how fast you could churn out code (compared to Java most things feel pretty productive) and they started having numbers where they thought they had strings, and negative numbers where they thought they had natural numbers. Good type systems make it easy to make these cases impossible. As for the business stuff (never store decimals for currency, make sure your amounts are natural numbers, etc), you have to learn that with time/intuition built over time -- you don't know to write that unit test unless it's bit you before (though sitting down to write unit tests might tease it out of you).

    I write unit tests as regression tests basically now, but I find I rarely have to do that, since most of the time when a weird case has gone through it's an indicator that I was too lose with the types.

    [0]: https://github.com/adrienverge/localstripe

  • testcontainers-go

    Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done.

  • Testcontainers is also available for go

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

  • otj-pg-embedded

    Java embedded PostgreSQL component for testing

  • I've been using this embedded PostgreSQL thing for tests:

    https://github.com/opentable/otj-pg-embedded

    It's very simple to use and works perfectly. The one problem, and it's a significant one, is that it only ships one version of PostgreSQL, and adding another was difficult enough that I didn't.

  • spawn-demo

    Demo application to show how Spawn can be integrated in Development and CI

  • Full disclosure way up front: I'm one of the developers working on https://spawn.cc at Redgate and the two scenarios you describe are some examples of exactly what we've built Spawn for.

    Not trying to sell you anything (since we are still in beta anyway!) but I'd encourage you to try it out and see if it does what you're looking for. We're in the early stages so any and all feedback is really helpful!

    It's a hosted service where you can immediately spin up copies of "data images" (a snapshot of schema and data in a database instance) instantly regardless of the size. As an example, we created a copy of the 400GB public stack overflow DB for development in ~15s.

    You can also snapshot the state of the DB at any time and move around those save points whenever you like. Creating a "data image" for later copies is also possible based off the current state of the database, so you can curate data through your web UI, save the state, and then make that dataset available for multiple copies across your dev team.

    We've got a couple of repos to show it in action:

    - https://github.com/red-gate/spawn-demo

    - https://github.com/red-gate/flyway-spawn-demo/actions

    As well as a youtube video: https://www.youtube.com/watch?v=sxHtca85CoE

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • flyway-spawn-demo

    CI demo using Flyway and Spawn

  • Full disclosure way up front: I'm one of the developers working on https://spawn.cc at Redgate and the two scenarios you describe are some examples of exactly what we've built Spawn for.

    Not trying to sell you anything (since we are still in beta anyway!) but I'd encourage you to try it out and see if it does what you're looking for. We're in the early stages so any and all feedback is really helpful!

    It's a hosted service where you can immediately spin up copies of "data images" (a snapshot of schema and data in a database instance) instantly regardless of the size. As an example, we created a copy of the 400GB public stack overflow DB for development in ~15s.

    You can also snapshot the state of the DB at any time and move around those save points whenever you like. Creating a "data image" for later copies is also possible based off the current state of the database, so you can curate data through your web UI, save the state, and then make that dataset available for multiple copies across your dev team.

    We've got a couple of repos to show it in action:

    - https://github.com/red-gate/spawn-demo

    - https://github.com/red-gate/flyway-spawn-demo/actions

    As well as a youtube video: https://www.youtube.com/watch?v=sxHtca85CoE

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Show HN: Keploy – eBPF-Driven API Mock and Test Generation from Prod Traffic

    1 project | news.ycombinator.com | 6 Nov 2023
  • Getting Started with Keploy

    2 projects | dev.to | 12 Oct 2023
  • 6 AI Tools every developer must try

    1 project | dev.to | 12 Jul 2023
  • Toxic Backlink Issue: Semrush Flags OSS Project's GitHub Link. Disavow or Whitelist? Need SEO Advice!

    1 project | /r/TechSEO | 5 Jun 2023
  • FOSS Projects needed

    4 projects | /r/golang | 16 Apr 2023