惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
WordPress大学
WordPress大学
小众软件
小众软件
云风的 BLOG
云风的 BLOG
IT之家
IT之家
人人都是产品经理
人人都是产品经理
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
T
Tailwind CSS Blog
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
宝玉的分享
宝玉的分享
博客园 - Franky
F
Fortinet All Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
GbyAI
GbyAI
Hugging Face - Blog
Hugging Face - Blog
Jina AI
Jina AI
D
Docker
博客园 - 聂微东
C
Check Point Blog
H
Help Net Security

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Stop flying blind on flaky tests — pytest-cloudreport giv...
Ahmad Sharab · 2026-04-26 · via DEV Community

Ahmad Sharabati

If you've ever stared at a CI failure that passes locally, or watched the same test flap for the third time this week with no idea how often it's actually broken — this post is for you.

The problem

pytest's built-in output is great for a single run. But it tells you nothing across runs:

  • Which tests are consistently slow?
  • Is this failure new or has it been flapping for two weeks?
  • Did the last deploy make things better or worse?

You end up either ignoring flakiness until it becomes critical, or building custom tooling you don't have time to maintain.

What pytest-cloudreport does

It's a pytest plugin with two modes:

1. Local HTML report — zero config, zero account needed.

pip install pytest-cloudreport
pytest --cloudreport-local

Enter fullscreen mode Exit fullscreen mode

After your test run you get a self-contained cloudreport.html with a full breakdown: pass/fail/skip counts, duration per test, error output, environment info. Open it in a browser, share it with a teammate, attach it to a ticket.

2. Cloud dashboard — cross-run history, flaky-test detection, team access.

Set an API key and every run uploads automatically:

export PYTEST_CLOUD_API_KEY=your_key_here
pytest

Enter fullscreen mode Exit fullscreen mode

No --cloudreport flag needed — the presence of the key enables it. The upload runs in a background thread with a 5-second timeout, so it never slows down or stalls your CI pipeline.

Flaky test detection

This was the original reason I built it. The dashboard tracks pass/fail across runs and surfaces tests with inconsistent results — not just "it failed today" but "this test has failed 4 out of the last 20 runs."

It also integrates cleanly with pytest-rerunfailures: intermediate retries are ignored and only the final outcome is recorded, so a test that passes on the third attempt counts as one flaky event, not two failures.

CI setup (GitHub Actions example)

- name: Run tests
  env:
    PYTEST_CLOUD_API_KEY: ${{ secrets.PYTEST_CLOUD_API_KEY }}
  run: pytest --cloudreport-local

Enter fullscreen mode Exit fullscreen mode

That's it. You get both the local HTML artifact and the cloud upload in one command.

To attach the report as a CI artifact:

- uses: actions/upload-artifact@v4
  if: always()
  with:
    name: test-report
    path: cloudreport.html

Enter fullscreen mode Exit fullscreen mode

pytest-xdist support

If you run tests in parallel with pytest-xdist, the plugin automatically detects worker processes and only uploads from the controller. No configuration needed, no duplicate uploads.

Escape hatch

For teams where the cloud upload is opt-in only:

CLOUDREPORT_DISABLE=1 pytest

Enter fullscreen mode Exit fullscreen mode

This hard-disables the plugin without uninstalling it — useful if you want it enabled by default in CI but off for local dev.

Environment labelling

Tag runs by environment so you can compare CI vs staging vs production results:

# pytest.ini
[pytest]
cloudreport_environment = staging

Enter fullscreen mode Exit fullscreen mode

Or via env var: PYTEST_CLOUD_ENV=staging.

Getting started

pip install pytest-cloudreport

# Local report only
pytest --cloudreport-local

# With cross-run history (local SQLite)
pytest --cloudreport-local --accumulate

# With cloud dashboard
export PYTEST_CLOUD_API_KEY=your_key
pytest

Enter fullscreen mode Exit fullscreen mode

Free tier covers 1 project and 5,000 tests per day — enough for most projects without a credit card.

Source: github.com/ahmad212o/pytest-cloudreport
PyPI: pytest-cloudreport
Dashboard: cloudreport.dev

Feedback welcome — especially on the flaky-test heuristic and any edge cases you hit with unusual pytest setups.