Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
cd src
bazel build --show_timestamps --copt=-O3 --verbose_failures \
-- //... -//software:unix_full_system \
-//software/simulated_tests/... \
-//software/ai/hl/... \
-//software/field_tests/... \
-//software/embedded/... \
Expand All @@ -52,7 +51,6 @@ jobs:
cd src
bazel test --copt=-O3 --show_timestamps --verbose_failures \
-- //... -//software:unix_full_system \
-//software/simulated_tests/... \
-//software/ai/hl/... \
-//software/field_tests/... \
-//software/ai/navigator/... \
Expand Down Expand Up @@ -87,7 +85,6 @@ jobs:
cd src
bazel test --copt=-O3 --flaky_test_attempts=3 --show_timestamps \
//software:unix_full_system \
//software/simulated_tests/... \
//software/ai/hl/... \
//software/ai/navigator/...

Expand Down
2 changes: 1 addition & 1 deletion scripts/compile_pip_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ BAZEL_ROOT_DIR="$CURR_DIR/../src"
cd $BAZEL_ROOT_DIR
bazel run //software/thunderscope:requirements.update
bazel run //software/embedded/ansible:requirements.update
bazel run //software/simulated_tests:requirements.update
bazel run //software/gameplay_tests:requirements.update
bazel run //software/embedded/robot_diagnostics_cli:requirements.update
bazel run //starlark/nanopb:requirements.update
6 changes: 3 additions & 3 deletions src/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ pip.parse(
)
use_repo(pip, "ansible_deps")
pip.parse(
hub_name = "simulated_tests_deps",
hub_name = "gameplay_tests_deps",
python_interpreter = "/opt/tbotspython/bin/python",
python_version = "3.12",
requirements_lock = "//software/simulated_tests:requirements_lock.txt",
requirements_lock = "//software/gameplay_tests:requirements_lock.txt",
)
use_repo(pip, "simulated_tests_deps")
use_repo(pip, "gameplay_tests_deps")
pip.parse(
hub_name = "robot_diagnostics_cli_deps",
python_interpreter = "/opt/tbotspython/bin/python",
Expand Down
3 changes: 1 addition & 2 deletions src/software/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ py_library(
name = "conftest",
srcs = ["conftest.py"],
deps = [
"//software/field_tests:field_test_fixture",
"//software/simulated_tests:simulated_test_fixture",
"//software/gameplay_tests:fixture",
],
)
8 changes: 4 additions & 4 deletions src/software/ai/hl/stp/play/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@simulated_tests_deps//:requirements.bzl", "requirement")
load("@gameplay_tests_deps//:requirements.bzl", "requirement")

package(default_visibility = ["//visibility:public"])

Expand Down Expand Up @@ -82,7 +82,7 @@ py_test(
],
deps = [
"//software:conftest",
"//software/simulated_tests/validation:validations",
"//software/gameplay_tests/validation:validations",
requirement("pytest"),
],
)
Expand All @@ -100,7 +100,7 @@ py_test(
],
deps = [
"//software:conftest",
"//software/simulated_tests/validation:validations",
"//software/gameplay_tests/validation:validations",
requirement("pytest"),
],
)
Expand Down Expand Up @@ -156,7 +156,7 @@ py_test(
"//proto:software_py_proto",
"//proto:tbots_py_proto",
"//software:conftest",
"//software/simulated_tests/validation:validations",
"//software/gameplay_tests/validation:validations",
requirement("pytest"),
],
)
4 changes: 2 additions & 2 deletions src/software/ai/hl/stp/play/ball_placement/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@simulated_tests_deps//:requirements.bzl", "requirement")
load("@gameplay_tests_deps//:requirements.bzl", "requirement")

package(default_visibility = ["//visibility:public"])

Expand Down Expand Up @@ -40,7 +40,7 @@ py_test(
tags = ["exclusive"],
deps = [
"//software:conftest",
"//software/simulated_tests/validation:validations",
"//software/gameplay_tests/validation:validations",
requirement("pytest"),
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
from proto.import_all_protos import *
from proto.ssl_gc_common_pb2 import Team
from proto.message_translation.tbots_protobuf import create_world_state
from software.simulated_tests.validation.ball_enters_region import (
from software.gameplay_tests.validation.ball_enters_region import (
BallAlwaysStaysInRegion,
BallEventuallyEntersRegion,
)
from software.simulated_tests.validation.robot_enters_region import (
from software.gameplay_tests.validation.robot_enters_region import (
RobotEventuallyExitsRegion,
)
from software.simulated_tests.simulated_test_fixture import (
from software.gameplay_tests.util import (
pytest_main,
)

Expand All @@ -33,10 +33,10 @@
],
)
def test_two_ai_ball_placement(
simulated_test_runner, ball_start_point, ball_placement_point
gameplay_test_runner, ball_start_point, ball_placement_point
):
run_ball_placement_scenario(
simulated_test_runner, ball_start_point, ball_placement_point
gameplay_test_runner, ball_start_point, ball_placement_point
)


Expand Down Expand Up @@ -64,21 +64,21 @@ def test_two_ai_ball_placement(
],
)
def test_robocup_technical_challenge_placement(
simulated_test_runner, ball_start_point, ball_placement_point
gameplay_test_runner, ball_start_point, ball_placement_point
):
run_ball_placement_scenario(
simulated_test_runner, ball_start_point, ball_placement_point, blue_only=True
gameplay_test_runner, ball_start_point, ball_placement_point, blue_only=True
)


def ball_placement_play_setup(
ball_start_point, ball_placement_point, simulated_test_runner, blue_only
ball_start_point, ball_placement_point, gameplay_test_runner, blue_only
):
"""Set up ball placement test by initializing bot positions, ball placement targets, and test settings

:param ball_start_point: Initial point of the ball
:param ball_placement_point: Target point of the ball
:param simulated_test_runner: Simulated test runner
:param gameplay_test_runner: Simulated test runner
:param blue_only: If True, only the blue team is active; the yellow team is ignored.
"""
# Setup blue robots
Expand Down Expand Up @@ -113,7 +113,7 @@ def ball_placement_play_setup(
]

# Create world state
simulated_test_runner.set_world_state(
gameplay_test_runner.set_world_state(
create_world_state(
yellow_robot_locations=yellow_bots,
blue_robot_locations=blue_bots,
Expand All @@ -123,28 +123,28 @@ def ball_placement_play_setup(
)

# Game Controller Setup
simulated_test_runner.send_gamecontroller_command(
gameplay_test_runner.send_gamecontroller_command(
gc_command=Command.Type.STOP, team=Team.UNKNOWN
)
# Pass in placement point here - not required for all play tests
simulated_test_runner.send_gamecontroller_command(
gameplay_test_runner.send_gamecontroller_command(
gc_command=Command.Type.BALL_PLACEMENT,
team=Team.BLUE,
final_ball_placement_point=ball_placement_point,
)

# Force play override here
simulated_test_runner.set_plays(
gameplay_test_runner.set_plays(
blue_play=PlayName.BallPlacementPlay, yellow_play=PlayName.HaltPlay
)


def run_ball_placement_scenario(
simulated_test_runner, ball_start_point, ball_placement_point, blue_only=False
gameplay_test_runner, ball_start_point, ball_placement_point, blue_only=False
):
"""Runs a ball placement test scenario with the specified parameters.

:param simulated_test_runner: The test runner used to simulate robot and ball behavior.
:param gameplay_test_runner: The test runner used to simulate robot and ball behavior.
:param ball_start_point: The initial position of the ball.
:param ball_placement_point: The target position where the ball should be placed.
:param blue_only: If True, only the blue team is active; the yellow team is ignored.
Expand Down Expand Up @@ -183,33 +183,22 @@ def run_ball_placement_scenario(
]
]

simulated_test_runner.run_test(
setup=lambda test_setup_arg: ball_placement_play_setup(
test_setup_arg["ball_start_point"],
test_setup_arg["ball_placement_point"],
simulated_test_runner,
gameplay_test_runner.run_test(
setup=lambda: ball_placement_play_setup(
ball_start_point,
ball_placement_point,
gameplay_test_runner,
blue_only,
),
params=[
{
"ball_start_point": ball_start_point,
"ball_placement_point": ball_placement_point,
}
],
inv_always_validation_sequence_set=[[]],
inv_eventually_validation_sequence_set=placement_eventually_validation_sequence_set,
ag_always_validation_sequence_set=[[]],
ag_eventually_validation_sequence_set=placement_eventually_validation_sequence_set,
test_timeout_s=[15],
eventually_validation_sequence_set=placement_eventually_validation_sequence_set,
test_timeout_s=15,
)

simulated_test_runner.run_test(
gameplay_test_runner.run_test(
# setup argument isn't passed to preserve world state from previous test run
inv_always_validation_sequence_set=drop_ball_always_validation_sequence_set,
inv_eventually_validation_sequence_set=drop_ball_eventually_validation_sequence_set,
ag_always_validation_sequence_set=drop_ball_always_validation_sequence_set,
ag_eventually_validation_sequence_set=drop_ball_eventually_validation_sequence_set,
test_timeout_s=[5],
always_validation_sequence_set=drop_ball_always_validation_sequence_set,
eventually_validation_sequence_set=drop_ball_eventually_validation_sequence_set,
test_timeout_s=5,
)


Expand Down
4 changes: 2 additions & 2 deletions src/software/ai/hl/stp/play/crease_defense/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@simulated_tests_deps//:requirements.bzl", "requirement")
load("@gameplay_tests_deps//:requirements.bzl", "requirement")

package(default_visibility = ["//visibility:public"])

Expand Down Expand Up @@ -39,7 +39,7 @@ py_test(
],
deps = [
"//software:conftest",
"//software/simulated_tests/validation:validations",
"//software/gameplay_tests/validation:validations",
requirement("pytest"),
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
from proto.import_all_protos import *
from proto.message_translation.tbots_protobuf import create_world_state
from proto.ssl_gc_common_pb2 import Team
from software.simulated_tests.simulated_test_fixture import (
from software.gameplay_tests.util import (
pytest_main,
)
from software.simulated_tests.validation.robot_speed_threshold import (
from software.gameplay_tests.validation.robot_speed_threshold import (
RobotSpeedEventuallyBelowThreshold,
)
from software.simulated_tests.validation.robot_enters_region import (
from software.gameplay_tests.validation.robot_enters_region import (
NumberOfRobotsEventuallyEntersRegion,
)
from software.simulated_tests.validation.delay_validation import DelayValidation
from software.gameplay_tests.validation.delay_validation import DelayValidation


def test_crease_defense_play(simulated_test_runner):
def test_crease_defense_play(gameplay_test_runner):
field = tbots_cpp.Field.createSSLDivisionBField()
goalie_position = tbots_cpp.Point(-4.5, 0)

def setup(*args):
simulated_test_runner.set_world_state(
def setup():
gameplay_test_runner.set_world_state(
create_world_state(
blue_robot_locations=[
goalie_position,
Expand All @@ -43,11 +43,11 @@ def setup(*args):
),
)

simulated_test_runner.set_plays(
gameplay_test_runner.set_plays(
blue_play=PlayName.CreaseDefensePlay, yellow_play=PlayName.HaltPlay
)

simulated_test_runner.send_gamecontroller_command(
gameplay_test_runner.send_gamecontroller_command(
gc_command=Command.Type.STOP, team=Team.UNKNOWN
)

Expand All @@ -70,10 +70,9 @@ def setup(*args):
]
]

simulated_test_runner.run_test(
gameplay_test_runner.run_test(
setup=setup,
inv_eventually_validation_sequence_set=eventually_validations,
ag_eventually_validation_sequence_set=eventually_validations,
eventually_validation_sequence_set=eventually_validations,
test_timeout_s=10,
)

Expand Down
4 changes: 2 additions & 2 deletions src/software/ai/hl/stp/play/defense/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@simulated_tests_deps//:requirements.bzl", "requirement")
load("@gameplay_tests_deps//:requirements.bzl", "requirement")

package(default_visibility = ["//visibility:public"])

Expand Down Expand Up @@ -42,7 +42,7 @@ py_test(
],
deps = [
"//software:conftest",
"//software/simulated_tests/validation:validations",
"//software/gameplay_tests/validation:validations",
requirement("pytest"),
],
)
Expand Down
Loading
Loading