Re:Show HN: I open-sourced the in-memory PostgreSQL I built ...
by negus on Sunday April 07, 2024 @05:54PM
(#39964308)
That's great. But doesn't the whole concept of E2E test mean that you use real environment without mocking the components?
[ Parent
| on HN ]
Re:Show HN: I open-sourced the in-memory PostgreSQL I built ...
by refulgentis on Sunday April 07, 2024 @05:57PM
(#39964322)
Explicitly mentioned in the comment as a drawback. In practice E2E means "E2E as much as humanly possible", and I'm glad to see any work that can help.
Re:Show HN: I open-sourced the in-memory PostgreSQL I built ...
by sverhagen on Sunday April 07, 2024 @08:43PM
(#39965216)
It is, however, humanly possible, to run a real Postgres instance in a Docker container. You may use for example Testcontainers. So, I would not resort to an inferior Postgres "mock" for E2E testing.
For unit testing (also mentioned in the tagline of the project on GitHub) I could see you wanting something snappier than a real Postgres in Docker, so then... maybe? Purists of some following will tell you to use a mocking framework instead, but I think that something closer to the real thing would be better in all cases. This might be it, just be careful not to lull yourself into a false sense of security about how close to the real thing this is (isn't).
Re:Show HN: I open-sourced the in-memory PostgreSQL I built ...
by justinclift on Sunday April 07, 2024 @10:41PM
(#39965766)
It does seem to be running a real version of Postgres though, unless I'm misreading?
Re:Show HN: I open-sourced the in-memory PostgreSQL I built ...
by sverhagen on Sunday April 07, 2024 @10:48PM
(#39965795)
On first reading of the main GitHub page, I didn't take it that way. On second reading, I guess it could go either way. But there's talk about having reimplemented the network stack, so maybe that implies they just repurposed the rest of Postgres. I just don't know enough, happy to take your word.
Re:Show HN: I open-sourced the in-memory PostgreSQL I built ...
by wpietri on Monday April 08, 2024 @12:57AM
(#39966329)
It depends on the humans and what they're up to. Fast feedback is a very valuable attribute of a test suite, so reasonable people may well be willing to go down this road.
Re:Show HN: I open-sourced the in-memory PostgreSQL I built ...
by cqqxo4zV46cp on Monday April 08, 2024 @05:45AM
(#39967987)
The reality is that testing is as nuanced as anything else in software. Tradeoffs are different in different situations, and reasonable people can disagree about appropriate tradeoffs in a given situation.