-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Updates for --out=url option #1406
Conversation
Note: we need to use http-method=POST in the tests as WebRick seems to have issues with the PUT methods.
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.
Don't keep all the messages in memory :-)
I'm really facing weird issues right now. When I try to push to a real-server (either a simple Sinatra server or an S3 upload) and I'm getting 40x errors. I tried do debugging and came with that: fake_content = Tempfile.new('justXs')
fake_content.write('X' * content.length)
Kernel.puts "Sending real content"
content.rewind
req = build_request(uri, method, headers.merge('Content-Length' => content.size.to_s))
req.body_stream = content
response = @http.request(req)
Kernel.puts "Got response: #{response.code}"
Kernel.puts "Sending fake content"
fake_content.rewind
req = build_request(uri, method, headers.merge('Content-Length' => content.size.to_s))
req.body_stream = fake_content
response = @http.request(req)
Kernel.puts "Got response: #{response.code}" So this seems to work with fake content: ╰─$ bundle exec cucumber features/docs/getting_started.feature --format message --out="http://localhost:4567/"
WARNING: Nokogiri was built against LibXML version 2.9.10, but has dynamically loaded 2.9.4
Using the default profile...
........
2 scenarios (2 passed)
8 steps (8 passed)
0m1.221s
Sending real content
Got response: 400
Sending fake content
Got response: 200 Note that the tests are passing. I'm wondering if there's anything I missing making the upload failed with NDJson content but working with plain character repeated :/ @aslakhellesoy @mpkorstanje any idea by any chance ? |
I've been able to pinpoint a bit more the messages that are causing issues on upload: if envelope.step_definition
if envelope.step_definition.source_reference.uri.include?('aruba/cucumber/command.rb') ||
envelope.step_definition.source_reference.uri.include?('aruba/cucumber/file.rb')
envelope.step_definition.pattern.source = ''
end
end Adding this to the message generator made it work (yes, obviously that ugly :D ). The weird thing is that the expressions used in those files do not seem to have that much "weird" content (encoding or other that could cause any issue). Here's the list of the step that are removed:
I don't have a clue exactly which ones* causes the issues and why :/
|
I guess you are implicitly using url encoding? But not encoding the content? Shouldn't the client handle that? |
This does not fix yet the problem with S3 upload but at least it enables testing with a local Sinatra server.
I tried to use url encoding on the content (when writing it to the Tempfile) but that still does not fix the issue with S3 upload :/ |
Various updates discussed during Weekly meeting. The idea I to match more closely what was done in
cucumber-jvm
and also ease upload to a message service.unless: we'll add that back if needed, but not for the moment)-H "Transfer-Encoding: chunked"
is specified