setup/evaluate env context after setup steps context.#309
Merged
TingluoHuang merged 1 commit intomasterfrom Jan 31, 2020
Merged
setup/evaluate env context after setup steps context.#309TingluoHuang merged 1 commit intomasterfrom
TingluoHuang merged 1 commit intomasterfrom
Conversation
TingluoHuang
commented
Jan 29, 2020
| // Populate env context for each step | ||
| Trace.Info("Initialize Env context for step"); | ||
| // Initialize scope | ||
| if (InitializeScope(step, scopeInputs)) |
Member
Author
There was a problem hiding this comment.
steps context get set up in InitializeScope
TingluoHuang
commented
Jan 29, 2020
| } | ||
|
|
||
| // Initialize scope | ||
| if (InitializeScope(step, scopeInputs)) |
Member
Author
There was a problem hiding this comment.
the change just moves this up.
TingluoHuang
commented
Jan 29, 2020
|
|
||
| var env2 = new MappingToken(null, null, null); | ||
| env2.Add(new StringToken(null, null, null, "env1"), new StringToken(null, null, null, "1000")); | ||
| env2.Add(new StringToken(null, null, null, "env2"), new BasicExpressionToken(null, null, null, "steps.foo.outputs.test")); |
Member
Author
There was a problem hiding this comment.
make sure env that reference steps context can be resolved.
b0bc669 to
9634123
Compare
thboop
reviewed
Jan 30, 2020
| stepContext.Setup(x => x.Write(It.IsAny<string>(), It.IsAny<string>())).Callback((string tag, string message) => { trace.Info($"[{tag}]{message}"); }); | ||
| stepContext.Object.Result = result; | ||
| step.Setup(x => x.ExecutionContext).Returns(stepContext.Object); | ||
| step.Setup(x => x.RunAsync()).Callback(() => { _stepContext.SetOutput(null, name, "test", "something", out string reference); }).Returns(Task.CompletedTask); |
Collaborator
There was a problem hiding this comment.
Consider doing this in the test that needs it (PopulateEnvContextAfterSetupStepsContext), not the shared test setup code.
Can we keep the original step.Setup(x => x.RunAsync()).Returns(Task.CompletedTask); and override it after its been returned as needed.
thboop
approved these changes
Jan 30, 2020
Collaborator
thboop
left a comment
There was a problem hiding this comment.
Clean PR, LGTM.
Minor thoughts
9634123 to
a1a2c71
Compare
AdamOlech
pushed a commit
to antmicro/runner
that referenced
this pull request
Jan 28, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixing #308