-
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
Passing information between Test Steps #25
Comments
This totally makes sense. I like the approach that we emit events to pass information around. Maybe it's worth thinking about binding this to a specific key within the emit event? i.e. runtime_#event is accessible during runtime? Or does this makes things more complicated? |
I would go further and introduce variables, each test step will populate some set of dictionary, for example ssh can generate |
So we can access every variable populated by a test step? |
Yes! |
I can try to implement this - can you give me some starting point here? Or is that something that you're pushing internally already? :) |
Let's schedule a meeting to discuss this (and announce it on the contest channel in the OSF workspace in Slack)? My only concern is: it feels like we need to redesign test steps API a bit (writing asynchronous resumeable configurable interruptable test steps becomes a real pain). And if we want to use context to pass-through information, it feels like we add more complexity to the current not-yet-improved API (and potentially to a tech debt). Before making a decision how to make this specific feature I would love to hear if @mimir-d have any opinion on what API we should have in the long term. In other words, it would be nice to implement this feature in a way which aligns the best with the envisioned long term teststep API development. |
This is gonna sound bad, but I'll be honest with you all. I think any kind of implementation can go ahead right now regarding this feature, and it will be refined (or redesigned) in the future refactoring. There is a slight desire to have this close to a possible final form (as xaionaro's saying) but I don't think that should be a hard blocker right now. I mean... just don't use globals or something like that :) |
Yeah, I agree, it is not a blocker. It is just a concern. And basically any way is good :) |
The internal implementation can always be reworked, so I'm not worried about it. |
Meeting sounds good. I do agree that we are increasing complexity here - however for this to work in a broader scope - I think that's important. Maybe we can brainstorm during the meeting :) |
Sorry, for delay, had some internal discussion on how to make the change in job descriptor more clear: So, the raw proposal of "public interface" change is the following:
Here one should also check that sshcmd produces stdout variable and if not, fail early
Feel free to comment, brainstorm. @walterchris Can we discuss the meeting time in slack? |
Few comments.
|
Number 4 has definitely less priority and could be omitted, but it makes tests more clear and removes the very same checks from each and every test step |
Issue by dimkup
Thursday Aug 27, 2020 at 15:47 GMT
Originally opened as https://github.com/facebookincubator/contest/issues/141
Intro
There are some cases when it would be useful to pass some information between Test Steps in the same Job/Run.
For example some step could acquire some resource (for example create a block list rule). The resource should be released by some further Test Step, so in order to do it effectively, the first step should pass resource ID to the second step.
Another example: some Test Step produces an artefact (builds a package) and another Test Step should deploy or run the artefact. It would be good to have a way to pass the artefact ID/url to the next step.
The Idea
Currently there is no way Test Steps could pass information to each other. In order to introduce it, we could try to extend the Target structure with kind of context, but there are some issues with the approach:
There is another approach to the information passing - reuse existing event infrastructure. Generally the only thing we need to do here is to extend Test Step's Run method signature with Fetcher parameter and change existing limitations on event queries. This way Test Steps would be able to emit and consume events from each other. How could it help?
Since most of the time Test Steps need to interact inside the same Run, as suggested by @insomniacslk, it's pretty easy to keep them in a local memory cache and heat up the cache from the DB in case of restart.
The issues with the approach:
The text was updated successfully, but these errors were encountered: