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

Split writeback tests #498

Merged
merged 7 commits into from
Nov 10, 2022
Merged

Split writeback tests #498

merged 7 commits into from
Nov 10, 2022

Conversation

noursaidi
Copy link
Collaborator

@noursaidi noursaidi commented Nov 8, 2022

Split writeback test into:

  • writeback_success_apply can the device update the value of a point through writeback
  • writeback_success_state can the device update the value of a point through writeback and sets the value_state to applied
  • writeback_invalid_state does the device report invalid in a points value_state when the value is known to be invalid
  • writeback_failure_state does the device report failure in a points value_state when the value is known to be invalid

Also add a utility bin/test_sequencer_solo to test a single sequence test against a pubber instance with given options (to test failures or edge cases .. similar to the one DAQ had). For some reason this works locally, but in CI it goes through the first line (irrespective of how many lines the file has) .. haven't figured that bit out

@noursaidi noursaidi requested a review from grafnu November 8, 2022 19:37
@@ -0,0 +1,4 @@
TESTING writeback_success_state with pubber opts: noWriteback
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would turn this into an in/out file, that is also the input to the testing, e.g.:

TEST writeback_success_state noWriteback RESULT fail writeback_success_state timeout waiting for point filter_differential_pressure_setpoint to have value_state applied

as one line could automatically be parsed to extract the first part so it's not replicated in the test script

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed as requested

SEQUENCER_OUT=/tmp/sequencer.log
TEST_LIST=/tmp/solo_sequencer_tests.txt

cat > $TEST_LIST <<EOF
Copy link
Collaborator

Choose a reason for hiding this comment

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

as per other comment, I think this should be parsed out of the in/out file, not as a separate list maintained here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed to read the tests from the "golden file"

@@ -0,0 +1,54 @@
#!/bin/bash -e
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd prefer a name like "test_itemized" or something to 1) avoid the test_sequencer prefix, and then 2) something a bit more descriptive than _solo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

renamed to test_itemized

@noursaidi
Copy link
Collaborator Author

@noursaidi noursaidi requested a review from grafnu November 9, 2022 15:32
PROJECT_ID=$1
shift 1

REGEX="^TEST ([a-z_]+)([A-Za-z ]+)?(RESULT .*)?$"
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's this used for? I don't see it anywhere in the file... ??

@noursaidi noursaidi merged commit 524dd06 into faucetsdn:master Nov 10, 2022
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.

None yet

2 participants