Skip to main content

pytest-flaptastic

Py.test plugin for Flaptastic.

https://www.flaptastic.com/

Installation

To install pytest-flaptastic:

$ pip install pytest-flaptastic

Environment variables:

Required Environment Variable Name Description
Yes FLAPTASTIC_ORGANIZATION_ID Organization id
Yes FLAPTASTIC_API_TOKEN API token
Yes FLAPTASTIC_SERVICE Name of service (aka microservice) under test
No FLAPTASTIC_BRANCH Branch name being tested. In git, you might pass "master" or names like "myFeature"
No FLAPTASTIC_COMMIT_ID Version id of code tested. In git, this would be the commit sha
No FLAPTASTIC_LINK Link to CI (Jenkins/Circle/Travis etc) website page where you can find the full details of the test run, if applicable
No FLAPTASTIC_VERBOSITY Stdout verbosity. 0=none 1=minimal 2=everything

Example call pattern:

$ FLAPTASTIC_ORGANIZATION_ID=123 \
  FLAPTASTIC_API_TOKEN=foo \
  FLAPTASTIC_SERVICE=monolith \
  FLAPTASTIC_BRANCH=master \
  FLAPTASTIC_COMMIT_ID=2feffa9bf0bf3fc48f9f9e89c5386afe0cb77124 \
  FLAPTASTIC_LINK=http://jenkins.example.com \
  py.test

CircleCI 2.0 Configuration

A simple project might have a CircleCI 2.0 YML that ultimately does a 'make test' like this:

      - run: make test

In CircleCI 2.0, we must map some of Circle's variables to Flaptastic varibles and include the Flaptastic organization id like this:

      - run:
          name: Run PyTest With Flaptastic
          environment:
            FLAPTASTIC_ORGANIZATION_ID: "<your org id goes here>"
            FLAPTASTIC_VERBOSITY: 1
          command: |
            echo 'export FLAPTASTIC_BRANCH=$CIRCLE_BRANCH' >> $BASH_ENV
            echo 'export FLAPTASTIC_LINK=$CIRCLE_BUILD_URL' >> $BASH_ENV
            echo 'export FLAPTASTIC_SERVICE=$CIRCLE_PROJECT_REPONAME' >> $BASH_ENV
            echo 'export FLAPTASTIC_COMMIT_ID=$CIRCLE_SHA1' >> $BASH_ENV
            source $BASH_ENV
            make test

Please be sure to pass your selected organization ID as the actual ID value from your Flaptastic account as a string with double quotes. At the time of this writing, CircleCI will botch our 64-bit integer ids without the double quotes.

Finally, find your Flaptastic API token and then go to your CircleCI project page. Navigate to the project environment variables screen and create an enviornment variable called "FLAPTASTIC_API_TOKEN" and then paste your token as the value.

alt text

License

pytest-flaptastic is available under the MIT License.

Release files for pytest-flaptastic 0.0.25

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-flaptastic 0.0.25
File Size Uploaded
pytest-flaptastic-0.0.25.tar.gz 4.7 kB Details

Release files / pytest-flaptastic-0.0.25.tar.gz

Download URL pytest-flaptastic-0.0.25.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
19830bcffaf3ce4ed584cd969e0d56e7d99d8c3cc7967db913df94ea91c43079
BLAKE2b-256 checksum
How to use checksums
e5b85200c28f09493f59433cb214fbaac12f5defa26e9c2456343b76b1df5fea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

Release history Release notifications | RSS feed

This release

0.0.25 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page