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

Fixed issues causing errors in test cases using real devices #321

Merged
merged 12 commits into from
May 5, 2023

Conversation

MounikaBattu17
Copy link
Contributor

@MounikaBattu17 MounikaBattu17 commented May 4, 2023

What does this PR accomplish?
Fixes the errors in tests using real device. The issues are

  • Corrected the order of parameters when calling read_raw .
  • Removed the unwanted parameter FillMode passed to function write_digital_scalar_u32.
  • Updated the ctype of read_array/write_array of read_digital_lines/write_digital_lines to bool since it is expected one.
  • Removed using enum power_up_state by value in caller since it is returned by value from the interpreter.

Why should the PR be merged?
This PR fixes the errors in the testcases mentioned in the Task 2382630: Fix failure test cases using hardware

What testing has been done?
Ensured errors are not thrown while running these tests but tests are not run using real device.

@MounikaBattu17 MounikaBattu17 requested a review from bkeryan May 4, 2023 18:58
@bkeryan
Copy link
Collaborator

bkeryan commented May 4, 2023

Updated results. (This included the direction tweak I suggested, but it probably doesn't matter.)

PS D:\dev\nidaqmx-python> poetry run pytest
================================================= test session starts =================================================
platform win32 -- Python 3.9.13, pytest-7.3.1, pluggy-1.0.0
rootdir: D:\dev\nidaqmx-python
plugins: cov-4.0.0, mock-3.10.0
collected 327 items

tests\acceptance\test_examples.py .......s...s..sss.                                                             [  5%]
tests\component\test_buffer_property.py ...                                                                      [  6%]
tests\component\test_channel_properties.py ..................                                                    [ 11%]
tests\component\test_device_properties.py .............                                                          [ 15%]
tests\component\test_export_signal_properties.py .......                                                         [ 18%]
tests\component\test_persisted_channel_properties.py ......                                                      [ 19%]
tests\component\test_persisted_scale_properties.py .........                                                     [ 22%]
tests\component\test_persisted_task_properties.py ......                                                         [ 24%]
tests\component\test_physical_channel_property.py ..........                                                     [ 27%]
tests\component\test_read_properties.py ........................                                                 [ 34%]
tests\component\test_scale.py .                                                                                  [ 35%]
tests\component\test_scale_properties.py .........                                                               [ 37%]
tests\component\test_timing_properties.py ....................                                                   [ 44%]
tests\component\test_trigger_properties.py .............                                                         [ 48%]
tests\component\test_watchdog_properties.py ................                                                     [ 52%]
tests\component\test_write_properties.py ..............                                                          [ 57%]
tests\legacy\test_channel_creation.py .........                                                                  [ 59%]
tests\legacy\test_channels.py ......                                                                             [ 61%]
tests\legacy\test_container_operations.py ...                                                                    [ 62%]
tests\legacy\test_enum_bitfields.py ...                                                                          [ 63%]
tests\legacy\test_events.py .                                                                                    [ 63%]
tests\legacy\test_export_signals.py .                                                                            [ 64%]
tests\legacy\test_invalid_writes.py .....                                                                        [ 65%]
tests\legacy\test_lib.py .                                                                                       [ 66%]
tests\legacy\test_multi_threading.py .                                                                           [ 66%]
tests\legacy\test_power_up_states.py .                                                                           [ 66%]
tests\legacy\test_properties.py .........                                                                        [ 69%]
tests\legacy\test_read_exceptions.py ...                                                                         [ 70%]
tests\legacy\test_read_write.py ...........................                                                      [ 78%]
tests\legacy\test_resource_warnings.py ..                                                                        [ 79%]
tests\legacy\test_stream_analog_readers_writers.py ....                                                          [ 80%]
tests\legacy\test_stream_counter_readers_writers.py ..........                                                   [ 83%]
tests\legacy\test_stream_digital_readers_writers.py ................                                             [ 88%]
tests\legacy\test_stream_power_readers.py ..................                                                     [ 93%]
tests\legacy\test_system_collections.py .....                                                                    [ 95%]
tests\legacy\test_task.py .                                                                                      [ 95%]
tests\legacy\test_teds.py .                                                                                      [ 96%]
tests\legacy\test_triggers.py .....                                                                              [ 97%]
tests\legacy\test_utils.py ....                                                                                  [ 98%]
tests\legacy\test_watchdog.py ..                                                                                 [ 99%]
tests\legacy\test_write_exceptions.py ..                                                                         [100%]

=========================================== 322 passed, 5 skipped in 58.05s ===========================================

Copy link
Collaborator

@bkeryan bkeryan left a comment

Choose a reason for hiding this comment

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

This looks good, but I think we should use the parameter direction field to decide which flags to use.

@MounikaBattu17 MounikaBattu17 requested a review from bkeryan May 4, 2023 20:32
@MounikaBattu17
Copy link
Contributor Author

Thank you Brad for testing the test cases which we couldn't cover.

@keer1111 keer1111 merged commit 4eae0c9 into master May 5, 2023
@MounikaBattu17 MounikaBattu17 deleted the users/mounika/fix-test-failures branch May 16, 2023 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants