Skip to content

feat(version-tests): Add comprehensive API coverage to TagsTester#443

Open
Liljis wants to merge 2 commits intodocling-project:mainfrom
Liljis:feature/version-tester
Open

feat(version-tests): Add comprehensive API coverage to TagsTester#443
Liljis wants to merge 2 commits intodocling-project:mainfrom
Liljis:feature/version-tester

Conversation

@Liljis
Copy link
Copy Markdown

@Liljis Liljis commented Apr 4, 2026

Description

Expanded the version compatibility tests in TagsTester.java to include comprehensive API coverage beyond just the convert source endpoint, as requested in #134.

Changes Made

Added 5 new test methods to doConversion() in TagsTester.java:

  1. testConvertWithMultipleFormats - Tests conversion with MARKDOWN, JSON, and TEXT output formats ( already existed, done only refactoring)

  2. testConvertWithJsonFormat - Validates JSON output and DoclingDocument deserialization

  • Requests only JSON format
  • Tests: "Can we properly deserialize the JSON into a DoclingDocument Java object?"
  • Validates: The JSON structure is correct and can be parsed into the Java class
  • Checks: Specific fields like getName() work correctly
  1. testConvertWithDifferentOptions - Tests conversion with OCR, images, table mode, and custom timeout
  • Extracts text from images in the document
  • Embeds or references images in the converted output
  • Controls how tables are extracted and formatted
  • Sets maximum time for document processing
  1. testClearConverters - Tests the /v1/clear/converters endpoint
  • Clears cached converter instances (PDF parsers, OCR engines, etc.)
  1. testClearResults - Tests the /v1/clear/results endpoint
  • Clears cached conversion results (the actual converted documents)

Motivation

The previous implementation only tested the basic convert source API. This enhancement provides:

  • Better coverage of the Docling Serve API surface
  • Validation of multiple endpoints (health, convert, clear)
  • Testing of various conversion options and output formats
  • More comprehensive compatibility checks across versions

Test Results

  • Build successful with no compilation errors
  • All v1.x versions (v1.0.0+) pass all 6 tests
  • v0.x versions fail as expected (AP
    results.md

Copy link
Copy Markdown
Contributor

@edeandrea edeandrea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Liljis for this! See comments in-line.

The comments about "spelling out" the full class name apply in other places I saw. We can just import the classes.

Also, do you consider this PR complete? I was hoping to get some tests of more than just the convertSource operation too. Some of the async operations, chunking, etc.

Its fine either way. We can certainly "baby step" adding more tests, but I'm not going to consider #134 as "complete" until more tests of the other operations are added as well.

FWIW there are other unit tests in https://github.com/docling-project/docling-java/blob/main/docling-serve/docling-serve-client/src/test/java/ai/docling/serve/client/AbstractDoclingServeClientTests.java that can be "borrowed" and re-implemented here.

@edeandrea edeandrea force-pushed the feature/version-tester branch from eab892a to d2596ce Compare April 7, 2026 15:41
@edeandrea
Copy link
Copy Markdown
Contributor

Also, before I can merge this, can you please ensure both the DCO check and the semantic PR check passes? You may need to ammend your commit and do a signoff.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

:java_duke: JaCoCo coverage report

Overall Project 46.79% 🔴

There is no coverage information present for the Files changed

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

TestsPassed ✅SkippedFailed
Gradle Test Results (all modules & JDKs)1002 ran1002 passed0 skipped0 failed
TestResult
No test annotations available

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

- Add missing imports for ResponseType, TableFormerMode, ClearConvertersRequest, and ClearResultsRequest
- Replace fully qualified class names with simple names throughout the file
- Improves code readability by following standard Java import conventions
@Liljis Liljis marked this pull request as ready for review April 14, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants