Skip to content
Open
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
4 changes: 0 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,6 @@ pip.parse(
use_repo(pip, "score_lifecycle_pip")

bazel_dep(name = "score_itf", version = "0.5.0", dev_dependency = True)
single_version_override(
module_name = "score_itf",
patches = ["//patches:itf.patch"],
)

oci = use_extension("@rules_oci//oci:extensions.bzl", "oci", dev_dependency = True)
oci.pull(
Expand Down
15 changes: 0 additions & 15 deletions patches/itf.patch

This file was deleted.

13 changes: 4 additions & 9 deletions tests/integration/complex_monitoring/complex_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
from tests.utils.testing_utils.run_until_file_deployed import run_until_file_deployed
from tests.utils.testing_utils.setup_test import setup_test
from tests.utils.testing_utils.test_results import assert_test_results
from attribute_plugin import add_test_properties
Expand All @@ -32,16 +31,12 @@ def test_complex_monitoring(target, setup_test, assert_test_results, remote_test
Expected Behaviour: Health monitor detects the missed heartbeats and triggers a recovery action, activating the fallback run target.
"""

config_path = str(remote_test_dir / "etc/complex_monitoring.bin")

run_until_file_deployed(
target=target,
binary_path=str(remote_test_dir / "launch_manager"),
file_path=remote_test_dir.parent / "test_end",
process = target.execute_async(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be non async now?

str(remote_test_dir / "launch_manager"),
args=["-c", str(remote_test_dir / "etc/complex_monitoring.bin")],
cwd=str(remote_test_dir),
args=["-c", config_path],
timeout_s=4.0,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to still keep a wrapper method?
This would break #525 since there is no central way to inject the program. Also might be good to keep a timeout

)
assert process.wait() == 0

assert_test_results(
{"component_complex_monitoring.xml", "control_client_test_driver.xml"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ TEST(ComplexMonitoring, ControlClientTestDriver)
{
score::mw::lifecycle::ControlClient client;

ASSERT_TRUE(check_clean({test_end_location, fallback_file}));
ASSERT_TRUE(check_clean({fallback_file}));

TEST_STEP("Report running")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
from tests.utils.testing_utils.run_until_file_deployed import run_until_file_deployed
from tests.utils.testing_utils.setup_test import setup_test
from tests.utils.testing_utils.test_results import assert_test_results
from attribute_plugin import add_test_properties
Expand All @@ -31,15 +30,11 @@ def test_crash_ignores_dependents(
Expected Behaviour: The process that depends on it is not interrupted or restarted.
"""

new_config_path = str(remote_test_dir / "etc/crash_ignores_dependents.bin")

run_until_file_deployed(
target=target,
binary_path=str(remote_test_dir / "launch_manager"),
file_path=remote_test_dir.parent / "test_end",
process = target.execute_async(
str(remote_test_dir / "launch_manager"),
args=["-c", str(remote_test_dir / "etc/crash_ignores_dependents.bin")],
cwd=str(remote_test_dir),
args=["-c", new_config_path],
timeout_s=6.0,
)
assert process.wait() == 0

assert_test_results({"test_process.xml", "process_crashing_once.xml"})
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ TEST(CrashIgnoresDependents, TestProcess)

TEST_STEP("Check this is the first start")
{
ASSERT_TRUE(check_clean({test_end_location, started_file, crash_file}))
<< "Process was started more than once!";
ASSERT_TRUE(check_clean({started_file, crash_file})) << "Process was started more than once!";

ASSERT_TRUE(touch_file(started_file)) << "Failed to deploy file!";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ TEST(CrashOnStartup, ControlClientTestDriver)
{
score::mw::lifecycle::ControlClient client;

ASSERT_TRUE(
check_clean({crashCountPath(1), crashCountPath(2), crashCountPath(3), test_end_location, fallback_file}));
ASSERT_TRUE(check_clean({crashCountPath(1), crashCountPath(2), crashCountPath(3), fallback_file}));

TEST_STEP("Report running")
{
Expand Down
13 changes: 4 additions & 9 deletions tests/integration/crash_on_startup/crash_on_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
from tests.utils.testing_utils.run_until_file_deployed import run_until_file_deployed
from tests.utils.testing_utils.setup_test import setup_test
from tests.utils.testing_utils.test_results import (
assert_test_results,
Expand Down Expand Up @@ -44,16 +43,12 @@ def test_crash_on_startup(
Expected Behaviour: Process startup fails and therefore run target activation fails. Launch manager executes recovery action which switches to fallback run target.
"""

config_path = str(remote_test_dir / "etc/crash_on_startup.bin")

run_until_file_deployed(
target=target,
binary_path=str(remote_test_dir / "launch_manager"),
file_path=remote_test_dir.parent / "test_end",
process = target.execute_async(
str(remote_test_dir / "launch_manager"),
args=["-c", str(remote_test_dir / "etc/crash_on_startup.bin")],
cwd=str(remote_test_dir),
args=["-c", config_path],
timeout_s=10.0,
)
assert process.wait() == 0

# Each crashing process writes its own report file named after the number of times it crashes, so the
# reports of the different run targets no longer overwrite each other. The process crashing once is not
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ TEST(FallbackToSameTargetRestarts, ControlClientTestDriver)

const std::string_view process_file = "process_started_normally";

ASSERT_TRUE(check_clean({test_end_location, process_file}));
ASSERT_TRUE(check_clean({process_file}));
// Establish communication with launch manager
TEST_STEP("Report running")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
from tests.utils.testing_utils.run_until_file_deployed import run_until_file_deployed
from tests.utils.testing_utils.setup_test import setup_test
from tests.utils.testing_utils.test_results import assert_test_results
from attribute_plugin import add_test_properties
Expand All @@ -31,15 +30,11 @@ def test_fallback_to_same_target_restarts(
Expected Behaviour: The process is relaunched and completes normally.
"""

new_config_path = str(remote_test_dir / "etc/fallback_to_same_target_restarts.bin")

run_until_file_deployed(
target=target,
binary_path=str(remote_test_dir / "launch_manager"),
file_path=remote_test_dir.parent / "test_end",
process = target.execute_async(
str(remote_test_dir / "launch_manager"),
args=["-c", str(remote_test_dir / "etc/fallback_to_same_target_restarts.bin")],
cwd=str(remote_test_dir),
args=["-c", new_config_path],
timeout_s=4.0,
)
assert process.wait() == 0

assert_test_results({"control_client_test_driver.xml", "process_crashing_once.xml"})
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
import logging
from tests.utils.testing_utils.run_until_file_deployed import run_until_file_deployed
from tests.utils.testing_utils.setup_test import setup_test
from tests.utils.testing_utils.test_results import assert_test_results
from attribute_plugin import add_test_properties
Expand All @@ -31,15 +29,11 @@ def test_incorrect_config_non_reporting(
Expected Outcome: Process does not crash.
"""

config_path = str(remote_test_dir / "etc/non_reporting_config.bin")

run_until_file_deployed(
target=target,
binary_path=str(remote_test_dir / "launch_manager"),
file_path=remote_test_dir.parent / "test_end",
process = target.execute_async(
str(remote_test_dir / "launch_manager"),
args=["-c", str(remote_test_dir / "etc/non_reporting_config.bin")],
cwd=str(remote_test_dir),
args=["-c", config_path],
timeout_s=2.0,
)
assert process.wait() == 0

assert_test_results({"non_reporting_process.xml"})
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
TEST(LmShutdownDuringRtSwitch, ControlClient)
{
score::mw::lifecycle::ControlClient client{};
ASSERT_TRUE(check_clean({test_end_location, a_started, a_terminating, c_started}));
ASSERT_TRUE(check_clean({a_started, a_terminating, c_started}));

TEST_STEP("Report running")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
from tests.utils.testing_utils.run_until_file_deployed import run_until_file_deployed
from tests.utils.testing_utils.setup_test import setup_test
from tests.utils.testing_utils.test_results import assert_test_results
from attribute_plugin import add_test_properties
Expand Down Expand Up @@ -42,19 +41,12 @@ def test_lm_shutdown(target, setup_test, assert_test_results, remote_test_dir):
processes it owns, and exits cleanly.
"""

new_config_path = str(remote_test_dir / "etc/lm_shutdown_during_rt_switch.bin")
a_terminating = remote_test_dir / "component_a_terminating"

# Run until `component_a_terminating` is deployed so we can request shutdown during
# the transition to run target c
run_until_file_deployed(
target=target,
binary_path=str(remote_test_dir / "launch_manager"),
file_path=a_terminating,
process = target.execute_async(
str(remote_test_dir / "launch_manager"),
args=["-c", str(remote_test_dir / "etc/lm_shutdown_during_rt_switch.bin")],
cwd=str(remote_test_dir),
args=["-c", new_config_path],
timeout_s=10.0,
)
assert process.wait() == 0

# component_c never runs (the pending switch was cancelled), so it produces no XML
# result; component_a and the control client shut down gracefully. The control
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
TEST(LmShutdownDuringSwitchToOff, ControlClient)
{
score::mw::lifecycle::ControlClient client{};
ASSERT_TRUE(check_clean({test_end_location, a_started, a_terminating}));
ASSERT_TRUE(check_clean({a_started, a_terminating}));

const auto pid = getpid();
const std::string step_msg = "Report running with pid == " + std::to_string(pid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
from tests.utils.testing_utils.run_until_file_deployed import run_until_file_deployed
from tests.utils.testing_utils.setup_test import setup_test
from tests.utils.testing_utils.test_results import assert_test_results
from attribute_plugin import add_test_properties
Expand Down Expand Up @@ -43,19 +42,12 @@ def test_lm_shutdown(target, setup_test, assert_test_results, remote_test_dir):
force-terminated.
"""

new_config_path = str(remote_test_dir / "etc/lm_shutdown_during_switch_to_off.bin")
a_terminating = remote_test_dir / "component_a_terminating"

# Run until `component_a_terminating` is deployed so we can send SIGTERM
# to launch manager during the transition to Off
run_until_file_deployed(
target=target,
binary_path=str(remote_test_dir / "launch_manager"),
file_path=a_terminating,
process = target.execute_async(
str(remote_test_dir / "launch_manager"),
args=["-c", str(remote_test_dir / "etc/lm_shutdown_during_switch_to_off.bin")],
cwd=str(remote_test_dir),
args=["-c", new_config_path],
timeout_s=10.0,
)
assert process.wait() == 0

# Both processes are stopped gracefully as part of the switch to Off and produce
# their XML results: the control client is terminated when the switch to Off
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ TEST(ParallelLaunch, ControlClientTestDriver)
{
score::mw::lifecycle::ControlClient client;

ASSERT_TRUE(check_clean({test_end_location}));

for (const auto id : kComponentIds)
{
ASSERT_TRUE(check_clean({"start_" + std::string{id}, "running_" + std::string{id}}));
Expand Down
13 changes: 4 additions & 9 deletions tests/integration/parallel_launch/parallel_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
from tests.utils.testing_utils.run_until_file_deployed import run_until_file_deployed
from tests.utils.testing_utils.setup_test import setup_test
from tests.utils.testing_utils.test_results import assert_test_results
from attribute_plugin import add_test_properties
Expand All @@ -33,16 +32,12 @@ def test_parallel_launch(target, setup_test, assert_test_results, remote_test_di
Expected Behaviour: The latest start timestamp precedes the earliest running timestamp.
"""

config_path = str(remote_test_dir / "etc/parallel_launch.bin")

run_until_file_deployed(
target=target,
binary_path=str(remote_test_dir / "launch_manager"),
file_path=remote_test_dir.parent / "test_end",
process = target.execute_async(
str(remote_test_dir / "launch_manager"),
args=["-c", str(remote_test_dir / "etc/parallel_launch.bin")],
cwd=str(remote_test_dir),
args=["-c", config_path],
timeout_s=8.0,
)
assert process.wait() == 0

assert_test_results(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ TEST(RecoveryActionComplexRepFailure, ControlClientTestDriver)
{
score::mw::lifecycle::ControlClient client;

ASSERT_TRUE(check_clean({test_end_location, fallback_file}));
ASSERT_TRUE(check_clean({fallback_file}));

// Establish communication with launch manager
TEST_STEP("Report running from ControlClientTestDriver")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
from tests.utils.testing_utils.run_until_file_deployed import run_until_file_deployed
from tests.utils.testing_utils.setup_test import setup_test
from tests.utils.testing_utils.test_results import assert_test_results
from attribute_plugin import add_test_properties
Expand Down Expand Up @@ -41,16 +40,12 @@ def test_recovery_action_complex_rep_failure(
The recovery action switches to the fallback run target, the activation of the fallback run target is verified in the test.
"""

config_path = str(remote_test_dir / "etc/process_complex_rep_failure.bin")

run_until_file_deployed(
target=target,
binary_path=str(remote_test_dir / "launch_manager"),
file_path=remote_test_dir.parent / "test_end",
process = target.execute_async(
str(remote_test_dir / "launch_manager"),
args=["-c", str(remote_test_dir / "etc/process_complex_rep_failure.bin")],
cwd=str(remote_test_dir),
args=["-c", config_path],
timeout_s=10.0,
)
assert process.wait() == 0

assert_test_results(
{"control_client_test_driver.xml", "complex_reporting_process.xml"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ TEST(ProcessCrashMonitoring, ControlClientTestDriver)
{
score::mw::lifecycle::ControlClient client;

ASSERT_TRUE(check_clean({test_end_location, fallback_file}));
ASSERT_TRUE(check_clean({fallback_file}));
// Establish communication with launch manager
TEST_STEP("Report running")
{
Expand Down
Loading
Loading