-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: redis fixtures support #176
Conversation
README-ru.md
Outdated
- `-db_dsn <...>` dsn для вашей тестовой SQL базы данных (бд будет очищена перед наполнением!), поддерживается только PostgreSQL | ||
- `-aerospike_host <...>` при использовании Aerospike - URL для подключения к нему в формате `host:port/namespace` | ||
- `-redis_addr <...>` при использовании Redis - адрес для подключения к Redis в формате `host:port` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
я бы сделал наверное возможность полную ссылку писать (redis://...),
go-redis/redis умеет из ссылки парсить достаточное большое кол-во параметров, чтобы потом не возиться с паролями и прочим
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Как я понял с паролями в адресе он работать не может к сожалению. Пароль и пользователь передаются в отдельных параметрах.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
У go-redis есть функция ParseURL я бы заиспользовал ее. Да и вообще впринципе URL проще расширять при необходимости в обратно совместимом режиме, не добавляя новые параметры. В горедис достаточная функция, но вроде без поддержки кластера/сентинела, что впринципе для тестирования не нужно. В крайнем случае можно будет реализовать парсинг ссылки самостоятельно потом и сделать UniversalClient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
сделал на основе ParseURL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Назвал бы тогда redis_url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сделал
c52c022
to
44824b9
Compare
44824b9
to
e6f086d
Compare
🚀 PR was released in |
Add redis fixtures support.
All major redis types are supported:
Also implement the way to use custom fixture loader for gonkey library mode. That allows usage third-party fixture loaders for tests.