You are working on the hyperswitch repository (Rust payment processing system).…
- User
You are working on the hyperswitch repository (Rust payment processing system).
REPOSITORY SETUP:
- Repository: juspay/hyperswitch
- Working directory: ./repos/hyperswitch_pool_8 (already cloned)
- Base commit: 1991e38457f713daeb280e22b2dd19c2944840b6
- Task ID: juspay__hyperswitch-8595
- Version: v1.115.0
TASK DESCRIPTION: Bug: fix(cypress): cypress tests for incremental auth getting skipped for all connectors
📌 Problem
The Cypress test suite
00029-IncrementalAuth.cy.jsis currently being entirely, even though it should work forcybersource.DETAILED CONTEXT & HINTS:
Type of Change
- Bugfix
- New feature
- Enhancement
- Refactoring
- Dependency updates
- Documentation
- CI/CD
Description
This PR introduces a set of improvements and refactors in the Cypress test suite specifically for Incremental Authorization test cases.
✅ Key Changes:
-
Connector Inclusion List for Incremental Auth
- Introduced a new list
INCREMENTAL_AUTHinUtils.jsunderCONNECTOR_LISTS.INCLUDE. - This inclusion list determines which connectors support Incremental Authorization and should execute related tests.
- Introduced a new list
-
Dynamic Skipping of Tests Based on Connector Support
- Refactored the test flow to dynamically
skip()test blocks at runtime if the connector isn't included inINCREMENTAL_AUTH. - Prevents false negatives and unwanted test runs on unsupported connectors (like CyberSource with known
MULTIPLE_CONNECTORSissues).
- Refactored the test flow to dynamically
-
Refactored
beforeandafterHooks- Replaced arrow functions with regular functions in
before()hooks to correctly utilizethis.skip(). - Ensured proper state flushing with
afterEachinstead ofafter.
- Replaced arrow functions with regular functions in
-
Improved Capture Test for Incremental Auth
- Modified the capture test logic to simulate an incremented capture amount.
- Prevents test result from falling into
partially_captureddue to stalepreviously_authorized_amount.
-
Enhanced Assertions for Incremental Auth Response
- Added deep assertions for
previously_authorized_amountfromincremental_authorizationsto validate correctness of incremental logic. - Ensures the captured amount matches the expected post-incremented value.
- Added deep assertions for
🧪 Test Impact:
- Only connectors in
INCREMENTAL_AUTHlist will now run Incremental Authorization tests. - Currently includes:
cybersource(commented out due to known issue),paypal, andarchipel(handled in related PR #8189). - Other connectors will auto-skip these tests, improving CI stability and relevance.
💡 Reference
Followed the pattern used in working test files like
00020-MandatesUsingNTIDProxy.cy.js, which implementthis.skip()with proper connector inclusion checks.Additional Changes
- This PR modifies the API contract
- This PR modifies the database schema
- This PR modifies application configuration/environment variables
Motivation and Context
The test suite for Incremental Auth (
00029-IncrementalAuth.cy.js) was being entirely skipped due to usage ofdescribe.skipand context handling.How did you test it?
Cybersource (Skipped) ArchiPEL Sanity
Stripe Adyen Bluesnap Bank of America Checklist
- I formatted the code
cargo +nightly fmt --all - I addressed lints thrown by
cargo clippy - I reviewed the submitted code
- I added unit tests for my changes where possible
CRITICAL INSTRUCTIONS - WORK FAST AND EFFICIENTLY:
-
Create DENSE, ACTION-FOCUSED todos IMMEDIATELY
- Make todos specific and actionable
- Focus on HIGH-IMPACT actions only
- 5-8 todos maximum - be surgical, not exhaustive
-
Execute aggressively:
- Use bash commands to search efficiently
- Read multiple related files in quick succession
- Make ALL related changes in one edit
- Skip unnecessary exploration
-
File operations:
- All repo files: './repos/hyperswitch_pool_8/'
- Use targeted edits over whole file rewrites
-
NO TESTING UNLESS CRITICAL:
- Focus on making the actual code changes
- Only test if explicitly required
-
Maximize information density:
- Each turn should accomplish significant work
- Batch file reads when examining related code
- Use search commands to locate code quickly
EFFICIENCY IS CRITICAL. Make substantial progress every turn.
Assistant
I'll help you fix the Cypress tests for incremental auth that are being skipped for all connectors. Let me start by understanding the problem and exploring the relevant files.
First, let me create a plan for addressing this issue:
Assistant
Let me first examine the problematic test file to understand the current implementation:
Assistant
Let me search for the incremental auth test file in the repository:
Assistant
Now let me examine the incremental auth test file:
Assistant
Now let me check the Utils.js file to understand the connector lists:
Assistant
Let me search for the Utils.js file:
Assistant
Let me check the Payment/Utils.js file since that's likely the one being referenced:
Assistant
Now I can see the issue! Looking at the IncrementalAuth.cy.js file, I noticed that it uses
describe.skip("[Payment] Incremental Auth", () => {which skips the entire test suite, rather than selectively skipping individual tests. According to the task description, there should be anINCREMENTAL_AUTHlist in theCONNECTOR_LISTS.INCLUDEsection. Let me also look at how other test files handle conditional skipping properly.Let me look at the MandatesUsingNTIDProxy test to see the correct pattern:
Assistant
Now I understand the problem. Let me update my todo list to reflect the precise actions needed:
Assistant
Now I'll make the necessary fixes. First, I'll add the INCREMENTAL_AUTH list to the CONNECTOR_LISTS in Utils.js:
Assistant
I need to read the file first before making changes. Let me read it again to make sure I have the right context:
Assistant
Now I'll make the edit to add the INCREMENTAL_AUTH list:
Assistant
Let me read the current state of the IncrementalAuth.cy.js file again and then implement the fix properly by changing the approach. The main issue is that it's using
describe.skipwhich skips everything. Let me rewrite the entire test file properly:Assistant
I'll implement the fix for the Cypress tests. I need to modify the IncrementalAuth.cy.js file to use dynamic skipping instead of
describe.skipand properly implement the connector support checking.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
claude-sonnet-4-5-20250929Compare side by side →
claude-sonnet-4-5-20250929Compare side by side →
claude-sonnet-4-5-20250929Compare side by side →
claude-sonnet-4-5-20250929Compare side by side →
claude-sonnet-4-5-20250929Compare side by side →
claude-sonnet-4-5-20250929Compare side by side →
claude-sonnet-4-5-20250929Compare side by side →
claude-sonnet-4-5-20250929Compare side by side →
claude-sonnet-4-5-20250929Compare side by side →
claude-sonnet-4-5-20250929Compare side by side →
claude-sonnet-4-5-20250929Compare side by side →