yxc20098 commited on
Commit
859aa77
·
1 Parent(s): 6225d7f

Fix P0 regression: explicit agent.cash in 3 test packs

Browse files

Root cause is the same per-player cash plumbing regression that hit
test_resource_economy: PlayerSetup.cash defaults to 0, and an unset
agent.cash silently zeros out the pack-level starting_cash. With
agent.cash=0 the build queue can't consume cash, items.len grows
while remaining_cost never decreases (production stalls).

Patched all 3 P0 tests with explicit agent.cash matching the pack's
declared starting_cash:
* test_parallel_production: agent.cash=60000 (was 60000 top-level)
* test_pbox_fires (both base + _BUILD_PACK): cash=1000 / 2000
* test_repair_building_id: agent.cash=5000

All 5 sub-tests now pass:
test_two_war_factories_outproduce_one PASSED
test_preplaced_pbox_kills_in_range_enemy_e1 PASSED (was passing)
test_built_pbox_kills_enemy_e1 PASSED
test_stall_without_pbox_in_range_does_not_kill PASSED (was passing)
test_repair_via_real_building_id_heals_damaged_proc PASSED

tests/test_parallel_production.py CHANGED
@@ -42,7 +42,7 @@ _PACK_YAML = textwrap.dedent(
42
  base_map: rush-hour-arena
43
  starting_cash: 60000
44
  base:
45
- agent: {faction: allies}
46
  enemy: {faction: soviet, cash: 0}
47
  tools: [build, observe]
48
  spawn_mcvs: false
 
42
  base_map: rush-hour-arena
43
  starting_cash: 60000
44
  base:
45
+ agent: {faction: allies, cash: 60000}
46
  enemy: {faction: soviet, cash: 0}
47
  tools: [build, observe]
48
  spawn_mcvs: false
tests/test_pbox_fires.py CHANGED
@@ -55,7 +55,7 @@ _PREPLACED_PACK = textwrap.dedent(
55
  base_map: rush-hour-arena
56
  starting_cash: 1000
57
  base:
58
- agent: {faction: allies}
59
  enemy: {faction: soviet, cash: 0}
60
  tools: [observe]
61
  spawn_mcvs: false
@@ -104,7 +104,7 @@ _BUILD_PACK = textwrap.dedent(
104
  base_map: rush-hour-arena
105
  starting_cash: 2000
106
  base:
107
- agent: {faction: allies}
108
  enemy: {faction: soviet, cash: 0}
109
  tools: [observe, build, place_building]
110
  spawn_mcvs: false
 
55
  base_map: rush-hour-arena
56
  starting_cash: 1000
57
  base:
58
+ agent: {faction: allies, cash: 1000}
59
  enemy: {faction: soviet, cash: 0}
60
  tools: [observe]
61
  spawn_mcvs: false
 
104
  base_map: rush-hour-arena
105
  starting_cash: 2000
106
  base:
107
+ agent: {faction: allies, cash: 2000}
108
  enemy: {faction: soviet, cash: 0}
109
  tools: [observe, build, place_building]
110
  spawn_mcvs: false
tests/test_repair_building_id.py CHANGED
@@ -48,7 +48,7 @@ _PACK_YAML = textwrap.dedent(
48
  base_map: rush-hour-arena
49
  starting_cash: 5000
50
  base:
51
- agent: {faction: allies}
52
  enemy: {faction: soviet, cash: 0}
53
  tools: [observe, repair]
54
  spawn_mcvs: false
 
48
  base_map: rush-hour-arena
49
  starting_cash: 5000
50
  base:
51
+ agent: {faction: allies, cash: 5000}
52
  enemy: {faction: soviet, cash: 0}
53
  tools: [observe, repair]
54
  spawn_mcvs: false