Skip to content

Commit d5f2675

Browse files
committed
WIP
1 parent 85b71bf commit d5f2675

30 files changed

Lines changed: 54 additions & 69 deletions

src/software/ai/hl/stp/play/ball_placement/ball_placement_play_test.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -182,28 +182,22 @@ def run_ball_placement_scenario(
182182
]
183183

184184
simulated_test_runner.run_test(
185-
setup=lambda test_setup_arg: ball_placement_play_setup(
186-
test_setup_arg["ball_start_point"],
187-
test_setup_arg["ball_placement_point"],
185+
setup=lambda: ball_placement_play_setup(
186+
ball_start_point,
187+
ball_placement_point,
188188
simulated_test_runner,
189189
blue_only,
190190
),
191-
params=[
192-
{
193-
"ball_start_point": ball_start_point,
194-
"ball_placement_point": ball_placement_point,
195-
}
196-
],
197191
always_validation_sequence_set=[[]],
198192
eventually_validation_sequence_set=placement_eventually_validation_sequence_set,
199-
test_timeout_s=[30],
193+
test_timeout_s=30,
200194
)
201195

202196
simulated_test_runner.run_test(
203197
# setup argument isn't passed to preserve world state from previous test run
204198
always_validation_sequence_set=drop_ball_always_validation_sequence_set,
205199
eventually_validation_sequence_set=drop_ball_eventually_validation_sequence_set,
206-
test_timeout_s=[10],
200+
test_timeout_s=10,
207201
)
208202

209203

src/software/ai/hl/stp/play/crease_defense/crease_defense_play_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_crease_defense_play(simulated_test_runner):
1717
field = tbots_cpp.Field.createSSLDivisionBField()
1818
goalie_position = tbots_cpp.Point(-4.5, 0)
1919

20-
def setup(*args):
20+
def setup():
2121
simulated_test_runner.set_world_state(
2222
create_world_state(
2323
blue_robot_locations=[

src/software/ai/hl/stp/play/defense/defense_play_test.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
],
3535
)
3636
def test_defense_play_ball_steal(simulated_test_runner, blue_bots, yellow_bots):
37-
def setup(*args):
37+
def setup():
3838
ball_initial_pos = tbots_cpp.Point(0.93, 0)
3939

4040
simulated_test_runner.set_world_state(
@@ -59,7 +59,6 @@ def setup(*args):
5959

6060
simulated_test_runner.run_test(
6161
setup=setup,
62-
params=[0, 1, 2, 3, 4], # The aggregate test runs 5 times
6362
always_validation_sequence_set=[
6463
[
6564
BallNeverEntersRegion(
@@ -97,7 +96,7 @@ def setup(*args):
9796
],
9897
)
9998
def test_defense_play(simulated_test_runner, blue_bots, yellow_bots):
100-
def setup(*args):
99+
def setup():
101100
ball_initial_pos = tbots_cpp.Point(0.9, 2.85)
102101

103102
simulated_test_runner.set_world_state(
@@ -122,7 +121,6 @@ def setup(*args):
122121

123122
simulated_test_runner.run_test(
124123
setup=setup,
125-
params=[0, 1, 2, 3, 4], # The aggregate test runs 5 times
126124
always_validation_sequence_set=[
127125
[
128126
BallNeverEntersRegion(

src/software/ai/hl/stp/play/enemy_ball_placement/enemy_ball_placement_play_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
def test_two_ai_ball_placement(
2121
simulated_test_runner, ball_start_point, ball_placement_point
2222
):
23-
def setup(*args):
23+
def setup():
2424
blue_bots = [
2525
tbots_cpp.Point(-4.5, 0),
2626
tbots_cpp.Point(-4, 0.5),
@@ -72,7 +72,6 @@ def setup(*args):
7272

7373
simulated_test_runner.run_test(
7474
setup=setup,
75-
params=[0],
7675
always_validation_sequence_set=always_validation_sequence_set,
7776
eventually_validation_sequence_set=[[]],
7877
test_timeout_s=15,

src/software/ai/hl/stp/play/enemy_free_kick/enemy_free_kick_play_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
def test_enemy_free_kick_play(
9898
simulated_test_runner, blue_bots, yellow_bots, ball_initial_pos
9999
):
100-
def setup(*args):
100+
def setup():
101101
simulated_test_runner.set_world_state(
102102
create_world_state(
103103
yellow_robot_locations=yellow_bots,
@@ -141,7 +141,6 @@ def setup(*args):
141141

142142
simulated_test_runner.run_test(
143143
setup=setup,
144-
params=[0, 1, 2],
145144
eventually_validation_sequence_set=eventually_validation_sequence_set,
146145
always_validation_sequence_set=always_validation_sequence_set,
147146
test_timeout_s=8,

src/software/ai/hl/stp/play/example/example_play_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
def test_example_play(simulated_test_runner):
1414
ball_initial_pos = tbots_cpp.Point(0, 0)
1515

16-
def setup(*args):
16+
def setup():
1717
blue_bots = [
1818
tbots_cpp.Point(-3, 2.5),
1919
tbots_cpp.Point(-3, 1.5),

src/software/ai/hl/stp/play/free_kick/free_kick_play_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
],
3131
)
3232
def test_free_kick_play_friendly(ball_initial_pos, must_score, simulated_test_runner):
33-
def setup(*args):
33+
def setup():
3434
blue_bots = [
3535
tbots_cpp.Point(-4.5, 0),
3636
tbots_cpp.Point(-3, 1.5),

src/software/ai/hl/stp/play/halt_play/halt_play_test.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# TODO issue #2599 - Remove Duration parameter from test
99
# @pytest.mark.parametrize("run_enemy_ai,test_duration", [(False, 20), (True, 20)])
1010
def test_halt_play(simulated_test_runner):
11-
def setup(*args):
11+
def setup():
1212
ball_initial_pos = tbots_cpp.Point(0, 0)
1313

1414
blue_bots = [
@@ -49,15 +49,11 @@ def setup(*args):
4949
gc_command=Command.Type.FORCE_START, team=Team.UNKNOWN
5050
)
5151

52-
# params just have to be a list of length 1 to ensure the test runs at least once
5352
simulated_test_runner.run_test(
5453
setup=setup,
55-
params=[0],
5654
always_validation_sequence_set=[[]],
5755
eventually_validation_sequence_set=[
5856
[RobotSpeedEventuallyBelowThreshold(1e-3)]
59-
],
60-
[RobotSpeedEventuallyBelowThreshold(1e-3)]
6157
],
6258
ci_cmd_with_delay=[
6359
(3, Command.Type.HALT, Team.BLUE),

src/software/ai/hl/stp/play/kickoff_enemy/kickoff_enemy_play_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_kickoff_enemy_play(simulated_test_runner):
2020
ball_initial_pos = tbots_cpp.Point(0, 0)
2121
field = tbots_cpp.Field.createSSLDivisionBField()
2222

23-
def setup(*args):
23+
def setup():
2424
blue_bots = [
2525
tbots_cpp.Point(-3, 2.5),
2626
tbots_cpp.Point(-2.8, 2.5),

src/software/ai/hl/stp/play/kickoff_friendly/kickoff_friendly_play_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
def test_kickoff_friendly_play(simulated_test_runner):
2424
ball_initial_pos = tbots_cpp.Point(0, 0)
2525

26-
def setup(*args):
26+
def setup():
2727
field = tbots_cpp.Field.createSSLDivisionBField()
2828

2929
blue_bots = [

0 commit comments

Comments
 (0)