Skip to content

Test:migrate langfuse routes api - #21050

Merged
wangq8 merged 9 commits into
infiniflow:mainfrom
flyingwhit:test/migrate-langfuse-routes-api-rest-helper
Oct 16, 2026
Merged

wangq8 merged 9 commits into
infiniflow:mainfrom
flyingwhit:test/migrate-langfuse-routes-api-rest-helper

Conversation

@flyingwhit

Copy link
Copy Markdown
Contributor

PR Summary

What

Port test/testcases/restful_api/test_langfuse_routes.py into test/api/langfuse_routes_api_test.go

Changes

  • Add test/api/langfuse_routes_api_test.go:
    • TestLangfuseAPIKeyRoutesRequireAuth drives GET/POST/PUT/DELETE through
      restCall with an unauthenticated *TestConfig copy (APIKey cleared) and
      asserts HTTP 401 / code 401 / "Missing Authorization header". POST and PUT
      carry a full body, so the test also locks auth-before-binding.
    • TestLangfuseAPIKeyMissingRequiredFields posts an empty secret_key and
      asserts HTTP 200 / code 102 / "missing required fields" via
      requireLangfuseMissingFields.

…nds (infiniflow#20367)"

This reverts commit fc578ea.

The MQ LIST PENDING form is needed again. Note that restoring the CLI
plumbing alone does not make it filter: the admin handler and the NATS
engine still ignore the pending flag.
Port test/testcases/restful_api/test_langfuse_routes.py to test/api
using the shared restCall / restCode / restResult helpers.

- TestLangfuseAPIKeyRoutesRequireAuth: GET/POST/PUT/DELETE without a
  token answer HTTP 401 / code 401 / "Missing Authorization header"
- TestLangfuseAPIKeyMissingRequiredFields: POST with an empty
  secret_key answers HTTP 200 / code 102 / "missing required fields"

The Python test is kept until the restful suite is migrated as a whole.
@flyingwhit flyingwhit added the ci Continue Integration label Oct 16, 2026
@flyingwhit
flyingwhit requested a review from wangq8 October 16, 2026 03:29
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2ae6aa52-3b91-4a06-9a24-f70693e1d7ec
📥 Commits

Reviewing files that changed from the base of the PR and between 6303d2f and ebc4d5e.

📒 Files selected for processing: 1
  • test/api/langfuse_routes_api_test.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

The pull request adds integration tests for the Langfuse API-key route. The tests check authentication responses for GET, POST, PUT, and DELETE requests, plus the missing-fields response for a POST request with an empty secret key.

Changes: Langfuse API-key route tests

Layer / File(s) Summary
Route response checks
test/api/langfuse_routes_api_test.go
Adds a helper to check the missing-fields response. Tests verify that unauthenticated requests return HTTP 401 and the Missing Authorization header message. A POST with an empty secret_key is checked for the missing-fields response.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to ebc4d

This change adds coverage for unauthenticated API-key requests and missing required fields without changing production behavior. No material merge blocker is identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title identifies the migration of Langfuse route API tests. It is concise and related to the main change, although its capitalization and punctuation could be improved.
Description check Passed The description explains the migration objective and lists the added tests, request methods, assertions, and authentication behavior. It does not use the template's exact "### Summary" heading, but it…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks each route with care
Four methods find no key to share
An empty secret gets its test
The missing-fields response joins the quest
Then hops away to nibble greens

Comment @coderabbitai help to get the list of available commands.

@wangq8
wangq8 merged commit 919d16f into infiniflow:main Oct 16, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants