Skip to content

DEBUG: Test all RPC methods against PR #4451 changes#109

Closed
atodorov wants to merge 2 commits into
masterfrom
debug-test-all-rpc-against-pr4451
Closed

DEBUG: Test all RPC methods against PR #4451 changes#109
atodorov wants to merge 2 commits into
masterfrom
debug-test-all-rpc-against-pr4451

Conversation

@atodorov

Copy link
Copy Markdown
Member

DEBUG Commit

This PR adds a comprehensive integration test that exercises ALL RPC methods exposed by Kiwi TCMS against the django-modern-rpc v2.1.0 migration in kiwitcms/Kiwi#4451.

What changed in PR #4451

The server-side RPC decorator pattern changed:

  • Before: modernrpc.core.rpc_method + @permissions_required + **kwargs with REQUEST_KEY
  • After: tcms.rpc.views.rpc_method with auth= and context_target=\rpc_context\

What this tests

  • Read-only filter operations on all RPC namespaces
  • Write operations (create, update, remove) - expected to fail with PermissionDenied for unprivileged users
  • RPC methods that use **kwargs/rpc_context for request access (add_tag, add_comment, etc.)
  • Methods that pass parameters differently in the new pattern

How to run

make verify-integration

or

PYTHONPATH=. pytest -v ./tests/krb5/debug_test_all_rpc.py

This is a DEBUG commit and should be reverted after verification is complete.

This commit adds a comprehensive integration test that exercises ALL RPC
methods exposed by Kiwi TCMS. It is designed to validate compatibility
with the django-modern-rpc v2.1.0 migration in PR #4451, which changes:

  - from: modernrpc.core.rpc_method + @permissions_required + **kwargs
  - to:   tcms.rpc.views.rpc_method with auth= and context_target=

The test covers read-only operations (filter), write operations (create,
update, remove), and RPC methods that use **kwargs/rpc_context for
request access (add_tag, add_comment, etc.).

Write operations that fail due to missing permissions are caught and
asserted as expected (returning PermissionDenied), because the goal is
to verify that the RPC method is reachable and responds correctly,
not to bypass security.

This is a DEBUG commit and should be reverted after the PR #4451
changes are verified.
doesn't have sufficient permissions.
"""

import os
self.rpc.TestCase.add_tag(case_id, tag_name)
try:
self.rpc.TestCase.remove_tag(case_id, tag_name)
except Exception:
self.rpc.TestPlan.add_tag(plan_id, tag_name)
try:
self.rpc.TestPlan.remove_tag(plan_id, tag_name)
except Exception:
self.assertIsNotNone(result)
try:
self.rpc.TestRun.remove_tag(run_id, tag_name)
except Exception:
self.rpc.TestExecution.remove_comment(
exec_id, comment_result["id"]
)
except Exception:
@atodorov atodorov closed this Jul 16, 2026
@atodorov
atodorov deleted the debug-test-all-rpc-against-pr4451 branch July 16, 2026 20:14
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