-
Notifications
You must be signed in to change notification settings - Fork 17
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
TestStep variables proof of concept #83
Conversation
ebde5f4
to
9db5bb3
Compare
It puts the value into |
yes, probably I should rename method/variable for more clearity. v -> out |
b999ab2
to
d34f891
Compare
Codecov Report
@@ Coverage Diff @@
## main #83 +/- ##
==========================================
- Coverage 63.85% 63.84% -0.02%
==========================================
Files 163 164 +1
Lines 10170 10291 +121
==========================================
+ Hits 6494 6570 +76
- Misses 2980 3006 +26
- Partials 696 715 +19
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Yeah, let's rename the variable |
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.
I have questions, request, but they can go in another PR. But the review wasn't careful, and I assume @mimir-d also wanted to go through, so I would recommend to wait :)
My main concern here is that the PR contributes into tech debt we have in TestRunner. Let me quote myself from another chat:
But I guess solving this issue is a whole another epic story. |
I would say the main tech debt is in convoluted state machine implementation. If it will be moved into a separate logic, everything will be straightforward. Saving additional info at the end of the TestRunner.Run is straightforward |
a33174b
to
3187eb6
Compare
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.
returning for the v2
breakage and comments
would also be useful to have a "permitted outputs" type of array in the plugin itself, and the framework checks if that's valid when emitting; like the Events one. this would also be able to be extracted as docs, otherwise there's no way of knowing what output a plugin produces without reading the code |
I don't know, on the other hand it makes you each time to specify all the variables when using the plugin. We can add this later as improvement. And to get a list of that permitted outputs one still needs to read either a doc or code :) |
yes, but it can also act as a filter; if youre only interested in some outputs, you only write those for that specific plugin. The main point is to make things obvious for the reader, and adds some safety on top. - name: cmd
label: cmd0
parameters:
- ...
outputs:
- stdout
- name: echo
label: echo0
parameters:
- message: "cmd said {{step_output `cmd0.stdout`}}"
# this would be an error
- name: echo
label: echo1
parameters:
- message: "cmd said {{step_output `cmd0.stderr`}}"
only valid for the first writer, these descriptors are usually a write once, read many kind of thing so it would have value for the readers |
Anyway we can add it later if we start to feel the need of that kind of documentation |
1306d17
to
979b7dd
Compare
|
||
// CheckIdentifier checks that input argument forms a valid identifier name | ||
func CheckIdentifier(s string) error { | ||
if len(s) == 0 { |
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.
no longer needed, checked by regex
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.
Unfortunately it can't be omitted as FindString is used with further length comparison.
(MatchString doesn't finds any match and doesn't suit our needs)
979b7dd
to
9a8efb9
Compare
Rebased the PR. @mimir-d could you please restamp it? |
9a8efb9
to
1052aa9
Compare
Found a bug introduced by my previous PR, the fix is in #121 |
Signed-off-by: Ilya <[email protected]>
Add unit tests for CheckVariableName Code-style improvements based on PR's comments Signed-off-by: Ilya <[email protected]>
Signed-off-by: Ilya <[email protected]>
Signed-off-by: Ilya <[email protected]>
Signed-off-by: Ilya <[email protected]>
Signed-off-by: Ilya <[email protected]>
… of directly accessing internal variables Signed-off-by: Ilya <[email protected]>
39a8f78
to
8196bfa
Compare
PoC for #25
Introduced a new interface for step plugins:
that can add/read variables from current/previous steps.
A mapping between external->internal variables is represented as
StepVariablesMapping
type which was added to step bundles.In order to keep PR short, will add parameters template + better testing including e2e in the next PR