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

autotest: avoid use of non-ascii characters in test output #29511

Merged
merged 2 commits into from
Mar 19, 2025

Conversation

peterbarker
Copy link
Contributor

AT-0741.0: Exception caught: RLL_RATE_D expected 0.070284 ± 2.000000% (0.068878 to 0.071690) got 0.09136922657489777 with 29.999993% error
Traceback (most recent call last):
  File "/__w/ardupilot/ardupilot/Tools/autotest/vehicle_test_suite.py", line 8915, in run_one_test_attempt
    test_function(**test_kwargs)
  File "/__w/ardupilot/ardupilot/Tools/autotest/arduplane.py", line 4373, in AUTOTUNE
    self.check_parameter_value("RLL_RATE_D", 0.070284024, 2)
  File "/__w/ardupilot/ardupilot/Tools/autotest/vehicle_test_suite.py", line 6302, in check_parameter_value
    raise ValueError("%s expected %f ± %f%% (%f to %f) got %s with %f%% error" % (
ValueError: RLL_RATE_D expected 0.070284 ± 2.000000% (0.068878 to 0.071690) got 0.09136922657489777 with 29.999993% error

>>>> FAILED STEP: test.PlaneTests1b at Wed Mar 12 10:07:55 2025 ('ascii' codec can't encode character '\xb1' in position 58: ordinal not in range(128))
Traceback (most recent call last):
  File "/__w/ardupilot/ardupilot/Tools/autotest/vehicle_test_suite.py", line 8915, in run_one_test_attempt
    test_function(**test_kwargs)
  File "/__w/ardupilot/ardupilot/Tools/autotest/arduplane.py", line 4373, in AUTOTUNE
    self.check_parameter_value("RLL_RATE_D", 0.070284024, 2)
  File "/__w/ardupilot/ardupilot/Tools/autotest/vehicle_test_suite.py", line 6302, in check_parameter_value
    raise ValueError("%s expected %f ± %f%% (%f to %f) got %s with %f%% error" % (
ValueError: RLL_RATE_D expected 0.070284 ± 2.000000% (0.068878 to 0.071690) got 0.09136922657489777 with 29.999993% error

the existing assert_parameter_value takes an acceptable delta, this method takes a percentage.  Should be able to reu-use code, and even if not, having them named similarly makes sense
AT-0741.0: Exception caught: RLL_RATE_D expected 0.070284 ± 2.000000% (0.068878 to 0.071690) got 0.09136922657489777 with 29.999993% error
Traceback (most recent call last):
  File "/__w/ardupilot/ardupilot/Tools/autotest/vehicle_test_suite.py", line 8915, in run_one_test_attempt
    test_function(**test_kwargs)
  File "/__w/ardupilot/ardupilot/Tools/autotest/arduplane.py", line 4373, in AUTOTUNE
    self.check_parameter_value("RLL_RATE_D", 0.070284024, 2)
  File "/__w/ardupilot/ardupilot/Tools/autotest/vehicle_test_suite.py", line 6302, in check_parameter_value
    raise ValueError("%s expected %f ± %f%% (%f to %f) got %s with %f%% error" % (
ValueError: RLL_RATE_D expected 0.070284 ± 2.000000% (0.068878 to 0.071690) got 0.09136922657489777 with 29.999993% error

>>>> FAILED STEP: test.PlaneTests1b at Wed Mar 12 10:07:55 2025 ('ascii' codec can't encode character '\xb1' in position 58: ordinal not in range(128))
Traceback (most recent call last):
  File "/__w/ardupilot/ardupilot/Tools/autotest/vehicle_test_suite.py", line 8915, in run_one_test_attempt
    test_function(**test_kwargs)
  File "/__w/ardupilot/ardupilot/Tools/autotest/arduplane.py", line 4373, in AUTOTUNE
    self.check_parameter_value("RLL_RATE_D", 0.070284024, 2)
  File "/__w/ardupilot/ardupilot/Tools/autotest/vehicle_test_suite.py", line 6302, in check_parameter_value
    raise ValueError("%s expected %f ± %f%% (%f to %f) got %s with %f%% error" % (
ValueError: RLL_RATE_D expected 0.070284 ± 2.000000% (0.068878 to 0.071690) got 0.09136922657489777 with 29.999993% error
@MattKear
Copy link
Contributor

The changes look fine to me, however there does not look to be any functional changes here, so it won't help with the failing auto tests that you posted above. I am not sure of the intent of this PR though?

@peterbarker
Copy link
Contributor Author

The changes look fine to me, however there does not look to be any functional changes here, so it won't help with the failing auto tests that you posted above. I am not sure of the intent of this PR though?

It fixes the cascading error. ie. the problem only happens when something else fails. I'm not fixing that "something else" in this PR, just the cascading failure :-)

@peterbarker peterbarker merged commit 318e5db into ArduPilot:master Mar 19, 2025
66 checks passed
@peterbarker peterbarker deleted the pr/plusminus-fix branch March 19, 2025 22:14
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.

2 participants