-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat(scripted-client): supporting passing templating variables and a top level filter #107
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
A thought I've had coming back to the test setup and having to refresh my memory is it might be worth putting a HOW-TO section in the README running through how the scripted client and testing snaps are intended to be used in a future commit.
Good point. There is some existing documentation for the scripted client in the docs directory but it's incorrect now following these changes. I'll get that fixed up. The testing snap though is only intended for use within the integration tests, so I'm not sure if that should be included in the docs? |
I'm mainly thinking if someone from snapd needed to update the spread tests and didn't have much context on what was where. So the |
Ah ok, well the |
You can do this with any snap actually, just do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks!
"prompt-filter": { | ||
"snap": "snap-name", | ||
"interface": "home", | ||
"constraints": { | ||
"path": "$BASE_PATH/.*" | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, it might be nice in the future to have an array of top level filters, and any prompt which matches any of the filters in the array is considered. But we don't need this yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup 🙂
As and when you come across a test case where you need this let me know and we can take a look at implementing it with that in mind 👍
See the updated sequence JSON files for examples of how this looks in practice.
A full example "spread" test for a happy path read can be written as follows:
Example output
I'm not sure what to make about this error that I see from
update.go
@olivercalder? I'm assuming it is coming from snapd but I'm not sure why it shows up here in the output from running the scripted client...Output when a sequence succeeds:
Output when a sequence fails: