-
Notifications
You must be signed in to change notification settings - Fork 19
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
Move to new k6 module API #28
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.
One question, but otherwise LGTM.
batch := newBatch(ctx, c.cfg.Labels, streams, minBatchSize, maxBatchSize) | ||
return c.pushBatch(ctx, batch) | ||
func (c *Client) PushParameterized(streams, minBatchSize, maxBatchSize int) (httpext.Response, error) { | ||
batch := newBatch(c.vu.Context(), c.vu.State(), c.cfg.Labels, streams, minBatchSize, maxBatchSize) |
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 think we need to check for vu.State() here as well:
batch := newBatch(c.vu.Context(), c.vu.State(), c.cfg.Labels, streams, minBatchSize, maxBatchSize) | |
if state := c.vu.State(); state == nil { | |
return *httpext.NewResponse(), errors.New("state is nil") | |
} | |
batch := newBatch(c.vu.Context(), c.vu.State(), c.cfg.Labels, streams, minBatchSize, maxBatchSize) |
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 also wondered but it's already done in pushBatch
so ... I don't think it's needed, but I can add it 🤷
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.
Do you want me to add it so we can merge this ?
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.
PushParameterized
is the function that is usually called from within the JS test file. So I'd add the check there as well.
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.
fixed in 77cd232
@mstoykov Thanks for taking care of this. Could you please squash the changes into a single commit, then it can be merged. |
I was intending on using the github feature but I see it is disabled :( |
see grafana/k6#2344 for more info
30b23a8
to
30c3362
Compare
@mstoykov I enabled "squash merge" :) |
see grafana/k6#2344 for more info