Skip to content

Unit Tests

Available only in self-hosted version

Description

Unit tests verify individual code units (e.g., methods or classes) in isolation from the rest of the system. They help detect errors early in development and ensure code changes don't break existing functionality.

JUnit Integration

GitFlic supports JUnit report integration, allowing you to view test results directly in the web interface.

Configuration Steps

  1. Add JUnit Reports to Project
    Ensure your project generates JUnit XML reports, typically stored in:
  2. target/surefire-reports (Maven)
  3. Or equivalent directory for your build system (e.g., Gradle)

  4. Configure CI/CD Pipeline
    Update your pipeline configuration file (gitflic-ci.yaml) to publish JUnit reports:

    artifacts:  
      reports:  
        junit:  
          paths:  
          - target/surefire-reports/*  
    

  5. View Reports
    After successful test execution:

  6. Overview: See aggregate results in the pipeline's "Tests" section
  7. Details: Navigate to individual jobs → "Tests" tab for:
    • Test case tables
    • Failure details
    • Status filtering

JUnit Overview
Detailed Test Cases

Automatic translation!

This page has been automatically translated. The text may contain inaccuracies