Skip to content

Celerabit pipeline integration

Celerabit pipeline integration es un módulo construido en python que permite ejecutar escenarios fácilmente desde un pipeline CI/CD.

Para conocer más de este módulo consultar el sitio oficial el pypi.

Ejemplo de integración desde un pipeline

El siguiente script puede utilizarse desde cualquier integrador CI/CD que permita ejecución de shell script. En este script, se utiliza Celerabit pipeline integration para generar un token, ejecutar el escenario y, posteriormente, verificar el compliance. En caso de que el escenario no se haya desempeñado de acuerdo a lo esperado, se rompe el pipeline.

#!/bin/sh

set -e

celerabit_pipeline_user="process@company.com"
celerabit_pipeline_password="secretpassword"

client="Client Name"
application="Application name"
scenario="Scenario Name"

# For API Scenarios, all tolerance values must to be between 0 and 1 
tolerance="latency=0.8,throughput=0.8,errors=0.95,deviation=0.4"

# For UX scenarios, tolarance string must be like below:
#
# tolerance="performance=MEDIUM"
#
# The allowed values por "performance" are: BAD, MEDIUM, GOOD.
# For more information see https://pypi.org/project/celerabit-pipeline-integration/

echo "Installing celerabit-pipeline-integration ..."
pip install celerabit-pipeline-integration

echo "Generating token ..."
token=`python -m celerabitpipelineintegration authenticate login "${celerabit_pipeline_user}" password "${celerabit_pipeline_password}"`

echo "Running test for scenario \"${client}/${application}/${scenario}\" ..."
job_result=`python -m celerabitpipelineintegration run token "${token}" client "${client}" application "${application}" scenario "${scenario}" -q`

echo "Evaluating performance for result:"
echo "${job_result}"
echo "..."
compliance_errors=`python -m celerabitpipelineintegration eval-job-results job-result "${job_result}" tolerance "${tolerance}"`

if test -z "${compliance_errors}"; then
    echo  "Well done !.  The scenario \"${client}/${application}/${scenario}\" is performing good."
else
    echo "${compliance_errors}"
    exit 1
fi
Fue util esta informacion? Quieres dejarnos algun feedback? [support.performance@techandsolve.com](mailto:support.performance@techandsolve.com) [Ir al menú principal](../../index.md)