Closed hassy closed 6 years ago
my team would love for this to be implemented so that we can load test our file uploader using artillery by uploading a file from disc
+1 on this.
It seems like this requires modification to the HttpEngine in artillery-core
repository. Perhaps script can take in a files
key of :field => :pathname
s. e.g.:
- post:
url: "/pets"
files:
picture: "/tmp/picture.jpg"
json:
name: "Mali"
species: "dog"
The contents of /tmp/picture.jpg
can be read and uploaded in HttpEngine. The code will have to detect the presence of files
key and ensure that upload is done in multipart/form-data
format.
Seems, like there was a pull request merged with this feature in the original artillery-core repo https://github.com/shoreditch-ops/artillery-core/pull/148 but it was reverted for some reason.
Can we get some reasoning behind this? Maybe we can update this pull request so it will be ok to merge?
@sosloow that change was reverted because the code did not quite work. More details here: https://github.com/shoreditch-ops/artillery/pull/265
It should be fairly straightforward to re-use some of the code in #265 to create a plugin to add file uploading support to HTTP scenarios. It'd be great if someone spent some time on it and shared the result with the community.
An option for teams that need file uploading functionality that just works today is to use Artillery Pro. It has support for file uploads, both for testing from one machine and when running distributed tests from a cloud cluster (on AWS ECS).
Thanks for clarification. For now, I found that file uploads via custom scripts are pretty straightforward.
Here's an example someone posted earlier: https://github.com/shoreditch-ops/artillery/issues/320#issuecomment-329448748
It would be nice to have better support for file uploads.
At the moment, the contents of the file to be uploaded needs to be embedded directly into the Artillery script. It should be possible to reference external files to be read at runtime.