Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Add unit tests for DataValidator#588

Merged
dagar merged 6 commits intoPX4:masterfrom
tstellanova:add_unit_tests
Mar 9, 2019
Merged

Add unit tests for DataValidator#588
dagar merged 6 commits intoPX4:masterfrom
tstellanova:add_unit_tests

Conversation

@tstellanova
Copy link
Copy Markdown
Contributor

Added a few unit tests for the DataValidator class that cover happy path and common failure paths. In some cases the existing interface lacks documentation of expected behavior (for example DataValidator::confidence has some undocumented side-effects, setting _error_mask, and put performs a variety of calculations), so these tests codify some of the "as-built" behavior of the class. I did not yet attempt to test the vibration-calculating code, which is unspecified but appears to be key to the operation of DataValidatorGroup.

@TSC21 TSC21 requested review from dagar and priseborough March 9, 2019 15:22
- Use percent error for comparing RMS error values
@dagar
Copy link
Copy Markdown
Member

dagar commented Mar 9, 2019

Looks like a good start.

Not that we've defined this anywhere, but would you mind running it through PX4's astyle?
From Firmware ./Tools/astyle/fix_code_style.sh validation/tests/*.cpp.

@priseborough
Copy link
Copy Markdown
Collaborator

These changes appear to be causing a problem with PX4/Firmware CI testing.

http://ci.px4.io:8080/blue/organizations/jenkins/PX4_misc%2FFirmware-compile_mac/detail/PR-11630/2/pipeline

@tstellanova
Copy link
Copy Markdown
Contributor Author

It looks like they are passing in this CI:
https://codecov.io/gh/PX4/ecl/src/master/validation/tests/test_data_validator.cpp
I'm not familiar with the other CI. @dagar Any recommendations on how to ensure this test binary builds in that CI ?

@tstellanova
Copy link
Copy Markdown
Contributor Author

My initial thought is that it appears the ci.px4.io CI build is treating the ecl_test_data_validator binary as one of the sitl unit tests, similar to eg autodeclination. Not sure why it's deciding to do that.

@dagar
Copy link
Copy Markdown
Member

dagar commented Mar 13, 2019

I'll limit the ecl tests to the standalone build. #591

dagar pushed a commit to priseborough/PX4-Autopilot that referenced this pull request Mar 13, 2019
Bug Fixes:

PX4/PX4-ECL#586 - EKF: fix covariance and output filter buffer initialization
PX4/PX4-ECL#590 - EKF: Fix innovation in fuseDeclination()

Enhancements:

PX4/PX4-ECL#543 - ekf_helper: add more useful methods to interface with the covariances
PX4/PX4-ECL#588 - Add unit tests for DataValidator

Note:

PX4/PX4-ECL#543  has required a change to how the state variances are accessed .
priseborough added a commit to PX4/PX4-Autopilot that referenced this pull request Mar 14, 2019
Bug Fixes:

PX4/PX4-ECL#586 - EKF: fix covariance and output filter buffer initialization
PX4/PX4-ECL#590 - EKF: Fix innovation in fuseDeclination()

Enhancements:

PX4/PX4-ECL#543 - ekf_helper: add more useful methods to interface with the covariances
PX4/PX4-ECL#588 - Add unit tests for DataValidator

Note:

PX4/PX4-ECL#543  has required a change to how the state variances are accessed .
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants