Skip to main content

Library for visualizing, processing and storing test results.

Project description

resultsdbpy

Large projects (like WebKit) often have 10's of thousands of tests running on dozens of platforms. Making sense of results from theses tests is difficult. resultsdbpy aims to make visualizing, processing and storing those results easier.

Requirements

For local testing and basic prototyping, nothing is required. All data can be managed in-memory. Note, however, that running the database in this mode will not save results to disk.

If leveraging Docker, Redis and Cassandra will be automatically installed and can be used to make results more persistent.

For production instances, the Cassandra and Redis instances should be hosted seperatly from the web-app.

Usage

resultsdbpy requires fairly extensive configuration before being used. Below is an example of configuring resultsdbpy for testing and basic prototyping for Webkit, along with some comments explaining the environment setup:

import os

from fakeredis import FakeStrictRedis
from flask import Flask, request
from resultsdbpy.controller.api_routes import APIRoutes
from resultsdbpy.model.mock_cassandra_context import MockCassandraContext
from resultsdbpy.model.model import Model
from resultsdbpy.model.repository import WebKitRepository
from resultsdbpy.view.view_routes import ViewRoutes

# By default, Cassandra forbids schema management
os.environ['CQLENG_ALLOW_SCHEMA_MANAGEMENT'] = '1'

# An in-memory Cassandra database for testing
cassandra=MockCassandraContext(
	nodes=['localhost'],
	keyspace='testing-kespace',
	create_keyspace=True,
)

model = Model(
	redis=FakeStrictRedis(),                 # An in-memory Redis database for testing
	cassandra=cassandra,
	repositories=[WebKitRepository()],       # This should be replaced with a class for your project's repository
	default_ttl_seconds=Model.TTL_WEEK * 4,  # Retain 4 weeks of results
	async_processing=False,                  # Processing asynchronously requires instantiating worker processes
)

app = Flask(__name__)
api_routes = APIRoutes(model=model, import_name=__name__)
view_routes = ViewRoutes(
    title='WebKit Results Database',
    model=model, controller=api_routes, import_name=__name__,
)


@app.route('/__health', methods=('GET',))
def health():
    return 'ok'


@app.errorhandler(404)
@app.errorhandler(405)
def handle_errors(error):
    if request.path.startswith('/api/'):
        return api_routes.error_response(error)
    return view_routes.error(error=error)


app.register_blueprint(api_routes)
app.register_blueprint(view_routes)


def main():
    app.run(host='0.0.0.0', port=5000)


if __name__ == '__main__':
    main()

Project details


Download files

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

Source Distribution

resultsdbpy-3.1.10.tar.gz (188.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

resultsdbpy-3.1.10-py3-none-any.whl (303.5 kB view details)

Uploaded Python 3

File details

Details for the file resultsdbpy-3.1.10.tar.gz.

File metadata

  • Download URL: resultsdbpy-3.1.10.tar.gz
  • Upload date:
  • Size: 188.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for resultsdbpy-3.1.10.tar.gz
Algorithm Hash digest
SHA256 d1337f1bf55cb40273e693bb352e65d5e128ea6c790da99fb6903ac7f1956fa3
MD5 d69244ce0318c0d7388136b2fc83e046
BLAKE2b-256 c706cca809f939612360bc5277bb964e0a6ee8e887b21ae3e76a40e4b5f9fa43

See more details on using hashes here.

File details

Details for the file resultsdbpy-3.1.10-py3-none-any.whl.

File metadata

  • Download URL: resultsdbpy-3.1.10-py3-none-any.whl
  • Upload date:
  • Size: 303.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for resultsdbpy-3.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 76cbb2d6302ccc7277ed0dfef8b7b745b678c3280915fa3b4ea74b98ef7bda1b
MD5 ca2e5a34368d14e7cbe211a9b510968d
BLAKE2b-256 c7ec9d55d6da64b7d111ab0fa251ddddd221a3ee20369ec692c03d8e14b7bfc0

See more details on using hashes here.

Supported by

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