Skip to main content

Suite of tools and fixtures to manage daemons for testing

Project description

Build Status

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.

Supported daemons

Pifpaf currently supports:

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 accesss 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
$ kill $PIFPAF_PID

Killing the daemon whose PID is contained in $PIFPAF_PID will stop the launched daemon and clean the test environment.

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.

Project details


Release history Release notifications | RSS feed

This version

0.0.6

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pifpaf-0.0.6.tar.gz (17.6 kB view details)

Uploaded Source

File details

Details for the file pifpaf-0.0.6.tar.gz.

File metadata

  • Download URL: pifpaf-0.0.6.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pifpaf-0.0.6.tar.gz
Algorithm Hash digest
SHA256 da09011ee1c9657bd824a1d5fed0145be7e9573b6077e19a129525181bf5bb5b
MD5 c09e33c283d3b215f8498d2842bb35f1
BLAKE2b-256 693a52bf4f01cf28f75cde703d9a43811e24229189a82eceba804365a37c1b40

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page