Skip to content

mw/com: Add methods integration tests#485

Draft
bemerybmw wants to merge 18 commits into
mainfrom
brem_methods_sctfs
Draft

mw/com: Add methods integration tests#485
bemerybmw wants to merge 18 commits into
mainfrom
brem_methods_sctfs

Conversation

@bemerybmw
Copy link
Copy Markdown
Contributor

Depends-on: #479

bemerybmw added 18 commits May 27, 2026 18:14
We prefer to have copies of the configuration checked in for each test
rather than using a tool to generate them. This makes it easier to
validate that the configuration files are as expected, makes it easier
for a user to use the config file as an example for how to create one
themselves and also prevents the test being altered without realising if
the generation tool is ever updated.
Sometimes we want to perform some clean up before aborting via FailTest.
Since destructors won't be called when calling std::_Exit, we allow
registering a callable which will be called before exiting.

This callable can be registered by creating an ExitFunctionGuard which
will call the registered callable on destruction of the guard or when
exiting via FailTest.
MakeError takes a string_view which was previously binding to a local
string. When the error was logged, the string was already destroyed. We
no longer pass a dynamic string to MakeError to avoid lifetime issues.
This function can be used if we need to store a ProcessSynchronizer in a
data structure which requires it to be moveable (such as a std::vector)
FailTestIf resulted in a runtime failure if calling it with a
score::result::error when the condition is true since the result does
not contain an error in that case but the function argument is still
evaluated even though the condition is true. Passing an error is a
common use case so we simply remove this and use FailTest with an if
statement.
This directory contains a datatype interface containing all 4
combinations of InArgs and Return values. It also provides helper
classes which encapsulate some of the boilerplate code when using this
datatype such as registering method handlers, calling methods etc.
Report failures using FailTest instead of propagating the errors up
through function return types which makes signatures and calling more
complex and can result in tests not failing when they should if the
error code is not handled correctly by the parent layer.
- Don't use MethodConsumer. Since this is a basic test which we want to
  serve also as an example for users, we don't want to extract methods
  related functionality out of the class. Additionally, to simplify the
  code and to make it clearer when MethodConsumer can be used, it's no
  longer templated with the Proxy type so cannot be used with the type
  defined within this test.
- Fail the test using FailTest instead of propagating the errors up
  through function return types which makes signatures and calling more
  complex and can result in tests not failing when they should if the
  error code is not handled correctly by the parent layer.
Fail the test using FailTest instead of propagating the errors up
through function return types which makes signatures and calling more
complex and can result in tests not failing when they should if the
error code is not handled correctly by the parent layer.
The signature_variations is the exact same as the mixed_criticality
tests, except the latter runs the test for all combinations of asil
levels of consumers and providers. Therefore, we remove
signature_variations.
args = [
"--consumer_id", i, "--num-proxies-per-consumer", num_proxies,
"--service-instance-manifest", f"./etc/{config_name}"]
return target.wrap_exec("bin/main_consumer", args, cwd="/opt/MainConsumerApp", wait_on_exit=True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant