Skip to content

Conversation

mikeprosserni
Copy link
Contributor

  • This contribution adheres to CONTRIBUTING.md.
  • I've updated CHANGELOG.md if applicable.
  • I've added tests applicable for this pull request

What does this Pull Request accomplish?

Along the same lines as my other PR #817, this splits up large test files into smaller more manageable test files. It also moves common helper functions into a conftest.py.

Why should this Pull Request be merged?

This should make reviewing future changes easier.

What testing has been done?

All the tests pass. Note that the writer tests require real hardware, which my machine now has:

image

@mikeprosserni mikeprosserni marked this pull request as ready for review September 9, 2025 21:13
Copy link
Contributor

github-actions bot commented Sep 9, 2025

Test Results

    38 files  ±  0      38 suites  ±0   1h 2m 55s ⏱️ +5s
 2 683 tests  -   8   2 236 ✅  -   8    447 💤 ±0  0 ❌ ±0 
47 406 runs   - 136  40 210 ✅  - 136  7 196 💤 ±0  0 ❌ ±0 

Results for commit fd596ac. ± Comparison against base commit 43fad37.

This pull request removes 94 and adds 86 tests. Note that renamed tests count towards both.
tests.component.test_stream_writers ‑ test___analog_multi_channel_writer___write_many_sample___returns_samples_written[grpc_init_kwargs]
tests.component.test_stream_writers ‑ test___analog_multi_channel_writer___write_many_sample___returns_samples_written[library_init_kwargs]
tests.component.test_stream_writers ‑ test___analog_multi_channel_writer___write_many_sample_with_wrong_dtype___raises_error_with_correct_dtype[grpc_init_kwargs]
tests.component.test_stream_writers ‑ test___analog_multi_channel_writer___write_many_sample_with_wrong_dtype___raises_error_with_correct_dtype[library_init_kwargs]
tests.component.test_stream_writers ‑ test___analog_single_channel_writer___write_many_sample___returns_samples_written[grpc_init_kwargs]
tests.component.test_stream_writers ‑ test___analog_single_channel_writer___write_many_sample___returns_samples_written[library_init_kwargs]
tests.component.test_stream_writers ‑ test___analog_single_channel_writer___write_many_sample_with_wrong_dtype___raises_error_with_correct_dtype[grpc_init_kwargs]
tests.component.test_stream_writers ‑ test___analog_single_channel_writer___write_many_sample_with_wrong_dtype___raises_error_with_correct_dtype[library_init_kwargs]
tests.component.test_stream_writers_ao ‑ test___analog_multi_channel_writer___write_many_sample___updates_output[grpc_init_kwargs]
tests.component.test_stream_writers_ao ‑ test___analog_multi_channel_writer___write_many_sample___updates_output[library_init_kwargs]
…
tests.component.stream_writers.test_analog_multi_channel_writer ‑ test___analog_multi_channel_writer___write_many_sample___updates_output[grpc_init_kwargs]
tests.component.stream_writers.test_analog_multi_channel_writer ‑ test___analog_multi_channel_writer___write_many_sample___updates_output[library_init_kwargs]
tests.component.stream_writers.test_analog_multi_channel_writer ‑ test___analog_multi_channel_writer___write_many_sample_with_wrong_dtype___raises_error_with_correct_dtype[grpc_init_kwargs]
tests.component.stream_writers.test_analog_multi_channel_writer ‑ test___analog_multi_channel_writer___write_many_sample_with_wrong_dtype___raises_error_with_correct_dtype[library_init_kwargs]
tests.component.stream_writers.test_analog_multi_channel_writer ‑ test___analog_multi_channel_writer___write_one_sample___updates_output[grpc_init_kwargs]
tests.component.stream_writers.test_analog_multi_channel_writer ‑ test___analog_multi_channel_writer___write_one_sample___updates_output[library_init_kwargs]
tests.component.stream_writers.test_analog_multi_channel_writer ‑ test___analog_multi_channel_writer___write_one_sample_with_wrong_dtype___raises_error_with_correct_dtype[grpc_init_kwargs]
tests.component.stream_writers.test_analog_multi_channel_writer ‑ test___analog_multi_channel_writer___write_one_sample_with_wrong_dtype___raises_error_with_correct_dtype[library_init_kwargs]
tests.component.stream_writers.test_analog_single_channel_writer ‑ test___analog_single_channel_writer___write_many_sample___updates_output[grpc_init_kwargs]
tests.component.stream_writers.test_analog_single_channel_writer ‑ test___analog_single_channel_writer___write_many_sample___updates_output[library_init_kwargs]
…
This pull request removes 86 skipped tests and adds 86 skipped tests. Note that renamed tests count towards both.
tests.component.test_stream_writers_ao ‑ test___analog_multi_channel_writer___write_many_sample___updates_output[grpc_init_kwargs]
tests.component.test_stream_writers_ao ‑ test___analog_multi_channel_writer___write_many_sample___updates_output[library_init_kwargs]
tests.component.test_stream_writers_ao ‑ test___analog_multi_channel_writer___write_many_sample_with_wrong_dtype___raises_error_with_correct_dtype[grpc_init_kwargs]
tests.component.test_stream_writers_ao ‑ test___analog_multi_channel_writer___write_many_sample_with_wrong_dtype___raises_error_with_correct_dtype[library_init_kwargs]
tests.component.test_stream_writers_ao ‑ test___analog_multi_channel_writer___write_one_sample___updates_output[grpc_init_kwargs]
tests.component.test_stream_writers_ao ‑ test___analog_multi_channel_writer___write_one_sample___updates_output[library_init_kwargs]
tests.component.test_stream_writers_ao ‑ test___analog_multi_channel_writer___write_one_sample_with_wrong_dtype___raises_error_with_correct_dtype[grpc_init_kwargs]
tests.component.test_stream_writers_ao ‑ test___analog_multi_channel_writer___write_one_sample_with_wrong_dtype___raises_error_with_correct_dtype[library_init_kwargs]
tests.component.test_stream_writers_ao ‑ test___analog_single_channel_writer___write_many_sample___updates_output[grpc_init_kwargs]
tests.component.test_stream_writers_ao ‑ test___analog_single_channel_writer___write_many_sample___updates_output[library_init_kwargs]
…
tests.component.stream_writers.test_analog_multi_channel_writer ‑ test___analog_multi_channel_writer___write_many_sample___updates_output[grpc_init_kwargs]
tests.component.stream_writers.test_analog_multi_channel_writer ‑ test___analog_multi_channel_writer___write_many_sample___updates_output[library_init_kwargs]
tests.component.stream_writers.test_analog_multi_channel_writer ‑ test___analog_multi_channel_writer___write_many_sample_with_wrong_dtype___raises_error_with_correct_dtype[grpc_init_kwargs]
tests.component.stream_writers.test_analog_multi_channel_writer ‑ test___analog_multi_channel_writer___write_many_sample_with_wrong_dtype___raises_error_with_correct_dtype[library_init_kwargs]
tests.component.stream_writers.test_analog_multi_channel_writer ‑ test___analog_multi_channel_writer___write_one_sample___updates_output[grpc_init_kwargs]
tests.component.stream_writers.test_analog_multi_channel_writer ‑ test___analog_multi_channel_writer___write_one_sample___updates_output[library_init_kwargs]
tests.component.stream_writers.test_analog_multi_channel_writer ‑ test___analog_multi_channel_writer___write_one_sample_with_wrong_dtype___raises_error_with_correct_dtype[grpc_init_kwargs]
tests.component.stream_writers.test_analog_multi_channel_writer ‑ test___analog_multi_channel_writer___write_one_sample_with_wrong_dtype___raises_error_with_correct_dtype[library_init_kwargs]
tests.component.stream_writers.test_analog_single_channel_writer ‑ test___analog_single_channel_writer___write_many_sample___updates_output[grpc_init_kwargs]
tests.component.stream_writers.test_analog_single_channel_writer ‑ test___analog_single_channel_writer___write_many_sample___updates_output[library_init_kwargs]
…

♻️ This comment has been updated with latest results.

@mikeprosserni
Copy link
Contributor Author

Something weird is going on with the CI linter. It's reporting lots of errors that don't make sense. The first one is this:

./tests/component/stream_readers/test_analog_multi_channel_reader.py:227:68: F821 undefined name 'VOLTAGE_EPSILON'

but line 227 of tests/component/stream_readers/test_analog_multi_channel_reader.py is this:

in_stream.waveform_attribute_mode = WaveformAttributeMode.TIMING

and VOLTAGE_EPSILON (without any prefix) doesn't appear anywhere in the codebase.

What's going on here? And how might I fix it?

@zhindes
Copy link
Collaborator

zhindes commented Sep 10, 2025

Something weird is going on with the CI linter. It's reporting lots of errors that don't make sense. The first one is this:

./tests/component/stream_readers/test_analog_multi_channel_reader.py:227:68: F821 undefined name 'VOLTAGE_EPSILON'

but line 227 of tests/component/stream_readers/test_analog_multi_channel_reader.py is this:

in_stream.waveform_attribute_mode = WaveformAttributeMode.TIMING

and VOLTAGE_EPSILON (without any prefix) doesn't appear anywhere in the codebase.

What's going on here? And how might I fix it?

The build checked out this ref, which looks wrong...

Checking out the ref
/usr/bin/git log -1 --format=%H
3a2a8256df2090abbbaef732d885069b799f0380

The build 18 hours ago said...

Results for commit https://github.com/ni/nidaqmx-python/commit/deb610f25626c06502fc193838ecedfa2f27f5a7. ±
Comparison against base commit faf34c9.
♻️ This comment has been updated with latest results.

deb610f is your commit from like an hour ago, so that last comment indicates it reran it and its fine?

This isn't helpful, probably. I'm confused, too :)

@bkeryan
Copy link
Collaborator

bkeryan commented Sep 10, 2025

Something weird is going on with the CI linter. It's reporting lots of errors that don't make sense. The first one is this:

./tests/component/stream_readers/test_analog_multi_channel_reader.py:227:68: F821 undefined name 'VOLTAGE_EPSILON'

but line 227 of tests/component/stream_readers/test_analog_multi_channel_reader.py is this:

in_stream.waveform_attribute_mode = WaveformAttributeMode.TIMING

and VOLTAGE_EPSILON (without any prefix) doesn't appear anywhere in the codebase.

What's going on here? And how might I fix it?

You added new test cases in #819

There are no merge conflicts, but the new test cases use variables that you have renamed. I would rebase this branch on top of origin/master and update the variable names.

@mikeprosserni mikeprosserni merged commit 4c1f0e4 into master Sep 10, 2025
27 checks passed
@mikeprosserni mikeprosserni deleted the users/mprosser/stream-writer-test-refactor branch September 10, 2025 19:05
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