FixSense
Integrations

Jenkins

Connect FixSense to your Jenkins pipelines for automated test failure analysis.

Overview

FixSense supports Jenkins alongside GitHub Actions, GitLab CI, Azure Pipelines, and Bitbucket Pipelines. When tests fail in your Jenkins pipeline, FixSense analyzes the JUnit XML results and provides AI-powered root cause analysis.

Quick Setup

Add a post-build step to your Jenkinsfile that sends test results to FixSense:

pipeline {
    agent any

    stages {
        stage('Test') {
            steps {
                sh 'npm ci'
                sh 'npx playwright test --reporter=junit --output-file=test-results/results.xml || true'
            }
            post {
                always {
                    junit 'test-results/*.xml'
                }
            }
        }

        stage('FixSense Analysis') {
            when { expression { currentBuild.result == 'UNSTABLE' || currentBuild.result == 'FAILURE' } }
            steps {
                sh '''
                    curl -sS -X POST "https://fix-sense.com/api/v1/analyze" \
                      -H "Content-Type: application/json" \
                      -H "Authorization: Bearer ${FIXSENSE_API_KEY}" \
                      -d "$(node -e "
                        const fs = require('fs');
                        const path = require('path');
                        const files = fs.readdirSync('test-results').filter(f => f.endsWith('.xml'));
                        const failures = [];
                        for (const file of files) {
                          const content = fs.readFileSync(path.join('test-results', file), 'utf-8');
                          failures.push({ name: file, content: Buffer.from(content).toString('base64') });
                        }
                        console.log(JSON.stringify({
                          repo: '${JOB_NAME}',
                          runId: '${BUILD_NUMBER}',
                          rawFiles: failures
                        }));
                      ")"
                '''
            }
        }
    }
}

Using Docker (Alternative)

If your Jenkins agents have Docker, you can use the FixSense pipe image:

stage('FixSense Analysis') {
    when { expression { currentBuild.result != 'SUCCESS' } }
    steps {
        sh '''
            docker run --rm \
              -v $(pwd)/test-results:/test-results \
              -e FIXSENSE_API_KEY=${FIXSENSE_API_KEY} \
              -e RESULTS_PATH="test-results/**" \
              -e BITBUCKET_REPO_FULL_NAME=${JOB_NAME} \
              -e BITBUCKET_BUILD_NUMBER=${BUILD_NUMBER} \
              sgace11/fixsense-pipe:latest
        '''
    }
}

Setup

Step 1: Get your API key

  1. Sign in at fix-sense.com
  2. Go to Settings
  3. Copy your API key

Step 2: Add API key to Jenkins

  1. Go to Manage JenkinsCredentials
  2. Add a Secret text credential
  3. ID: FIXSENSE_API_KEY
  4. Secret: paste your API key

Step 3: Reference in Jenkinsfile

environment {
    FIXSENSE_API_KEY = credentials('FIXSENSE_API_KEY')
}

Supported Test Frameworks

Any framework that produces JUnit XML reports works with Jenkins + FixSense:

  • Playwright['junit', { outputFile: 'test-results/results.xml' }]
  • Cypresscypress-junit-reporter
  • Jestjest-junit
  • pytest--junitxml=test-results/results.xml
  • JUnit/TestNG — Native JUnit XML output
  • NUnit/xUnitdotnet test --logger "junit"
  • .NET TRX — FixSense parses TRX natively

What You Get

For each failing test, FixSense provides on your dashboard:

  • Root Cause — AI-powered explanation of why the test failed
  • App Bug vs Test Bug — classification of the failure source
  • Flakiness Score — 0-100 indicating likelihood of flaky behavior
  • Suggested Fix — actionable steps to resolve the failure

Limitations

Jenkins integration uses the FixSense API directly (no webhook). This means:

FeatureJenkins Support
AI failure analysisYes
Flakiness scoringYes
DashboardYes
PR commentsNot yet — roadmap
Auto-fix agentNot yet — roadmap
Quality gatesNot yet — roadmap

For full auto-fix and PR comment support, consider using GitHub Actions, GitLab CI, Azure Pipelines, or Bitbucket Pipelines.

Troubleshooting

No analyses appear after build failure

  1. Check that your Jenkinsfile produces JUnit XML in test-results/
  2. Verify FIXSENSE_API_KEY credential is set correctly
  3. Check the post-build step runs only on failure (when condition)
  4. Check Jenkins console output for curl errors

"Unauthorized" error from API

Verify your API key is correct and hasn't expired. Get a new key from dashboard settings.