Functional Testing With Your Backend in Goby@alixanderwang
4,009 reads
4,009 reads

Functional Testing With Your Backend in Go

by Alexander Wang7mMay 11th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

For Terrastruct, which has a little over 50K lines of code as of now, I've only written functional end-to-end tests. This blog post describes a successful setup that took some iterating to get to. When I run each test, I spin up a new database for testing every single time. This ensures that the database we use mirrors the actual one that is used in production. It also starts with a ping, to fail early if something went wrong. The first API call to a server that just booted up opens the connection, and if the second one comes after the first one is done, it can reuse the connection that first one opened up.

Coin Mentioned

Mention Thumbnail
featured image - Functional Testing With Your Backend in Go
Alexander Wang HackerNoon profile picture
Alexander Wang

Alexander Wang

@alixanderwang

Share Your Thoughts

About Author

Alexander Wang HackerNoon profile picture
Alexander Wang@alixanderwang

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
L O A D I N G
. . . comments & more!