// Jenkinsfile (declarative). Runs the CallQA suite after the staging deploy and // fails the build when the score is under the threshold. // // Setup: a "Secret text" credential with id "callqa-api-key" (scopes read, run), // and examples/cli/callqa copied to ci/callqa in your repository. pipeline { agent any parameters { string(name: 'CALLQA_SCENARIO_ID', defaultValue: '', description: 'Scenario id (UUID)') string(name: 'CALLQA_THRESHOLD', defaultValue: '80', description: 'Minimum score 0-100') } stages { stage('Deploy staging') { steps { echo 'your deploy here' } } stage('Voice tests') { options { timeout(time: 40, unit: 'MINUTES') } environment { CALLQA_API_KEY = credentials('callqa-api-key') } steps { // Exit codes: 0 passed, 1 below threshold, 3 API error, 4 timeout, 5 canceled. sh ''' python3 ci/callqa run \ --scenario "$CALLQA_SCENARIO_ID" \ --threshold "$CALLQA_THRESHOLD" \ --code-version "${GIT_COMMIT:-$BUILD_TAG}" \ --tag jenkins \ --wait --summary callqa-summary.md ''' } post { always { archiveArtifacts artifacts: 'callqa-summary.md', allowEmptyArchive: true } } } } }