Skip to content

fix(test): align delete-item integration with authoritative receipt totals#17

Merged
cgoncalves94 merged 1 commit into
mainfrom
codex/hotfix-delete-item-total-test
Feb 8, 2026
Merged

fix(test): align delete-item integration with authoritative receipt totals#17
cgoncalves94 merged 1 commit into
mainfrom
codex/hotfix-delete-item-total-test

Conversation

@cgoncalves94

@cgoncalves94 cgoncalves94 commented Feb 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixes CI failure in tests/integration/receipt/test_receipt_endpoints.py::test_delete_receipt_item.
  • Updates the assertion to match current intended behavior: receipt header total remains authoritative and is not auto-recomputed on item deletion.

Root Cause

  • The test expected total recomputation (total_after_create - item_total), but backend behavior now preserves receipt.total_amount unless explicitly changed via reconciliation/update flows.

Change

  • In test_delete_receipt_item, assert response total_amount equals the original receipt total after deletion.

Validation

  • Targets the exact failing assertion from CI logs.
  • Branch contains only this test hotfix commit (70513a3).

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @cgoncalves94, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a CI failure by updating an integration test to align with the current backend behavior regarding receipt totals. Previously, the test expected the total to recompute after an item deletion, but the backend now preserves the original total unless explicitly modified. The change ensures the test accurately reflects this authoritative total behavior, preventing future false negatives in CI.

Highlights

  • Test Fix for CI Failure: Corrected an integration test that was failing in CI due to an outdated assumption about receipt total recomputation after item deletion.
  • Receipt Total Behavior Alignment: Updated the test_delete_receipt_item assertion to reflect that the receipt header total remains authoritative and is not automatically recomputed upon item deletion, aligning the test with current backend behavior.
Changelog
  • backend/tests/integration/receipt/test_receipt_endpoints.py
    • Updated the docstring for test_delete_receipt_item to clarify that the receipt total remains authoritative and unchanged after item deletion.
    • Modified the test logic to store the original_total of the receipt before any item additions, rather than the total after an item was added.
    • Adjusted the final assertion to verify that the receipt's total_amount after item deletion is equal to the original_total, reflecting the authoritative behavior.
Activity
  • No human activity (comments, reviews, etc.) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@cgoncalves94 cgoncalves94 merged commit 972d0b4 into main Feb 8, 2026
5 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request fixes an integration test for deleting a receipt item to align with new backend behavior where the receipt total is not automatically recomputed. The changes to test_delete_receipt_item correctly reflect this new logic. However, I've pointed out a potential inconsistency with another test, test_create_receipt_item, which still seems to expect the old behavior of total recomputation. This could indicate a gap in test coverage or an incomplete fix, and should be addressed to ensure the test suite is consistent and reliable.

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.

1 participant