portal-testing

Write pytest and vitest tests for a financial data portal covering auth, exports, and SSE.

Updated Jul 27, 2026
One-click install
npx skills add https://github.com/ArthurZizumbo/karisma-data --skill portal-testing-arthurzizumbo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: portal-testing
Source: https://github.com/ArthurZizumbo/karisma-data/tree/main/.claude/skills/portal-testing
Command: npx skills add https://github.com/ArthurZizumbo/karisma-data --skill portal-testing-arthurzizumbo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing consistent backend and frontend tests for the Portal Centralizado de Datos Financieros is error-prone: async connectors, role-based permissions, streaming chat, and non-blocking exports each need specific patterns. This Skill encodes the mandatory testing rules, coverage targets, and ready-to-use test templates so every test follows the same standard. ## Core Features & Use Cases - Async connector tests: pytest-asyncio patterns for silo readers, graceful degradation when a silo fails, and cache TTL hit verification. - RBAC permission matrix: parametrized 401/403 tests across the four roles, plus login, duplicate, and self-demotion edge cases. - Semantic layer, export, and SSE tests: deterministic reference queries on a fixed seed, export non-blocking assertions under 500 ms, and SSE cancellation cleanup checks. - Frontend and smoke tests: Vue Test Utils/vitest patterns for critical components, post-deploy smoke tests, and TTFT/P90 latency measurement with 50+ runs. - Use Case: When adding a new export endpoint, use this Skill to generate the permission matrix tests, the non-blocking concurrency test, and the smoke test entry in one pass. ## Quick Start Ask the assistant to write the pytest permission matrix and SSE cancellation tests for the new endpoint following the portal-testing rules.

Frequently Asked Questions about portal-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test async FastAPI endpoints with pytest?

Use pytest-asyncio with the @pytest.mark.asyncio decorator and an async test client to await endpoint calls. This Skill provides patterns for async connector tests, permission matrices, and streaming endpoints using async context managers.

How to test RBAC permission matrices in an API?

Parametrize tests with pytest.mark.parametrize over path, role, and expected status code tuples. Cover 401 for missing or expired tokens and 403 for authenticated users lacking the required scope, across all defined roles.

How do I test SSE stream cancellation without hanging tasks?

Open the stream with an async client, consume the first event, then exit the context to simulate disconnection. After a short sleep, assert no generator tasks remain in asyncio.all_tasks() to verify cleanup.

Should I mock LLM calls in backend tests?

Yes, always mock the LLM gateway and agent tools in tests to avoid real API calls, cost, and nondeterminism. This Skill mandates mocking Gemini and ADK tools so tests stay deterministic against the fixed seed data.

How do I measure TTFT for a streaming chat endpoint?

Open the SSE stream, time until the first token event arrives, and repeat at least 50 times to compute p50 and p90 percentiles. The measure_ttft.py script automates this with targets of p50 under 700 ms.

What coverage thresholds should a full-stack project enforce?

This project enforces at least 70% backend coverage on auth, semantic layer, and export modules, and 50% frontend coverage on critical components tested with Vue Test Utils and vitest.