creator cover rom8726
rom8726

rom8726 

Passionate about developing developer tools

0subscribers

3posts

About

Passionate about developing developer tools. I have several open-source projects that may be useful to developers. I specialize in the GoLang language.

testy: YAML-Based Functional Tests for Go HTTP APIs

If you've ever written functional tests for a Go HTTP server, you’ve probably found yourself stuck between two extremes:
 - Writing black-box tests with curl or Postman clones (slow, no debug, hard to maintain)
 - Writing verbose Go test code for every API call, mocking, assertions, cleanup, etc.
That’s why I created testy — a declarative testing framework for Go HTTP APIs, built on top of YAML and your actual http.Handler.
---
Why testy?
Here’s what makes testy different:
 - ✅ Declarative tests written in plain YAML
 - ✅ Real http.Handler execution — your actual app code, not a subprocess
 - ✅ Full PostgreSQL fixture support via pgfixtures
 - ✅ Powerful mocking, assertions, and SQL checks
 - ✅ Great for debugging and stepping through real code
---
Debug Your Tests Like Real Code
Because testy runs requests through your actual Go http.Handler, you can set breakpoints in your API handlers and run tests in your IDE’s debug mode (`go test -v -run <TestName>`).
This makes test runs feel like regular request handling — not like opaque black-box e2e scripts.
You don’t need to spin up your app on a port. testy hits your router directly — whether it’s from net/http, Gin, Chi, Echo or anything else.
---
Declarative Testing With YAML
Test scenarios are written as YAML lists of steps:

Ansible Playbook for PostgreSQL Patroni Cluster

I've recently published an Ansible playbook for deploying a PostgreSQL high-availability cluster powered by Patroni, with all the essential components included. It's a ready-to-go setup for development and testing environments.
🔧 What’s inside:
- PostgreSQL 16 with Patroni for automatic failover
etcd for distributed state management
PgBouncer for connection pooling
HAProxy for routing between master and replicas
Keepalived for floating Virtual IP
Node Exporter + Postgres Exporter for monitoring
🧩 Architecture:
Client → Keepalived VIP → HAProxy → PgBouncer → PostgreSQL
🚀 The setup is simple: define your servers in inventory.ini, set a few variables, and run make up. In just a few minutes, you’ll have a fully working Patroni cluster ready for testing or experimentation.
⚠️ Disclaimer: This is a dev/test configuration. Don’t use it in production without proper hardening (passwords, TLS, firewalls, limited SSH, etc).
👉 GitHub: rom8726/ansible-patroni
---
Недавно я собрал и выложил Ansible playbook для развёртывания кластера PostgreSQL с Patroni. Это полноценное решение для создания отказоустойчивого кластера из трёх узлов, включая всё необходимое:
🔧 Что входит:

pgfixtures (english & russian text)

Starting this blog felt a bit overdue — I’ve been building tools for myself and my teams for years, and now it’s time to share them with the world. So here’s the first one I’d like to talk about: pgfixtures.
If you’ve ever had to load test data into a PostgreSQL or MySQL database for integration tests, you know it can quickly turn into a mess of custom scripts, brittle SQL, and flaky ordering problems. I got tired of that — and built pgfixtures.
It’s a Go library and CLI tool that helps you load fixtures into your database in a clean, declarative way. You write YAML files, define your data, and it takes care of the rest — loading in the right order (even with foreign keys), resetting sequences, supporting dynamic values with SQL expressions like $eval(SELECT NOW()), and even allowing fixture inheritance and templating.
A few features I’m especially proud of:
1) Dynamic values via $eval() — timestamps, randoms, even foreign keys can be generated live.
2) Template inheritance — define a base user once, extend it across dozens of test cases.
3) Multiple includes with merge-by-ID — reuse and override fixture data without repetition.
4) Dry-run mode — see what’s going to be loaded before doing anything.
5) PostgreSQL and MySQL support (yes, both!).
It’s already helped me speed up testing pipelines, make test data more readable, and avoid those annoying “foreign key constraint failed” headaches.
If you're writing integration tests against a database — give it a try. Feedback, ideas, and contributions are more than welcome!
👉 GitHub: rom8726/pgfixtures
👉 Go package: pkg.go.dev
-------
Я давно хотел начать вести блог — за годы накопилось много своих утилит и библиотек, которые экономят время в работе. И вот наконец-то решил начать. Первая библиотека, о которой хочу рассказать, называется pgfixtures.
Subscription levels0
No subscription levels
Go up