{"id":13468599,"url":"https://github.com/jd/pifpaf","last_synced_at":"2025-05-15T12:06:54.070Z","repository":{"id":5983956,"uuid":"54391698","full_name":"jd/pifpaf","owner":"jd","description":"Python fixtures and daemon managing tools for functional testing","archived":false,"fork":false,"pushed_at":"2025-02-17T15:47:02.000Z","size":820,"stargazers_count":194,"open_issues_count":19,"forks_count":41,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-14T20:58:15.074Z","etag":null,"topics":["aodh","ceph","consule","couchdb","elasticsearch","etcd","fakes3","fixtures","gnocchi","influxdb","keystone","mongodb","mysql","openstack","postgresql","python","redis","s3rver","swift","zookeeper"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jd.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"jd"}},"created_at":"2016-03-21T13:36:42.000Z","updated_at":"2025-02-20T01:08:02.000Z","dependencies_parsed_at":"2023-02-10T16:30:59.819Z","dependency_job_id":"24b475d1-e3c3-48ff-862a-f9c2dea46775","html_url":"https://github.com/jd/pifpaf","commit_stats":{"total_commits":392,"total_committers":26,"mean_commits":"15.076923076923077","dds":"0.45663265306122447","last_synced_commit":"a2fa2bd8dfe5000f648d17930107d5a65678835c"},"previous_names":[],"tags_count":132,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd%2Fpifpaf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd%2Fpifpaf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd%2Fpifpaf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd%2Fpifpaf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jd","download_url":"https://codeload.github.com/jd/pifpaf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337613,"owners_count":22054253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aodh","ceph","consule","couchdb","elasticsearch","etcd","fakes3","fixtures","gnocchi","influxdb","keystone","mongodb","mysql","openstack","postgresql","python","redis","s3rver","swift","zookeeper"],"created_at":"2024-07-31T15:01:14.656Z","updated_at":"2025-05-15T12:06:49.057Z","avatar_url":"https://github.com/jd.png","language":"Python","readme":"==========\n Pifpaf\n==========\n\n.. image:: https://badge.fury.io/py/pifpaf.svg\n    :target: https://badge.fury.io/py/pifpaf\n\nPifpaf is a suite of `fixtures`_ and a command-line tool that allows to start\nand stop daemons for a quick throw-away usage. This is typically useful when\nneeding these daemons to run `integration testing`_. It originaly evolved from\nits precussor `overtest`_.\n\n.. _fixtures: https://pypi.python.org/pypi/fixtures\n.. _overtest: https://github.com/jd/overtest\n\nSupported daemons\n=================\n\nPifpaf currently supports:\n\n* `PostgreSQL`_\n* `MySQL`_\n* `Memcached`_\n* `InfluxDB`_\n* `Etcd`_ (with clustering)\n* `Redis`_ (with sentinel mode)\n* `Valkey`_\n* `Elasticsearch`_\n* `ZooKeeper`_\n* `Gnocchi`_\n* `Aodh`_\n* `Ceph`_\n* `RabbitMQ`_ (with clustering)\n* `FakeS3`_\n* `Consul`_\n* `Keystone`_\n* `CouchDB`_\n* `S3rver`_\n* `MongoDB`_\n* `OpenStack Swift`_\n* `Vault`_\n* `HttpBin`_\n\n.. _Consul: https://www.consul.io/\n.. _PostgreSQL: http://postgresql.org\n.. _MySQL: http://mysql.org\n.. _Memcached: http://memcached.org\n.. _InfluxDB: http://influxdb.org\n.. _Etcd: https://coreos.com/etcd/\n.. _Redis: http://redis.io/\n.. _Valkey: https://valkey.io/\n.. _Elasticsearch: https://www.elastic.co/\n.. _ZooKeeper: https://zookeeper.apache.org/\n.. _Gnocchi: http://gnocchi.xyz\n.. _Aodh: http://launchpad.net/aodh\n.. _Ceph: http://ceph.com\n.. _RabbitMQ: https://www.rabbitmq.com/\n.. _FakeS3: https://github.com/jubos/fake-s3\n.. _Keystone: https://launchpad.net/keystone\n.. _CouchDB: http://couchdb.apache.org/\n.. _S3rver: https://www.npmjs.com/package/s3rver\n.. _MongoDB: https://www.mongodb.com\n.. _OpenStack Swift: https://docs.openstack.org/developer/swift/\n.. _Vault: https://www.vaultproject.io/\n.. _HttpBin: https://httpbin.org/\n\nUsage\n=====\nTo use Pifpaf, simply call the `pifpaf run $daemon \u003ccommand\u003e` program that you\nneed. It will setup the temporary environment and export a few environment\nvariable for you to access it::\n\n  $ pifpaf run postgresql psql template1\n  Expanded display is used automatically.\n  Line style is unicode.\n  SET\n  psql (9.4.5)\n  Type \"help\" for help.\n\n  template1=# \\l\n                                List of databases\n     Name    │ Owner │ Encoding │   Collate   │    Ctype    │ Access privileges\n  ───────────┼───────┼──────────┼─────────────┼─────────────┼───────────────────\n   postgres  │ jd    │ UTF8     │ en_US.UTF-8 │ en_US.UTF-8 │\n   template0 │ jd    │ UTF8     │ en_US.UTF-8 │ en_US.UTF-8 │ =c/jd            ↵\n             │       │          │             │             │ jd=CTc/jd\n   template1 │ jd    │ UTF8     │ en_US.UTF-8 │ en_US.UTF-8 │ =c/jd            ↵\n             │       │          │             │             │ jd=CTc/jd\n  (3 rows)\n\n  template1=# \\q\n  $\n\nYou can also run it with no command line provided::\n\n  $ eval `pifpaf run memcached`\n  $ env | grep PIFPAF\n  PIFPAF_PID=13387\n  PIFPAF_DAEMON=memcached\n  PIFPAF_URL=memcached://localhost:11212\n  PIFPAF_MEMCACHED_URL=memcached://localhost:11212\n  $ pifpaf_stop\n\nKilling the daemon whose PID is contained in `$PIFPAF_PID` will stop the\nlaunched daemon and clean the test environment. You can kill it yourself or use\nthe defined function `pifpaf_stop`.\n\nEnvironment variables\n=====================\nPifpaf exports a few environment variable:\n\n* `PIFPAF_DAEMON` which contains the name of the daemon launched\n* `PIFPAF_URL` which contains the URL to the daemon\n* `PIFPAF_PID` the PID of the pifpaf daemon\n* `PIFPAF_$daemon_*` variables, which contains daemon specific variables,\n  such as port, database name, URL, etc.\n\n.. _integration testing: https://en.wikipedia.org/wiki/Integration_testing\n\n\nRunning several programs at once\n================================\nPifpaf provides the ability to change the prefix of its environment variable,\nallowing you to nest several Pifpaf instances and therefore running several\ndaemons at once::\n\n  $ pifpaf --env-prefix STORAGE run memcached -- pifpaf --env-prefix INDEX run postgresql $SHELL\n  $ env | grep STORAGE\n  STORAGE_DATA=/var/folders/7k/pwdhb_mj2cv4zyr0kyrlzjx40000gq/T/tmpVreJ0J\n  STORAGE_MEMCACHED_PORT=11212\n  STORAGE_URL=memcached://localhost:11212\n  STORAGE_PID=71019\n  STORAGE_DAEMON=memcached\n  STORAGE_MEMCACHED_URL=memcached://localhost:11212\n  $ env | grep INDEX\n  INDEX_DATA=/var/folders/7k/pwdhb_mj2cv4zyr0kyrlzjx40000gq/T/tmphAG7tf\n  INDEX_URL=postgresql://localhost/postgres?host=/var/folders/7k/pwdhb_mj2cv4zyr0kyrlzjx40000gq/T/tmphAG7tf\u0026port=9824\n  INDEX_PID=71021\n  INDEX_DAEMON=postgresql\n  INDEX_POSTGRESQL_URL=postgresql://localhost/postgres?host=/var/folders/7k/pwdhb_mj2cv4zyr0kyrlzjx40000gq/T/tmphAG7tf\u0026port=9824\n  $ echo $PIFPAF_URLS\n  memcached://localhost:11212;postgresql://localhost/postgres?host=/var/folders/7k/pwdhb_mj2cv4zyr0kyrlzjx40000gq/T/tmpQ2BWFH\u0026port=9824\n\nThe `PIFPAF_URLS` environment variable will contain the list of all URLs\ndetected and set-up by Pifpaf. You can override this variable name with the\n`--global-urls-variable` option.\n\nHow it works under the hood\n===========================\n\nPifpaf will start the asked daemon using the current Posix user. The data file\nof the daemon will be placed in a temporary directory. The system-wide\nconfigured daemon that might exists is not touched at all.\n\nPifpaf expected to find daemon binaries on your system (like `mysql`, `mysqld`,\n`pg_config`, `pg_ctl`, `rabbitmq-server`, etc).\n\nWhen the Python fixture is cleaned or when Pifpaf is terminated, the daemon is\nstopped and the temporary directory removed.\n\n.. image:: pifpaf.jpg\n","funding_links":["https://github.com/sponsors/jd"],"categories":["Python","Tools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjd%2Fpifpaf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjd%2Fpifpaf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjd%2Fpifpaf/lists"}