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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file resultsdbpy-3.1.9.tar.gz
.
File metadata
- Download URL: resultsdbpy-3.1.9.tar.gz
- Upload date:
- Size: 186.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55ef04bb9b9635bd8801f675b4f3ca9d572897ca980d11284df34ef00ce03566 |
|
MD5 | 71927865e793e4b3013a52e9b325a756 |
|
BLAKE2b-256 | 1c5df3e84cc17a113666c431ce7ba4c8f34c64ff65fb9f963375889c990237f3 |
File details
Details for the file resultsdbpy-3.1.9-py3-none-any.whl
.
File metadata
- Download URL: resultsdbpy-3.1.9-py3-none-any.whl
- Upload date:
- Size: 301.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d65b4dfecd2425dabc1a5a17971113d44ac1efaf2c5bf8a29cf5e6e56b580fc |
|
MD5 | 76673453c318a2323ea901d7d62323b4 |
|
BLAKE2b-256 | 9d4a8a3bdf83bd8c43f40275bfef5a339e4a974896e5f4e3aaf83ed80a9daa96 |