Skip to content

Conversation

@hemanth-kumar-glean
Copy link
Contributor

@hemanth-kumar-glean hemanth-kumar-glean commented Dec 9, 2025

Handle Behave “error” Status as FAILED in ReportPortal (Introduced in Behave 1.2.7)

Behave 1.2.7 introduced a new result status called error, but ReportPortal doesn’t automatically interpret it.
Because of this, any scenario marked as error was previously reported as PASSED.

This update ensures that Behave’s error status is correctly mapped to FAILED in ReportPortal, preventing false positives and improving result accuracy.

Summary by CodeRabbit

  • Bug Fixes
    • Improved error status reporting to correctly display test errors as failed in test reports.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 9, 2025

Walkthrough

The convert_to_rp_status function in behave_reportportal/behave_agent.py has been updated to handle an additional behave status case: "error" now maps to "FAILED" alongside the existing mappings for "passed", "failed", and "skipped".

Changes

Cohort / File(s) Summary
Status mapping enhancement
behave_reportportal/behave_agent.py
Added handling for "error" behave status → maps to "FAILED" in convert_to_rp_status function

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A status was missing, oh what a sight!
When "error" came calling, we weren't quite right.
Now "FAILED" it returns, with grace and with care,
Status mapping's complete—no bugs left to spare! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title 'Handle Behave "error" Status as FAILED in ReportPortal' clearly and specifically summarizes the main change: mapping Behave's error status to FAILED in ReportPortal, which is the core objective of the PR.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
behave_reportportal/behave_agent.py (1)

524-525: Mapping Behave "error" to FAILED looks correct; consider broader consistency

The new "error" -> "FAILED" mapping aligns with the PR goal and fixes the prior issue where "error" fell into the default "PASSED" branch. That part looks good.

As a follow-up, you may want to check whether Behave 1.2.7 surfaces "error" via status.name in other places where this file currently special-cases only "failed" (e.g., finish_scenario, _finish_step_step_based, _finish_step_scenario_based). If "error" is a distinct status there as well, you might want to treat it like "failed" for exception logging and any other failure-specific handling to keep behavior consistent across the integration. This is an enhancement, not a blocker for this change.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1516e83 and 7f5b721.

📒 Files selected for processing (1)
  • behave_reportportal/behave_agent.py (1 hunks)

@hemanth-kumar-glean hemanth-kumar-glean changed the title Handle behave error as Failed in report portal introduced in behave 1.2.7 Handle Behave “error” Status as FAILED in ReportPortal Dec 9, 2025
Copy link
Member

@HardNorth HardNorth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.18%. Comparing base (1516e83) to head (7f5b721).

Files with missing lines Patch % Lines
behave_reportportal/behave_agent.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #55      +/-   ##
===========================================
- Coverage    99.45%   99.18%   -0.27%     
===========================================
  Files            3        3              
  Lines          366      368       +2     
===========================================
+ Hits           364      365       +1     
- Misses           2        3       +1     
Flag Coverage Δ
unittests 99.18% <50.00%> (-0.27%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@HardNorth HardNorth merged commit 35cd7df into reportportal:develop Dec 12, 2025
7 checks passed
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.

3 participants