Logilica Documentation
HomepageDemoBlogContact
  • About Logilica
    • Overview
  • Getting Started
    • Onboarding Data
    • Onboarding Users
    • Setting up Teams
  • Integration
    • Connecting Tools
    • Uploading Custom Data
  • Metrics & Reports
    • Introduction
      • Navigation
      • Dashboards
      • Data Exploration
    • Epics Delivery Tracker
    • Planning
      • Ticket Lead Time
      • Ticket Velocity
      • Ticket Overload
      • Sprint Health
      • Ticket Activities / Risks
    • Code
      • Code Cycle Time
      • Coding Velocity
      • Review Process
      • Developer Health
      • Code Activities / Risks
    • Build
    • Team Management
      • Teams Overview
      • Team Pulse
      • Activity Lens
    • Reports
    • Customization
    • Glossary
  • Configuration
    • User Management
    • Managing Contributors
    • Menu Management
    • Release Detection
    • Targets & Thresholds
    • DORA Configuration
  • Advanced
    • API Token Management
    • Import API
      • API Overview
      • Uploading Planning Data
      • Uploading CI Build Data
        • CDEvents Integration
      • Uploading Test Data
      • Uploading Team Data (beta)
      • Repositories
      • Uploading Contributors Data
    • Export API
    • DataStudio
      • Data Models
        • CI Build
        • CI Build Stage
        • Contributor
        • Coverage Commit
        • Coverage File
        • Coverage Label
        • Coverage Test Result
        • Jira Component
        • Jira Epic
        • Jira Hierarchy Issues
        • Jira Issue Hierarchy Link
        • Jira Issue
        • Jira Issue
        • Jira Label
        • Jira Project
        • Jira Release
        • Jira Sprint
        • Project
        • Pull Request
        • Pull Request
        • Release
        • Team
      • Advanced Transformations
    • Integrations: Data Mapping
      • GitHub Projects Support
  • SSO Integration
    • Keycloak SSO
    • Microsoft Entra SSO
  • Subprocessors
  • Changelog
Powered by GitBook
On this page
  1. Advanced
  2. Import API

Uploading Test Data

PreviousCDEvents IntegrationNextUploading Team Data (beta)

Last updated 2 months ago

Upload Example Using cURL

In the following, we provide an example of how to push your Test data into Logilica for storage and built-in analytics.

Important: Ensure the repository you build from is already onboarded in Logilica.

The can be used to retrieve the repoId for the endpoint.

The cURL POST command is below. Note, that the POST command includes the example API token lgca_UeRxFs_3RYRJEJtdYp7j7Wa6DirG5NjiYslsb and the example workspace myworkspace. The command URL also includes a placeholder for the repoID to associate the uploaded issues with.

curl --location --request POST 'https://logilica.io/api/import/v1/coverage/<repoID>/test_run/create' \
--header 'X-lgca-token: lgca_UeRxFs_3RYRJEJtdYp7j7Wa6DirG5NjiYslsb' \
--header 'x-lgca-domain: myworkspace' \
--header 'Content-Type: application/json' \
--data-raw '[
    {
        "id": "123",
        "testID": "test1",
        "commitHash": "8c39c46e512541fd9431fad3109cfab1816cfdbb",
        "branch": "master",
        "name": "Test Run 1",
        "outcome": "success",
        "outcomeCategory": "Pass",
        "duration": 1234567890,
        "timestamp": 1738813508,
        "additionalFields": [
            {
                "key": "type",
                "value": "unit"
            },
            {
                "key": "foor",
                "value": "bar"
            }
        ],
        "pullRequest": "1357"
    },
    {
        "id": "456",
        "testID": "test2",
        "commitHash": "qdbjtecjed35b9d5d5bb2854e908c5a29edfcd61",
        "branch": "master",
        "name": "Test Run 2",
        "outcome": "failed",
        "outcomeCategory": "Failure",
        "duration": 1234567890,
        "timestamp": 1738813508,
        "additionalFields": [
            {
                "key": "type",
                "value": "integration"
            }
        ],
        "pullRequest": "2468"
    }
]'

API Schema for Importing Test Data

Questions?

If you have any questions or run into issues, please contact us at support@logilica.com.

Repositories API
  • Upload Example Using cURL
  • API Schema for Importing Test Data
  • POSTcoverage/{repoID}/test_result/create
  • POSTcoverage/{repoID}/commit/create
  • Questions?
post

Create a test report

Path parameters
repoIDstringRequired
Body
idstringRequired

The ID of this test result.

testIDstringRequired

The test ID this result belong to.

commitHashstringRequired

The commit hash this test result is associated to.

branchstringRequired

The branch of the commit this test result is associated to.

namestringRequired

The name of the test run.

outcomestringRequired

The outcome of the test results.

outcomeCategorystring · enumRequired

The outcome category (one of 'Pass, 'Failure', 'Skipped')

Possible values:
durationnumberRequired

The duration of the test run in seconds.

failureMessagestringOptional

If any, the failure message associated to a failed test.

isAutomatedbooleanOptional

Was the Test automated? (set to True if this field is not supplied).

Default: true
timestampnumberRequired

UNIX timestamp of the test result.

labelsstring[]Optional

List the label(s) this Test Result is associated to (e.g. environments).

urlstringOptional

The associated url.

pullRequeststringOptional

Related Pull Request (ID).

Responses
200
Success
application/json
400
Data given doesn't match schema. Return value will be ZodError with validation message
401
Unauthorized
404
RepoID not found
application/json
500
Failed to process request
application/json
post
POST /api/import/v1/coverage/{repoID}/test_result/create HTTP/1.1
Host: logilica.io
Content-Type: application/json
Accept: */*
Content-Length: 296

[
  {
    "id": "text",
    "testID": "text",
    "commitHash": "text",
    "branch": "text",
    "name": "text",
    "outcome": "text",
    "outcomeCategory": "Pass",
    "duration": 1,
    "failureMessage": "text",
    "isAutomated": true,
    "timestamp": 1,
    "labels": [
      "text"
    ],
    "url": "text",
    "additionalFields": [
      {
        "key": "text",
        "value": "text"
      }
    ],
    "pullRequest": "text"
  }
]
{
  "message": "text"
}
post

Create a commit test report

Path parameters
repoIDstringRequired
Body
originstringRequired

The repository service used.

commitHashstringRequired

The commit hash of the commit test report.

timestampnumberRequired

UNIX timestamp of the commit.

branchstringRequired

The branch the commit was committed on.

statestring · enumRequired

The state of the test report. (one of 'Complete', 'Pending', 'Error', 'Skipped')

Possible values:
passedCIbooleanOptional

Whether commit passed CI

numberOfFilesnumberRequired

Numbers of files covered in this test report.

totalLoCnumberRequired

Total number of lines covered in this test report.

hitsnumberRequired

Number of lines that was executed by the test.

partialsnumberRequired

Number of lines that was not fully executed by the test.

missnumberRequired

Number of lines that was not executed by the test.

coveragenumberRequired

The resulting percentage of coverage for this report.

urlstringOptional

The associated url.

Responses
200
Success
application/json
400
Data given doesn't match schema. Return value will be ZodError with validation message
401
Unauthorized
404
RepoID not found
application/json
500
Failed to process request
application/json
post
POST /api/import/v1/coverage/{repoID}/commit/create HTTP/1.1
Host: logilica.io
Content-Type: application/json
Accept: */*
Content-Length: 374

[
  {
    "origin": "text",
    "commitHash": "text",
    "author": {
      "name": "text",
      "email": "name@gmail.com",
      "accountId": "text",
      "lastActivity": 1
    },
    "timestamp": 1,
    "branch": "text",
    "state": "Complete",
    "passedCI": true,
    "numberOfFiles": 1,
    "totalLoC": 1,
    "hits": 1,
    "partials": 1,
    "miss": 1,
    "coverage": 1,
    "files": [
      {
        "path": "text",
        "totalLoC": 1,
        "hits": 1,
        "partials": 1,
        "miss": 1,
        "coverage": 1,
        "url": "text"
      }
    ],
    "url": "text"
  }
]
{
  "message": "text"
}