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

Add functional test for wait_for_valid_timestamp #510

Merged
merged 8 commits into from
Mar 1, 2024

Conversation

DeborahOoi96
Copy link
Collaborator

@DeborahOoi96 DeborahOoi96 commented Feb 21, 2024

What does this Pull Request accomplish?

Add unit test coverage for wait_for_valid_timestamp

What testing has been done?

Existing and newly added tests all pass
image

@DeborahOoi96
Copy link
Collaborator Author

DeborahOoi96 commented Feb 21, 2024

I'm not quite sure how to test this, so I just went with no_error / expected error tests.
I have tried reading back xxx_trigger.timestamp_val in Labview but I can't seem to get back a value that is not AbsoluteTime 0. Maybe I'm testing it wrongly because I'm new to daqmx. Maybe some reference on how to properly use wait_for_valid_timestamp will be helpful.

Copy link
Collaborator

@zhindes zhindes left a comment

Choose a reason for hiding this comment

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

What do you mean the timestamp_val doesn't return anything? This is a simulated device, so I would at least expect a 0 timestamp...

tests/component/_task_modules/test_triggers.py Outdated Show resolved Hide resolved
tests/component/_task_modules/test_triggers.py Outdated Show resolved Hide resolved
@DeborahOoi96
Copy link
Collaborator Author

What do you mean the timestamp_val doesn't return anything? This is a simulated device, so I would at least expect a 0 timestamp...

@zhindes sorry I wasn't clear in the description. I meant it only returns AbsoluteTime 0. I have updated the comment

@zhindes
Copy link
Collaborator

zhindes commented Feb 21, 2024

What do you mean the timestamp_val doesn't return anything? This is a simulated device, so I would at least expect a 0 timestamp...

@zhindes sorry I wasn't clear in the description. I meant it only returns AbsoluteTime 0. I have updated the comment

Ah ok. Well that's the best we can do with simulated device. That being said, I suspect simulated devices always return that regardless of whether or not we waited for a timestamp. So, yeah, not very useful. I'm fine with what you have.

tests/component/_task_modules/test_triggers.py Outdated Show resolved Hide resolved
tests/component/_task_modules/test_triggers.py Outdated Show resolved Hide resolved
tests/component/_task_modules/test_triggers.py Outdated Show resolved Hide resolved
tests/component/_task_modules/test_triggers.py Outdated Show resolved Hide resolved
tests/component/_task_modules/test_triggers.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@zhindes zhindes left a comment

Choose a reason for hiding this comment

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

and fix the field_daq task name

tests/component/_task_modules/test_triggers.py Outdated Show resolved Hide resolved
tests/component/_task_modules/test_triggers.py Outdated Show resolved Hide resolved
@DeborahOoi96 DeborahOoi96 requested a review from bkeryan February 26, 2024 10:49
@DeborahOoi96 DeborahOoi96 force-pushed the users/deooi/WaitForValidTSFT branch from 7daa985 to 674cf83 Compare March 1, 2024 02:53
@DeborahOoi96 DeborahOoi96 merged commit 6267cc0 into ni:master Mar 1, 2024
16 checks passed
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