Skip to content

About

GroupDocs.Watermark for .NET MCP server integration tests — verify NuGet, Docker Hub, GHCR, and MCP Registry deployments end-to-end.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

GroupDocs.Watermark.Mcp.Tests

Integration tests for the GroupDocs.Watermark.Mcp NuGet package — an MCP server that exposes GroupDocs.Watermark as AI-callable tools.

This repository validates the published NuGet artifact end-to-end: it launches the server via dnx, connects as an MCP client, and exercises every advertised tool. It also doubles as a copy-pasteable set of example configs and user-facing how-to guides for every deployment channel.

Documentation

What gets tested

Area Covered by
Package installs and starts via dnx McpServerFixture
MCP handshake, server info, tool list (5 tools) ToolDiscoveryTests
add_watermark — synthetic PDF + 6 real samples (PDF/DOCX/XLSX/PPTX/PNG/VSDX) + custom font/rotation + password AddWatermarkTests
add_image_watermark — image overlay across formats AddImageWatermarkTests
search_watermarks — zero-watermark + real-sample JSON shape + add-then-search roundtrip + password SearchWatermarksTests
remove_watermarks — strip-all + text-filter + roundtrip RemoveWatermarksTests
get_document_info — file type + page count + per-page dimensions GetDocumentInfoTests
Unknown / corrupted files, password parameter ErrorHandlingTests

Running locally

Requires .NET 10 SDK.

dotnet test

Test a specific published version:

dotnet test -p:McpPackageVersion=26.7.0
# or
MCP_PACKAGE_VERSION=26.7.0 dotnet test

The first run downloads the NuGet package — subsequent runs are cached.

CI

.github/workflows/integration.yml runs on:

  • Every push / PR.
  • Nightly cron — catches regressions in nuget.org, the dnx shim, or the .NET runtime.
  • workflow_dispatch with a package_version input — manual smoke of any version.
  • repository_dispatch (nuget-published) — fires from the main repo's publish pipeline so every release is smoke-tested against live nuget.org. See Release smoke hook.

Matrix: ubuntu-latest, windows-latest, macos-latest. Linux runners install libgdiplus libfontconfig1 ttf-mscorefonts-installer (with the Microsoft EULA pre-accepted via debconf-set-selections, plus fc-cache -f -v to refresh the font registry). AddWatermark renders Arial glyphs and needs MS core fonts; bare ubuntu-24.04 does not ship them.

Release smoke hook

To auto-verify each release, add this step to the main repo's publish workflow after the dotnet nuget push step:

- name: Dispatch smoke tests
  env:
    GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  run: |
    gh api repos/groupdocs-watermark/GroupDocs.Watermark.Mcp.Tests/dispatches \
      -f event_type=nuget-published \
      -f 'client_payload[package_version]=${{ steps.version.outputs.version }}'

Evaluation vs licensed mode

Unlike GroupDocs.Metadata.Save() which throws in evaluation mode, GroupDocs.Watermark runs successfully without a license — it simply adds an additional evaluation watermark alongside the user-requested one. Tests therefore run identically with or without GROUPDOCS_LICENSE_PATH; the license only affects whether the response text carries an eval-mode banner.

For CI, store a base64-encoded .lic file as repo secret GROUPDOCS_LICENSE — the workflow decodes it into $RUNNER_TEMP and exports GROUPDOCS_LICENSE_PATH automatically. Useful for verifying the unlicensed banner is suppressed.

Fixture documents

Sample documents are built from byte-arrays in SampleDocuments.cs at test startup — no binary files are checked into this repo.

To add a real-world fixture, drop it into sample-docs/ and write a test that references it by filename. The project auto-copies everything in sample-docs/ to the test output.

License

MIT — see LICENSE

About

GroupDocs.Watermark for .NET MCP server integration tests — verify NuGet, Docker Hub, GHCR, and MCP Registry deployments end-to-end.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages