Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for MAVLink communication faking/mocking #148

Open
hamishwillee opened this issue Nov 2, 2017 · 3 comments
Open

Add support for MAVLink communication faking/mocking #148

hamishwillee opened this issue Nov 2, 2017 · 3 comments

Comments

@hamishwillee
Copy link
Collaborator

hamishwillee commented Nov 2, 2017

In order to allow sensible unit tests to be written.

@shakthi-prashanth-m
Copy link
Contributor

@hamishwillee @julianoes Can you please describe more about this task ?

@hamishwillee
Copy link
Collaborator Author

Unit tests are supposed to test just the functionality of a particular component. As each plugin is a MAVLink processor - sending and/or receiving MAVLink messages to unit test our code we would need to create some mock system that can sensibly act as a source/sink of MAVLink and respond to messages from our plugins as "required".

This would allow us to unit test our code in isolation from other plugins and with completely repeatable behaviour, on any platform.

For our integration tests we use SITL as a sync/source but that is no good for unit tests, because SITL requires all sort of setup, and does not respond repeatably on different systems, or even the same system on a different load.

I have no idea what "exactly" this would look like, but I'd start by considering the QGroundControl mocklink.

@julianoes
Copy link
Collaborator

Yes it could be something like a FakeConnection that whenever you send it a command it that is correct it would respond with ack. Additionally you could also check the failure cases such as timeouts, or responding with denied if a param doesn't make sense.

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

No branches or pull requests

3 participants