failures detected
mar 26, 2026 ยท 14:38 utc branch feature/failing-tests sha 363253a
Diff Coverage
N/A
no diff available
Coverage
86.0%
branch: 52.8% · threshold: 80%
Suite Duration
0s
44 examples · 0 pending
Slowest Test
0.05s
OrderItem#subtotal_cents multiplies quantity by uni
Factory Creates
73
4 unique factories
peak memory 82 MB cpu 2.2s user / 0.2s sys factory.create events 61
Diff Coverage
Failures 4
Coverage
Performance
Factory Health
Insights
Diff coverage is not available. This report was either generated on the base branch or git diff could not be computed.
4
tests failed
4 of 44 examples
Failed Tests
click a test to view details
Test File Duration Error
Order#cancel! sets cancelled_at timestamp spec/models/order_spec.rb :48 0.0s undefined method `cancelled_at' for an instance of Order
CartOptimizer#optimize with discounts applies 5% discount for items over 50 EUR spec/services/cart_optimizer_spec.rb :27 0.01s expected: 11400 got: 12000 (compared using ==)
PaymentService#refund! includes a refund transaction ID spec/services/payment_service_spec.rb :26 0.0s expected `nil.present?` to be truthy, got false
PricingEngine#calculate does not apply volume discount for low stock spec/services/pricing_engine_spec.rb :5 0.0s expected: 1000 got: 960 (compared using ==)
File Coverage Breakdown
click a file to view line-by-line coverage
File Line Cov Branch Cov Uncovered Churn (90d) Risk
app/services/payment_service.rb
68.0%
42.9% 8 6 192
app/services/pricing_engine.rb
83.3%
40.0% 4 11 184
app/services/cart_optimizer.rb
71.4%
33.3% 8 6 172
app/models/order.rb
82.1%
37.5% 5 6 107
Test Duration Distribution
44 examples · 0s total
<0.01s
38
0.01โ€“0.05s
6
0.05โ€“0.1s
0
0.1โ€“0.5s
0
0.5โ€“1s
0
>1s
0
Time by Spec File
File Total Time Examples Avg Time Slowest Example
spec/models/order_item_spec.rb 0.066s 2 0.033s OrderItem#subtotal_cents multiplies quantity by unit price (0.049s)
spec/jobs/inventory_sync_job_spec.rb 0.039s 2 0.02s InventorySyncJob#perform syncs products for active pharmacy (0.028s)
spec/services/shipping_calculator_spec.rb 0.035s 5 0.007s ShippingCalculator#calculate adds weight surcharge for large (0.027s)
spec/models/order_spec.rb 0.034s 8 0.004s Order#recalculate_total! sums order item subtotals (0.011s)
spec/models/product_spec.rb 0.029s 13 0.002s Product#reserve! decrements stock (0.004s)
spec/services/cart_optimizer_spec.rb 0.024s 3 0.008s CartOptimizer#optimize with discounts applies 5% discount for (0.01s)
spec/models/pharmacy_spec.rb 0.008s 6 0.001s Pharmacy validations requires unique code (0.003s)
spec/services/payment_service_spec.rb 0.008s 4 0.002s PaymentService#authorize! raises for already confirmed orders (0.002s)
spec/services/pricing_engine_spec.rb 0.003s 1 0.003s PricingEngine#calculate does not apply volume discount for lo (0.003s)
Slowest Examples (top 20)
click a test to view source
Example File Duration Status
OrderItem#subtotal_cents multiplies quantity by unit price spec/models/order_item_spec.rb :5 0.05s pass
InventorySyncJob#perform syncs products for active pharmacy spec/jobs/inventory_sync_job_spec.rb :13 0.03s pass
ShippingCalculator#calculate adds weight surcharge for large orders spec/services/shipping_calculator_spec.rb :26 0.03s pass
OrderItem callback recalculates order total on save spec/models/order_item_spec.rb :13 0.02s pass
Order#recalculate_total! sums order item subtotals spec/models/order_spec.rb :57 0.01s pass
InventorySyncJob#perform skips inactive pharmacies spec/jobs/inventory_sync_job_spec.rb :17 0.01s pass
CartOptimizer#optimize with discounts applies 5% discount for items over 50 EUR spec/services/cart_optimizer_spec.rb :27 0.01s failed
CartOptimizer#optimize returns the cheapest pharmacy spec/services/cart_optimizer_spec.rb :6 0.01s pass
CartOptimizer#optimize raises when no pharmacies available spec/services/cart_optimizer_spec.rb :16 0.01s pass
Order#ship! ships confirmed orders spec/models/order_spec.rb :26 0.01s pass
Product#reserve! decrements stock spec/models/product_spec.rb :69 0.0s pass
Product scopes .active returns only active products spec/models/product_spec.rb :32 0.0s pass
Product scopes .by_category filters by category spec/models/product_spec.rb :44 0.0s pass
Product scopes .in_stock returns products with stock > 0 spec/models/product_spec.rb :38 0.0s pass
Order#confirm! sets status to confirmed spec/models/order_spec.rb :18 0.0s pass
Order#cancel! sets cancelled_at timestamp spec/models/order_spec.rb :48 0.0s failed
Order#deliver! delivers shipped orders spec/models/order_spec.rb :40 0.0s pass
Product validations requires unique minsan_code spec/models/product_spec.rb :19 0.0s pass
PricingEngine#calculate does not apply volume discount for low stock spec/services/pricing_engine_spec.rb :5 0.0s failed
ShippingCalculator#calculate returns standard shipping cost spec/services/shipping_calculator_spec.rb :7 0.0s pass
Event Profiling (factory.create)
61 events · 00:00.178 of 00:00.252 (70.76%)
Suite Event Time Events Examples % of Run
70.76%) Total events 00:00.059 3 2 88.49%
spec/jobs/inventory_sync_job_spec.rb 00:00.033 12 2 84.07%
spec/services/shipping_calculator_spec.rb 00:00.029 12 5 82.65%
spec/services/cart_optimizer_spec.rb 00:00.016 11 3 68.59%
spec/models/order_spec.rb 00:00.016 8 8 47.36%
Factory Usage Ranking
click a factory to view details 73 total creates · 00:00.179
Factory Creates Top-Level Cascade Ratio Time
:product 38 27 1.4x 0.1s
:order 17 16 1.1x 0.0s
:order_item 11 11 1.0x 0.1s
:pharmacy 7 7 1.0x 0.0s
🔥
High-Risk Files
high churn + low coverage
files changed >5 times in 90 days with <70% coverage. these are where bugs are most likely to ship.
File Coverage Churn Risk Score
app/services/payment_service.rb 68.0% 6 commits 192
⏱️
Over-Tested Files
high coverage + very slow
No over-tested files detected.
🎭
False Security
>70% time in hooks
No false security issues detected.
⚠️
Untested Hot Paths
active development + low coverage
No untested hot paths detected.