gavares
Phoenix controller test for chunked multipart upload
I’ve created a Phoenix controller that accepts a chunked multipart upload on a given endpoint that I’m using to stream logs from a remote process in real time. The endpoint seems to be working find when I use curl to stream data over but I’d like to write a unit test for my controller. I’m having a hard time figuring out how to do this from within a unit test using Phoenix.ConnTest and friends. Since the unit tests don’t seem to start a real server, I can’t rely on HTTPoison or spawn an external curl command to simulate a log stream. I’ve found plenty of examples for file upload via forms but haven’t found anything related to streaming a body using ConnTest.
Most Liked
gavares
FWIW, I ended up switching to using a websocket for various reasons. Never ended up finding a solution to this particular issue.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









