All Projects → eBay → regressr

eBay / regressr

Licence: Apache-2.0 license
A command line regression testing framework for testing HTTP services

Projects that are alternatives of or similar to regressr

Recheck Web
recheck for web apps – change comparison tool with local Golden Masters, Git-like ignore syntax and "Unbreakable Selenium" tests.
Stars: ✭ 224 (+540%)
Mutual labels:  regression, testing-framework
basis-expansions
Basis expansion transformers in sklearn style.
Stars: ✭ 74 (+111.43%)
Mutual labels:  regression
reggie
Stata-like Regression Functionality for R
Stars: ✭ 24 (-31.43%)
Mutual labels:  regression
jGeneticNeuralNet
A Java library that trains neural networks with a genetic algorithm.
Stars: ✭ 16 (-54.29%)
Mutual labels:  regression
doctest
The fastest feature-rich C++11/14/17/20 single-header testing framework
Stars: ✭ 4,434 (+12568.57%)
Mutual labels:  testing-framework
polatory
Fast, memory-efficient 3D spline interpolation and global kriging, via RBF (radial basis function) interpolation.
Stars: ✭ 82 (+134.29%)
Mutual labels:  regression
econtools
Econometrics and data manipulation functions.
Stars: ✭ 96 (+174.29%)
Mutual labels:  regression
needlestack
Multi-sample somatic variant caller
Stars: ✭ 45 (+28.57%)
Mutual labels:  regression
test junkie
Highly configurable testing framework for Python
Stars: ✭ 72 (+105.71%)
Mutual labels:  testing-framework
test-drive
The simple testing framework
Stars: ✭ 37 (+5.71%)
Mutual labels:  testing-framework
psyplot
Python package for interactive data visualization
Stars: ✭ 64 (+82.86%)
Mutual labels:  regression
cheapml
Machine Learning algorithms coded from scratch
Stars: ✭ 17 (-51.43%)
Mutual labels:  regression
SGpp
SG⁺⁺ – the numerical library for Sparse Grids in all their variants.
Stars: ✭ 59 (+68.57%)
Mutual labels:  regression
setup-bats
GitHub Action to setup BATS testing framework
Stars: ✭ 25 (-28.57%)
Mutual labels:  testing-framework
PixelTest
Fast, modern, simple iOS snapshot testing written purely in Swift.
Stars: ✭ 56 (+60%)
Mutual labels:  testing-framework
eat
Json based scenario testing tool(which can have test for functional and non-functional)
Stars: ✭ 41 (+17.14%)
Mutual labels:  testing-framework
LIBSVM.jl
LIBSVM bindings for Julia
Stars: ✭ 74 (+111.43%)
Mutual labels:  regression
Cuff less BP Prediction
Prediction of Blood Pressure from ECG and PPG signals using regression methods.
Stars: ✭ 101 (+188.57%)
Mutual labels:  regression
PyTsetlinMachineCUDA
Massively Parallel and Asynchronous Architecture for Logic-based AI
Stars: ✭ 37 (+5.71%)
Mutual labels:  regression
The-Supervised-Learning-Workshop
An Interactive Approach to Understanding Supervised Learning Algorithms
Stars: ✭ 24 (-31.43%)
Mutual labels:  regression

Build Status License Coverage Status

Regressr is a command line tool to test http services. With Regressr, a test engineer can write several strategies that test several request-response conversations. Once the strategies are created, they can be run against the service to record the gold standard. When a new build is deployed, the strategies can be run again to capture any regressions and a comparison report is generated which can be used to roll back the new build if required.

Regressr aims to keep regression testing SIMPLE and overhead to a minimum.

Features:

  • Customizable to all kinds of HTTP based services. Write what to call, what to record and what to compare. Regressr provides default implementations of these components for your convenience. If these do not work for your requirements, write your own components in Scala.
  • Super simple to grok with a low conceptual surface area. Write a basic regression suite quickly within minutes. Or write a complex and exhaustive service regression suite within a few days of using Regressr instead of months.
  • Pluggable datastores and report generators.
  • Command line execution and report generation.

Prerequisites

Quick Start

git clone [email protected]:eBay/regressr.git

For your convenience, regressr comes with some mock services out of the box.

Let's start v1 of the mock service.

docker-compose -f example/v1.yml up

Run regressr record (Open a new terminal):

./regressr.sh -r record example example/example.yml

Press CTRL+C to stop the docker-compose process.

Let's start v2 of the mock service.

docker-compose -f example/v2.yml up

Replay to generate a difference report:

./regressr.sh compareWith example
[main] INFO org.ebayopensource.regression.internal.workflow.ReplayWorkflow$ - Starting request say_hello
[main] INFO org.ebayopensource.regression.internal.workflow.ReplayWorkflow$ - Starting request shop_for_a_pair_of_shoes
[main] INFO com.ebay.n.CommandLineMain$ - Report was generated at /Users/asfernando/code/regression-suite/testrun_1495742693840.html
open /Users/asfernando/code/regression-suite/testrun_1495742693840.html

Click on View Regressions in the report to show the regressions captured.

How does it work

Regressr supports two modes of execution:

  • Record - Use this mode to record the gold standard.
  • Compare - Use this mode to compare the current version of the service with a previous recording.

The diagram explains what is done in these two modes:

One question that users may have is about recorded and replayed entries. Entries are strings that the tester chooses to record and compare. An example of an entry could be the HTTP response status code. Recording an entry like this will catch regressions in change of response status codes between the two runs.

For comparing two valid JSONs, use the JSON comparator that comes with Regressr: https://github.com/ebay/regressr/blob/master/src/main/scala/org/ebayopensource/regression/internal/components/comparator/SimpleHTTPJsonComparator.scala

This comparator ignores differences in values.

Write a test strategy file

Regressr is highly customizable for testing HTTP services. To achieve customizability as well as ease of use, Regressr comes with a set of components ready to use, while giving test engineers full flexibility to extend and write their own test cases.

Take a look at example/example.yml. There are at a minimum of 2 components that need to be created and configured per request. These are Recorder and Comparator.

Recorder

This component chooses what to record from the response. This also contains the request as well. This component receives the HTTP response + request and expects a RequestRecordingEntry. The test engineer is free to write an implementation of the Recorder class. Use the recorder to capture interesting pieces of data that needs to be recorded.

Regressr comes with an out of the box recorder component SimpleHTTPJSONRecorder which records the request url, headers, method, response url, headers, status code and compares the structure of the JSON body (ignoring values).

Comparator

This component is used to explain how the comparison is done. Comparing two strings might be really simple vs. comparing two well formed json formats - i.e. the latter can be subjective - comparing JSONs strict (with values), structure only. For most JSON based services, Regressr comes with an out of the box Comparator SimpleHTTPJsonComparator. Regressr calls the comparator during the compareWith phase with the recorded and replayed request+response and expects 0 or more CompareMessage instances. CompareMessage instances are used to capture regressions when present.

Request Payload Builder [Optional]

For request types that accept an HTTP payload such as POST, PUT and the like, the request builder offers a flexible way to convert a map of [String, String] entries from the strategy file's dataInput element to a HTTP payload. This is super powerful because if the external service's contract changes and you have 1000 requests, changing the request builder will adapt those requests automatically to the new service.

Continuation [Optional]

Continuations are an advanced feature in regressr. Think about an auto-traversable HATEOAS service like this What if you would like to auto-traverse the resources automatically without specifying each request explicitly in the strategy file? This is where continuations come in.

Use this component when you want to generate a new (or several) new requests programmatically from a previous response. The interface for this class is below:

def getContinuations(resp: HTTPResponse) : Try[Seq[HTTPRequest]]

For each HTTPResponse that is received by Regressr, the continuation is expected to create 0 or more HTTPRequest instances that are used to make requests. Also remember to create a base case when the continuation will stop by returning an empty Seq()

The ideal use case for continuations is when you want to traverse a resource tree of HATEOAS RESTful services. An example of continuations is here.

ProgressPrinter [Optional]

For simple requests, Regressr auto prints the requests as they are made on the console. For continuation requests, you might also want to specify a progress printer to let Regressr know how you want your continuations to be printed on the console. This helps in debugging complex continuations.

License

Apache 2.0. License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].