Kent - Fake Sentry server for local development, debugging, and integration testing

Related tags

Testingkent
Overview

Kent

Kent is a service for debugging and integration testing Sentry.

Code: https://github.com/willkg/kent/
Issues: https://github.com/willkg/kent/issues
License: MPL v2

Goals

Goals of Kent:

  1. make it possible to debug before_send and before_breadcrumb sanitization code when using sentry-sdk
  2. make it possible to debug other sentry error submission payload issues
  3. make it possible to write integration tests against a fake sentry instance

Quick start

Installing and running on your local machine

  1. Install Kent.

    You can install Kent from PyPI with pipx or pip or whatever:

    pipx install kent
    

    You can install a REVISH ("main", branch name, commit, whatever) from GitHub:

    pipx install https://github.com/willkg/kent/archive/refs/heads/
        .zip
    
       

    You can install from a checked out version of this repository:

    pipx install .
    
  2. Run Kent:

    kent-server run [-h HOST] [-p PORT]
    

Running in a Docker container

I'm using something like this:

FROM python:3.10.1-alpine3.15

WORKDIR /app/

ENV PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1

RUN pip install -U 'pip>=8' && \
    pip install --no-cache-dir 'kent==VERSION'

USER guest

ENTRYPOINT ["/usr/local/bin/kent-server"]
CMD ["run"]

Replace VERSION with the version of Kent you want to use. See https://pypi.org/project/kent for releases.

Then:

$ docker build -t faksentry:latest .
$ docker run --rm --publish 8000:8000 fakesentry:latest run --host 0.0.0.0 --port 8000

Things to know about Kent

Kent is the fakest of fake Sentry servers. It supports a single Sentry project with id 1. You can set up a Sentry DSN to point to Kent and have your application send errors.

Kent is a refined fake Sentry service and doesn't like fast food.

Kent will keep track of the last 100 it received in memory. Nothing is persisted to disk.

You can access the list of errors and error data with your web browser by going to Kent's index page.

You can also access it with the API. This is most useful for integration tests that want to assert things about errors.

/api/errorlist/
List of all errors in memory with a unique error id.
/api/error/ERRORID
Retrieve the payload for a specific error by id.
/api/flush/
Flushes the error manager of all errors.

Kent definitely works with:

  • Python sentry-sdk client

I don't know about anything else. If you use Kent with another Sentry client, add an issue with details or a pull request to update the README.

Release process

  1. Check out main tip.

  2. Update __version__ in src/kent/__init__.py.

  3. Run:

    $ make checkrot
    $ make test
    $ make testdocker
    $ check-manifest
    

    Fix any issues from that.

  4. Update HISTORY.rst.

  5. Push any changes to GitHub.

  6. Release:

    $ git tag --sign 1.0.0
    # Use contents from HISTORY.rst for tag comment
    
    $ make clean
    $ python setup.py sdist bdist_wheel
    $ twine upload dist/*
    
Owner
Will Kahn-Greene
he/him; crash ingestion, python tools, etc
Will Kahn-Greene
Python Testing Crawler 🐍 🩺 🕷️ A crawler for automated functional testing of a web application

Python Testing Crawler 🐍 🩺 🕷️ A crawler for automated functional testing of a web application Crawling a server-side-rendered web application is a

70 Aug 07, 2022
Ab testing - The using AB test to test of difference of conversion rate

Facebook recently introduced a new type of offer that is an alternative to the current type of bidding called maximum bidding he introduced average bidding.

5 Nov 21, 2022
Percy visual testing for Python Selenium

percy-selenium-python Percy visual testing for Python Selenium. Installation npm install @percy/cli: $ npm install --save-dev @percy/cli pip install P

Percy 9 Mar 24, 2022
Generate random test credit card numbers for testing, validation and/or verification purposes.

Generate random test credit card numbers for testing, validation and/or verification purposes.

Dark Hunter 141 5 Nov 14, 2022
A browser automation framework and ecosystem.

Selenium Selenium is an umbrella project encapsulating a variety of tools and libraries enabling web browser automation. Selenium specifically provide

Selenium 25.5k Jan 01, 2023
Pytest-rich - Pytest + rich integration (proof of concept)

pytest-rich Leverage rich for richer test session output. This plugin is not pub

Bruno Oliveira 170 Dec 02, 2022
Automatic SQL injection and database takeover tool

sqlmap sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of

sqlmapproject 25.7k Jan 04, 2023
Fully functioning price detector built with selenium and python

Fully functioning price detector built with selenium and python

mark sikaundi 4 Mar 30, 2022
Integration layer between Requests and Selenium for automation of web actions.

Requestium is a Python library that merges the power of Requests, Selenium, and Parsel into a single integrated tool for automatizing web actions. The

Tryolabs 1.7k Dec 27, 2022
Subprocesses for Humans 2.0.

Delegator.py — Subprocesses for Humans 2.0 Delegator.py is a simple library for dealing with subprocesses, inspired by both envoy and pexpect (in fact

Amit Tripathi 1.6k Jan 04, 2023
Argument matchers for unittest.mock

callee Argument matchers for unittest.mock More robust tests Python's mocking library (or its backport for Python 3.3) is simple, reliable, and easy

Karol Kuczmarski 77 Nov 03, 2022
A library to make concurrent selenium tests that automatically download and setup webdrivers

AutoParaSelenium A library to make parallel selenium tests that automatically download and setup webdrivers Usage Installation pip install autoparasel

Ronak Badhe 8 Mar 13, 2022
Android automation project with pytest+appium

Android automation project with pytest+appium

1 Oct 28, 2021
PyAutoEasy is a extension / wrapper around the famous PyAutoGUI, a cross-platform GUI automation tool to replace your boooring repetitive tasks.

PyAutoEasy PyAutoEasy is a extension / wrapper around the famous PyAutoGUI, a cross-platform GUI automation tool to replace your boooring repetitive t

Dingu Sagar 7 Oct 27, 2022
Python scripts for a generic performance testing infrastructure using Locust.

TODOs Reference to published paper or online version of it loadtest_plotter.py: Cleanup and reading data from files ARS_simulation.py: Cleanup, docume

Juri Tomak 3 Dec 15, 2022
a wrapper around pytest for executing tests to look for test flakiness and runtime regression

bubblewrap a wrapper around pytest for assessing flakiness and runtime regressions a cs implementations practice project How to Run: First, install de

Anna Nagy 1 Aug 05, 2021
Repository for JIDA SNP Browser Web Application: Local Deployment

JIDA JIDA is a web application that retrieves SNP information for a genomic region of interest in Homo sapiens and calculates specific summary statist

3 Mar 03, 2022
Aplikasi otomasi klik di situs popcat.click menggunakan Python dan Selenium

popthe-popcat Aplikasi Otomasi Klik di situs popcat.click. aplikasi ini akan secara otomatis melakukan click pada kucing viral itu, sehingga anda tida

cndrw_ 2 Oct 07, 2022
Python Moonlight (Machine Learning) Practice

PyML Python Moonlight (Machine Learning) Practice Contents Design Documentation Prerequisites Checklist Dev Setup Testing Run Prerequisites Python 3 P

Dockerian Seattle 2 Dec 25, 2022
FaceBot is a script to automatically create a facebook account using the selenium and chromedriver modules.

FaceBot is a script to automatically create a facebook account using the selenium and chromedriver modules. That way, we don't need to input full name, email and password and date of birth. All will

Fadjrir Herlambang 2 Jun 17, 2022