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

Fixes for tests to run under python 311 #23

Conversation

kokroo
Copy link

@kokroo kokroo commented Aug 15, 2023

Ongoing fixes for tests under Python 3.11 are included in this PR.
I will add more commits until all tests are fixed.

asgibson and others added 3 commits August 15, 2023 12:52
3 tests will show as broken in this branch:
test_Simulator__init__creates_Vehicle_and_AdapterDataSource_from_parsed_data_and_Agent_with_vehicle_when_SBN_Flag_resolves_to_True

test_ExecutionEngine_parse_data_argument_subsystems_breakdown_optional_default_is_False

test_ExecutionEngine_parse_data_sets_the_processedSimData_to_the_TimeSynchronizer_which_was_given_the_sim_data_received_from_parsed_data
If a single header is passed, it is passed a MagicMock object, so we are casting it to a list
@the-other-james the-other-james marked this pull request as draft August 18, 2023 14:27
@asgibson
Copy link
Contributor

@kokroo, are you able to run the unit tests locally?

@kokroo
Copy link
Author

kokroo commented Aug 18, 2023

@kokroo, are you able to run the unit tests locally?

Yes, I'm using this command from the readme:
"python driver.py -t"

I hope I didn't do it wrong. I actually tried Python 3.9, 3.11.2 (like you did, to get ride of a few failed tests) and 3.11.4.

There's just one extra failed test on 3.11.4 which I've already fixed. I believe we should be running the testing in a 3.11.4 environment since I've already brought it to parity with the failed tests in 3.11.2

I did a really deep dive into why these errors are happening to begin with. Between Python 3.10 and Python 3.11 there were a lot of changes under the hood concerning how objects are stored and represented in memory and how methods and attributes paths are accessed.

Even after using a debugger I haven't been able to get rid of 2 tests that are still failing.

I suggest we should also update all the dependences to their latest versions, since the versions pinned in the requirements do not support Python 3.11, but the latest versions of the dependencies do support everything including 3.8, 3.9,3.10 and 3.11 and even support for 3.12.

@asgibson asgibson force-pushed the 14-update-pytests-to-run-under-python-311 branch from 780698e to df01dec Compare August 31, 2023 21:40
@asgibson asgibson force-pushed the 14-update-pytests-to-run-under-python-311 branch from df01dec to 346c295 Compare October 10, 2023 14:44
@codecov-commenter
Copy link

Codecov Report

Merging #23 (791d1dc) into 14-update-pytests-to-run-under-python-311 (346c295) will not change coverage.
The diff coverage is n/a.

@@                             Coverage Diff                             @@
##           14-update-pytests-to-run-under-python-311       #23   +/-   ##
===========================================================================
  Coverage                                     100.00%   100.00%           
===========================================================================
  Files                                             21        21           
  Lines                                            917       917           
  Branches                                         130       130           
===========================================================================
  Hits                                             917       917           

@asgibson
Copy link
Contributor

@kokroo, thank you for the assistance. We wouldn't have understood the problem as well without it. The code has superseded the original issues we were encountering (code and tests changed) and branch 14 was rebased with these changes. I am closing this PR because of those updates. An additional problem was found after the rebase but fixed and noted in #14 with new PR #57.

@asgibson asgibson closed this Oct 11, 2023
@kokroo
Copy link
Author

kokroo commented Oct 12, 2023

@asgibson Thank you, good catch with the str and IDs there. I'm a bit confused now, are there any tests that are still failing after these fixes? If not, I'd even like to test 3.11.x versions as well as 3.12!

@asgibson
Copy link
Contributor

asgibson commented Nov 2, 2023

@kokroo, 3.11.2 is now being used with the "unit test run" workflow and all tests are passing. I would definitely like to know what happens when running with 3.12. Thanks for your continued interest!

the-other-james pushed a commit to dennisafa/OnAIR that referenced this pull request Feb 23, 2024
Resolve "put coverage into gitignore"

Closes nasa#23

See merge request cFS_lab/raisr_nos3/raisr-2.0!9
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.

3 participants