Skip to content

Support LaunchService injection into pre-shutdown tests.#308

Merged
hidmic merged 2 commits intomasterfrom
hidmic/test-with-launch-service
Aug 20, 2019
Merged

Support LaunchService injection into pre-shutdown tests.#308
hidmic merged 2 commits intomasterfrom
hidmic/test-with-launch-service

Conversation

@hidmic
Copy link
Copy Markdown

@hidmic hidmic commented Aug 15, 2019

Precisely what the title says. Closes #295.

hidmic added 2 commits August 15, 2019 15:55
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Copy link
Copy Markdown
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

LGTM!

This allows launch_service injection in the tests, but #295 is about supporting repeated execution.
Is the idea just to loop using launch_process or to add some extra functionality to make repeated tests looks nicer?

@ivanpauno ivanpauno added the in review Waiting for review (Kanban column) label Aug 15, 2019
@hidmic
Copy link
Copy Markdown
Author

hidmic commented Aug 15, 2019

Is the idea just to loop using launch_process or to add some extra functionality to make repeated tests looks nicer?

I was thinking about simply looping, yes. We could also instrument a decorator for our tests that repeats it until it passes or timeout is reached, akin to pytest-repeat.

@hidmic
Copy link
Copy Markdown
Author

hidmic commented Aug 16, 2019

CI up to launch_testing and test_communication:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@hidmic
Copy link
Copy Markdown
Author

hidmic commented Aug 20, 2019

Alright, all green. Going in! @dirk-thomas feel free to comment async.

@hidmic hidmic merged commit c43fed9 into master Aug 20, 2019
@delete-merged-branch delete-merged-branch bot deleted the hidmic/test-with-launch-service branch August 20, 2019 15:55
self._test_run.bind(
self._test_run.pre_shutdown_tests,
injected_attributes={
'launch_service': self._launch_service,
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.

@hidmic Not directly related to this PR, but do you have any guidance for a process for deprecating 'injected_attributes' from launch_testing? Something like 'put a warning in the next release when someone uses an injected attribute' then in the release after that remove injected attributes?

I think injected_args are better and less confusing in just about every way. They still require the user to know ahead of time what 'magic words' can be added as arguments to a test function, but beyond that they're way less mysterious

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hmm, you could wrap them using a property that can generate a warning once if these are used.

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.

@hidmic Yeah - I know how to do the implementation side - my question is more about the administrative side. Do we need a full release of "WARNING THIS WILL BE DEPRECATED" or is it sufficient to add the warning, them actually deprecate once all of OSRF's stuff is updated?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Oops, forgot to reply. And sorry for the noise, I clearly half read what you wrote before.

I actually don't know what's the deprecation cycle for Python APIs here. What you describe makes sense to me. We'd be looking forward to issuing a DeprecationWarning in Eloquent and removing the feature entirely on F-Turtle. @dirk-thomas any thoughts?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If a deprecation cycle is technically feasible it is certainly preferred to give users time to migrate.

) -> Optional[LaunchDescription]:
typed_event = cast(ShutdownProcess, context.locals.event)
if not typed_event.process_matcher(self):
# this event whas not intended for this process
Copy link
Copy Markdown
Member

@dirk-thomas dirk-thomas Aug 23, 2019

Choose a reason for hiding this comment

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

Spelling.

Also that this is used twice but references different entities is a bit hard to read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in review Waiting for review (Kanban column)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[launch testing] Support repeated execution of executables under test

4 participants