Use the prompt
Include the assertion, actual result, and relevant implementation. The expected behavior helps distinguish a regression from a test that no longer describes what the application should do.
Understand why tests fail, identify root causes, and determine if the code or test needs fixing.
For GitLab Duo
This test is failing:
Test: [TEST NAME]
Error: [PASTE ERROR MESSAGE]
Test code: [PASTE TEST CODE]
Help me understand:
1. Why is it failing?
2. What's the root cause?
3. How do I fix it?
4. Should I fix the code or the test?Include the assertion, actual result, and relevant implementation. The expected behavior helps distinguish a regression from a test that no longer describes what the application should do.
A test fails for an order worth exactly $50. The product rule is that shipping is free at $50 or more, but the implementation and test disagree at that boundary. This is a small enough example to check Duo's reasoning yourself.
Explore the example