You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何清理Allure TestOps中的旧报告数据?

Alright, let's walk through the feasible ways to clean up old report data in Allure TestOps—covering both built-in tools and custom solutions to fit different needs:

This is the safest and most maintainable method, as it's natively supported by Allure TestOps and requires no manual intervention once configured:

  • Navigate to the Admin section, then go to Settings > Data Retention
  • You can set retention periods for different data types: test reports, launch records, historical test results, etc. For example, set to keep only the last 90 days of reports
  • Once configured, the system will automatically run scheduled cleanup jobs to remove expired data, so you don't have to handle it manually
2. Manual Bulk Deletion for Targeted Cleanup

If you need to wipe specific batches of old data (like all reports from a deprecated project), use the UI's bulk delete feature:

  • Go to your target project, switch to the Launches tab (since reports are tied to launches)
  • Use the filter options to narrow down old entries: filter by creation date, launch status, or test suite
  • Check all the launches you want to remove, then click the Delete button at the top of the list
  • Important: Export any data you need to keep first—this action is irreversible
3. Automate Cleanup with the REST API

For custom cleanup workflows (like deleting only failed old reports or running weekly cleanup jobs), use Allure TestOps' REST API:

  • First, generate an API access token from your user profile settings
  • Use the GET /api/launch endpoint to fetch launches matching your criteria (use the createdBefore parameter to target old entries)
  • Batch-delete the retrieved launches using the DELETE /api/launch/{id} endpoint
  • Wrap this logic in a script (Python, Shell, etc.) and set up a cron job or scheduled task to run it automatically
4. Database-Level Cleanup (Advanced, Use with Caution)

Only consider this if you have deep knowledge of Allure TestOps' database schema and need to remove extremely old data that the above methods can't handle:

  • Always back up your entire database first before making any direct changes
  • Locate the core tables related to reports and launches: launch, attachment, test_result, and report
  • Write targeted SQL queries to delete old records, e.g.:
    DELETE FROM launch WHERE created_date < '2023-01-01';
    DELETE FROM attachment WHERE launch_id IN (SELECT id FROM launch WHERE created_date < '2023-01-01');
    
  • After running the queries, restart the Allure TestOps service to sync the application cache with the updated database

Key Notes:

  • Backup first, always: No matter which method you choose, never skip backing up critical data before deletion
  • Prioritize built-in policies: They're designed to work safely with the platform and avoid unintended data loss
  • API automation is great for repeatable, custom cleanup rules that fit your team's workflow

内容的提问来源于stack exchange,提问作者newbie_ABD

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.30 05:47:26