-
Notifications
You must be signed in to change notification settings - Fork 87
Add acceptance test for bundle run
#2695
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
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.
I'd also add a map storing runId -> jobs.Run so that runs/get can return an error when wrong run is requested (this is the level of support we have for all other resources).
This reverts commit 4c327f5.
@denik Made the fake server stateful, can you take another look? |
@@ -188,7 +188,7 @@ func (r *jobRunner) Run(ctx context.Context, opts *Options) (output.RunOutput, e | |||
|
|||
waiter, err := w.Jobs.RunNow(ctx, *req) | |||
if err != nil { | |||
return nil, fmt.Errorf("cannot start job: %w", err) | |||
return nil, errors.New("cannot start job") |
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.
What's the motivation for this? Why have less details?
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.
Just splitting it into a separate PR: #2843 since it's not directly related. This PR does not remove it.
@@ -104,9 +104,6 @@ task or a Python wheel task, the second example applies. | |||
You can also use the bundle run command to execute scripts / commands in the same | |||
authentication context as the bundle. | |||
|
|||
Note: The current working directory of the provided command will be set to the root | |||
of the bundle. |
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.
Is this not true anymore? why this message is deleted?
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 don't see this diff, are you reviewing a specific commit?
} | ||
|
||
// Mark the run as terminated. | ||
run.State.LifeCycleState = jobs.RunLifeCycleStateTerminated |
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 seems to be very specific to a particular test, might not be reusable. Perhaps instead you can have explicit endpoint to update this field?
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.
The bundle run command blocks for the run to terminate. The run state is an internal detail and all runs automatically transition to terminated, so it's a fair way to model this in a fake workspace.
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.
OK, we can extend this later.
@@ -0,0 +1,16 @@ | |||
title "no run key specified" | |||
errcode trace $CLI bundle run |
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.
nit: personally prefer smaller tests, easier to review/debug and faster to run. e.g. you could split error-raising commands from the rest.
if you have one command then you also don't need to specify title (it's test name), errcode and trace.
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.
Fair enough, but in this case it's only 5 commands so still small. The flip side is you end up with a bunch of really granular files / tests which does not seem optimal.
@@ -19,6 +19,7 @@ acceptance/selftest/record_cloud/volume-io/hello.txt | |||
|
|||
# "bundle run" has trailing whitespace: | |||
acceptance/bundle/integration_whl/*/output.txt | |||
acceptance/bundle/run/basic/output.txt |
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.
why is it here? The last command is "echo" which includes a newline.
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.
The run command itself has a trailing space in it's output, not the echo command. Specifically:
[DATE] HH:MM:SS "run-name" TERMINATED
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.
Is this easily fixable? I would prefer to keep this ignore list to the absolute minimum.
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.
Trying to fix in #2864
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.
Thanks!
Addressed feedback from: #2695 (comment)
Addressed feedback from: #2695 (comment)
Followup to #2413, adding more coverage to ensure we have proper disambiguation between when
bundle run
is used to run a resource vs execute a script.