All Projects → jd → Pifpaf

jd / Pifpaf

Licence: apache-2.0
Python fixtures and daemon managing tools for functional testing

Programming Languages

python
139335 projects - #7 most used programming language
swift
15916 projects

Projects that are alternatives of or similar to Pifpaf

Haproxy Configs
80+ HAProxy Configs for Hadoop, Big Data, NoSQL, Docker, Elasticsearch, SolrCloud, HBase, MySQL, PostgreSQL, Apache Drill, Hive, Presto, Impala, Hue, ZooKeeper, SSH, RabbitMQ, Redis, Riak, Cloudera, OpenTSDB, InfluxDB, Prometheus, Kibana, Graphite, Rancher etc.
Stars: ✭ 106 (-34.16%)
Mutual labels:  zookeeper, mysql, redis, postgresql, elasticsearch, influxdb
Firecamp
Serverless Platform for the stateful services
Stars: ✭ 194 (+20.5%)
Mutual labels:  zookeeper, redis, mongodb, postgresql, elasticsearch, couchdb
Blog
我的日记
Stars: ✭ 110 (-31.68%)
Mutual labels:  mysql, redis, mongodb, elasticsearch, etcd
Szt Bigdata
深圳地铁大数据客流分析系统🚇🚄🌟
Stars: ✭ 826 (+413.04%)
Mutual labels:  zookeeper, mysql, redis, mongodb, elasticsearch
Phalcon Vm
Vagrant configuration for PHP7, Phalcon 3.x and Zephir development.
Stars: ✭ 43 (-73.29%)
Mutual labels:  mysql, redis, mongodb, postgresql, elasticsearch
Dev Setup
macOS development environment setup: Easy-to-understand instructions with automated setup scripts for developer tools like Vim, Sublime Text, Bash, iTerm, Python data analysis, Spark, Hadoop MapReduce, AWS, Heroku, JavaScript web development, Android development, common data stores, and dev-based OS X defaults.
Stars: ✭ 5,590 (+3372.05%)
Mutual labels:  mysql, redis, mongodb, postgresql, elasticsearch
Spring Boot 2.x Examples
Spring Boot 2.x code examples
Stars: ✭ 104 (-35.4%)
Mutual labels:  mysql, redis, mongodb, postgresql, elasticsearch
Netkiller.github.io
Netkiller Free ebook - 免费电子书
Stars: ✭ 861 (+434.78%)
Mutual labels:  mysql, redis, mongodb, postgresql
Treefrog Framework
TreeFrog Framework : High-speed C++ MVC Framework for Web Application
Stars: ✭ 885 (+449.69%)
Mutual labels:  mysql, redis, mongodb, postgresql
Nagios Plugins
450+ AWS, Hadoop, Cloud, Kafka, Docker, Elasticsearch, RabbitMQ, Redis, HBase, Solr, Cassandra, ZooKeeper, HDFS, Yarn, Hive, Presto, Drill, Impala, Consul, Spark, Jenkins, Travis CI, Git, MySQL, Linux, DNS, Whois, SSL Certs, Yum Security Updates, Kubernetes, Cloudera etc...
Stars: ✭ 1,000 (+521.12%)
Mutual labels:  zookeeper, mysql, redis, elasticsearch
Stream Reactor
Streaming reference architecture for ETL with Kafka and Kafka-Connect. You can find more on http://lenses.io on how we provide a unified solution to manage your connectors, most advanced SQL engine for Kafka and Kafka Streams, cluster monitoring and alerting, and more.
Stars: ✭ 753 (+367.7%)
Mutual labels:  redis, mongodb, elasticsearch, influxdb
Aclify
🔒 Node Access Control Lists (ACL).
Stars: ✭ 49 (-69.57%)
Mutual labels:  mysql, redis, mongodb, postgresql
Nodbi
Document DBI connector for R
Stars: ✭ 56 (-65.22%)
Mutual labels:  redis, mongodb, elasticsearch, couchdb
Smartsql
SmartSql = MyBatis in C# + .NET Core+ Cache(Memory | Redis) + R/W Splitting + PropertyChangedTrack +Dynamic Repository + InvokeSync + Diagnostics
Stars: ✭ 775 (+381.37%)
Mutual labels:  zookeeper, mysql, redis, postgresql
Mall Swarm
mall-swarm是一套微服务商城系统,采用了 Spring Cloud Hoxton & Alibaba、Spring Boot 2.3、Oauth2、MyBatis、Docker、Elasticsearch、Kubernetes等核心技术,同时提供了基于Vue的管理后台方便快速搭建系统。mall-swarm在电商业务的基础集成了注册中心、配置中心、监控中心、网关等系统功能。文档齐全,附带全套Spring Cloud教程。
Stars: ✭ 7,874 (+4790.68%)
Mutual labels:  mysql, redis, mongodb, elasticsearch
Springboot Templates
springboot和dubbo、netty的集成,redis mongodb的nosql模板, kafka rocketmq rabbit的MQ模板, solr solrcloud elasticsearch查询引擎
Stars: ✭ 100 (-37.89%)
Mutual labels:  zookeeper, redis, mongodb, elasticsearch
Adminer Custom
Customizations for Adminer, the best database management tool written in PHP.
Stars: ✭ 99 (-38.51%)
Mutual labels:  mysql, mongodb, postgresql, elasticsearch
Pythonstudy
Python related technologies used in work: crawler, data analysis, timing tasks, RPC, page parsing, decorator, built-in functions, Python objects, multi-threading, multi-process, asynchronous, redis, mongodb, mysql, openstack, etc.
Stars: ✭ 103 (-36.02%)
Mutual labels:  openstack, mysql, redis, mongodb
Newsblur
NewsBlur is a personal news reader that brings people together to talk about the world. A new sound of an old instrument.
Stars: ✭ 5,862 (+3540.99%)
Mutual labels:  redis, mongodb, postgresql, elasticsearch
Zxw.framework.netcore
基于EF Core的Code First模式的DotNetCore快速开发框架,其中包括DBContext、IOC组件autofac和AspectCore.Injector、代码生成器(也支持DB First)、基于AspectCore的memcache和Redis缓存组件,以及基于ICanPay的支付库和一些日常用的方法和扩展,比如批量插入、更新、删除以及触发器支持,当然还有demo。欢迎提交各种建议、意见和pr~
Stars: ✭ 691 (+329.19%)
Mutual labels:  mysql, redis, mongodb, postgresql

========== Pifpaf

.. image:: https://travis-ci.org/jd/pifpaf.png?branch=master :target: https://travis-ci.org/jd/pifpaf :alt: Build Status

.. image:: https://badge.fury.io/py/pifpaf.svg :target: https://badge.fury.io/py/pifpaf

Pifpaf is a suite of fixtures_ and a command-line tool that allows to start and stop daemons for a quick throw-away usage. This is typically useful when needing these daemons to run integration testing. It originaly evolved from its precussor overtest.

.. _fixtures: https://pypi.python.org/pypi/fixtures .. _overtest: https://github.com/jd/overtest

Supported daemons

Pifpaf currently supports:

  • PostgreSQL_
  • MySQL_
  • Memcached_
  • InfluxDB_
  • Etcd_ (with clustering)
  • Redis_ (with sentinel mode)
  • Elasticsearch_
  • ZooKeeper_
  • Gnocchi_
  • Aodh_
  • Ceph_
  • RabbitMQ_ (with clustering)
  • FakeS3_
  • Consul_
  • Keystone_
  • CouchDB_
  • S3rver_
  • MongoDB_
  • OpenStack Swift_
  • Vault_
  • HttpBin_

.. _Consul: https://www.consul.io/ .. _PostgreSQL: http://postgresql.org .. _MySQL: http://mysql.org .. _Memcached: http://memcached.org .. _InfluxDB: http://influxdb.org .. _Etcd: https://coreos.com/etcd/ .. _Redis: http://redis.io/ .. _Elasticsearch: https://www.elastic.co/ .. _ZooKeeper: https://zookeeper.apache.org/ .. _Gnocchi: http://gnocchi.xyz .. _Aodh: http://launchpad.net/aodh .. _Ceph: http://ceph.com .. _RabbitMQ: https://www.rabbitmq.com/ .. _FakeS3: https://github.com/jubos/fake-s3 .. _Keystone: https://launchpad.net/keystone .. _CouchDB: http://couchdb.apache.org/ .. _S3rver: https://www.npmjs.com/package/s3rver .. _MongoDB: https://www.mongodb.com .. _OpenStack Swift: https://docs.openstack.org/developer/swift/ .. _Vault: https://www.vaultproject.io/ .. _HttpBin: https://httpbin.org/

Usage

To use Pifpaf, simply call the pifpaf run $daemon <command> program that you need. It will setup the temporary environment and export a few environment variable for you to access it::

$ pifpaf run postgresql psql template1 Expanded display is used automatically. Line style is unicode. SET psql (9.4.5) Type "help" for help.

template1=# \l List of databases Name │ Owner │ Encoding │ Collate │ Ctype │ Access privileges ───────────┼───────┼──────────┼─────────────┼─────────────┼─────────────────── postgres │ jd │ UTF8 │ en_US.UTF-8 │ en_US.UTF-8 │ template0 │ jd │ UTF8 │ en_US.UTF-8 │ en_US.UTF-8 │ =c/jd ↵ │ │ │ │ │ jd=CTc/jd template1 │ jd │ UTF8 │ en_US.UTF-8 │ en_US.UTF-8 │ =c/jd ↵ │ │ │ │ │ jd=CTc/jd (3 rows)

template1=# \q $

You can also run it with no command line provided::

$ eval pifpaf run memcached $ env | grep PIFPAF PIFPAF_PID=13387 PIFPAF_DAEMON=memcached PIFPAF_URL=memcached://localhost:11212 PIFPAF_MEMCACHED_URL=memcached://localhost:11212 $ pifpaf_stop

Killing the daemon whose PID is contained in $PIFPAF_PID will stop the launched daemon and clean the test environment. You can kill it yourself or use the defined function pifpaf_stop.

Environment variables

Pifpaf exports a few environment variable:

  • PIFPAF_DAEMON which contains the name of the daemon launched
  • PIFPAF_URL which contains the URL to the daemon
  • PIFPAF_PID the PID of the pifpaf daemon
  • PIFPAF_$daemon_* variables, which contains daemon specific variables, such as port, database name, URL, etc.

.. _integration testing: https://en.wikipedia.org/wiki/Integration_testing

Running several programs at once

Pifpaf provides the ability to change the prefix of its environment variable, allowing you to nest several Pifpaf instances and therefore running several daemons at once::

$ pifpaf --env-prefix STORAGE run memcached -- pifpaf --env-prefix INDEX run postgresql $SHELL $ env | grep STORAGE STORAGE_DATA=/var/folders/7k/pwdhb_mj2cv4zyr0kyrlzjx40000gq/T/tmpVreJ0J STORAGE_MEMCACHED_PORT=11212 STORAGE_URL=memcached://localhost:11212 STORAGE_PID=71019 STORAGE_DAEMON=memcached STORAGE_MEMCACHED_URL=memcached://localhost:11212 $ env | grep INDEX INDEX_DATA=/var/folders/7k/pwdhb_mj2cv4zyr0kyrlzjx40000gq/T/tmphAG7tf INDEX_URL=postgresql://localhost/postgres?host=/var/folders/7k/pwdhb_mj2cv4zyr0kyrlzjx40000gq/T/tmphAG7tf&port=9824 INDEX_PID=71021 INDEX_DAEMON=postgresql INDEX_POSTGRESQL_URL=postgresql://localhost/postgres?host=/var/folders/7k/pwdhb_mj2cv4zyr0kyrlzjx40000gq/T/tmphAG7tf&port=9824 $ echo $PIFPAF_URLS memcached://localhost:11212;postgresql://localhost/postgres?host=/var/folders/7k/pwdhb_mj2cv4zyr0kyrlzjx40000gq/T/tmpQ2BWFH&port=9824

The PIFPAF_URLS environment variable will contain the list of all URLs detected and set-up by Pifpaf. You can override this variable name with the --global-urls-variable option.

How it works under the hood

Pifpaf will start the asked daemon using the current Posix user. The data file of the daemon will be placed in a temporary directory. The system-wide configured daemon that might exists is not touched at all.

Pifpaf expected to find daemon binaries on your system (like mysql, mysqld, pg_config, pg_ctl, rabbitmq-server, etc).

When the Python fixture is cleaned or when Pifpaf is terminated, the daemon is stopped and the temporary directory removed.

.. image:: pifpaf.jpg

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].