Skip to content
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

The build fails. #1

Closed
pvalena opened this issue Mar 10, 2021 · 7 comments
Closed

The build fails. #1

pvalena opened this issue Mar 10, 2021 · 7 comments

Comments

@pvalena
Copy link
Member

pvalena commented Mar 10, 2021


Failures:

  1) Cucumber::Messages omits empty string fields in output
     Failure/Error: expect(json).to eq("{\"source\":{}}\n")

       expected: "{\"source\":{}}\n"
            got: "{\"source\":{\"data\":\"\"}}\n"

       (compared using ==)

       Diff:
       @@ -1,2 +1,2 @@
       -{"source":{}}
       +{"source":{"data":""}}
     # ./spec/cucumber/messages/ndjson_serialization_spec.rb:22:in `block (2 levels) in <module:Messages>'

  2) Cucumber::Messages omits empty number fields in output
     Failure/Error: expect(json).to eq('{"testCaseStarted":{"timestamp":{}}}' + "\n")

       expected: "{\"testCaseStarted\":{\"timestamp\":{}}}\n"
            got: "{\"test_case_started\":{\"timestamp\":{\"seconds\":0}}}\n"

       (compared using ==)

       Diff:
       @@ -1,2 +1,2 @@
       -{"testCaseStarted":{"timestamp":{}}}
       +{"test_case_started":{"timestamp":{"seconds":0}}}
     # ./spec/cucumber/messages/ndjson_serialization_spec.rb:39:in `block (2 levels) in <module:Messages>'

  3) Cucumber::Messages omits empty repeated fields in output
     Failure/Error: expect(json).to eq('{"parameterType":{}}' + "\n")

       expected: "{\"parameterType\":{}}\n"
            got: "{\"parameter_type\":{}}\n"

       (compared using ==)

       Diff:
       @@ -1,2 +1,2 @@
       -{"parameterType":{}}
       +{"parameter_type":{}}
     # ./spec/cucumber/messages/ndjson_serialization_spec.rb:54:in `block (2 levels) in <module:Messages>'

  4) Cucumber::Messages can be serialised over an ndjson stream
     Failure/Error: raise "Not JSON: #{line.strip}"

     RuntimeError:
       Not JSON: {"source":{"data":"Feature: Hello"}}
     # ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:13:in `rescue in block (2 levels) in initialize'
     # ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:10:in `block (2 levels) in initialize'
     # ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:8:in `each_line'
     # ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:8:in `block in initialize'
     # ./spec/cucumber/messages/ndjson_serialization_spec.rb:69:in `each'
     # ./spec/cucumber/messages/ndjson_serialization_spec.rb:69:in `each'
     # ./spec/cucumber/messages/ndjson_serialization_spec.rb:69:in `to_a'
     # ./spec/cucumber/messages/ndjson_serialization_spec.rb:69:in `block (2 levels) in <module:Messages>'
     # ------------------
     # --- Caused by: ---
     # NoMethodError:
     #   undefined method `from_json' for Cucumber::Messages::Envelope:Class
     #   Did you mean?  to_json
     #   ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:11:in `block (2 levels) in initialize'

  5) Cucumber::Messages ignores empty lines
     Failure/Error: raise "Not JSON: #{line.strip}"

     RuntimeError:
       Not JSON: {"source":{"data":"Feature: Hello"}}
     # ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:13:in `rescue in block (2 levels) in initialize'
     # ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:10:in `block (2 levels) in initialize'
     # ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:8:in `each_line'
     # ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:8:in `block in initialize'
     # ./spec/cucumber/messages/ndjson_serialization_spec.rb:85:in `each'
     # ./spec/cucumber/messages/ndjson_serialization_spec.rb:85:in `each'
     # ./spec/cucumber/messages/ndjson_serialization_spec.rb:85:in `to_a'
     # ./spec/cucumber/messages/ndjson_serialization_spec.rb:85:in `block (2 levels) in <module:Messages>'
     # ------------------
     # --- Caused by: ---
     # NoMethodError:
     #   undefined method `from_json' for Cucumber::Messages::Envelope:Class
     #   Did you mean?  to_json
     #   ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:11:in `block (2 levels) in initialize'

  6) Cucumber::Messages ignores missing fields
     Failure/Error: raise "Not JSON: #{line.strip}"

     RuntimeError:
       Not JSON: {"unused": 99}
     # ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:13:in `rescue in block (2 levels) in initialize'
     # ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:10:in `block (2 levels) in initialize'
     # ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:8:in `each_line'
     # ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:8:in `block in initialize'
     # ./spec/cucumber/messages/ndjson_serialization_spec.rb:95:in `each'
     # ./spec/cucumber/messages/ndjson_serialization_spec.rb:95:in `each'
     # ./spec/cucumber/messages/ndjson_serialization_spec.rb:95:in `to_a'
     # ./spec/cucumber/messages/ndjson_serialization_spec.rb:95:in `block (2 levels) in <module:Messages>'
     # ------------------
     # --- Caused by: ---
     # NoMethodError:
     #   undefined method `from_json' for Cucumber::Messages::Envelope:Class
     #   Did you mean?  to_json
     #   ./lib/cucumber/messages/ndjson_to_message_enumerator.rb:11:in `block (2 levels) in initialize'

Finished in 0.01757 seconds (files took 0.32449 seconds to load)
16 examples, 6 failures

https://copr.fedorainfracloud.org/coprs/build/2063172

@pvalena
Copy link
Member Author

pvalena commented Mar 10, 2021

@jackorp could you take a look?

@jackorp
Copy link
Contributor

jackorp commented Mar 10, 2021

Yes, I forgot to put an issue up that I am working on it.

I am currently testing how much work does protobuf need to satisfy cucumber-messages, i.e. if we can not use the protobuf-cucumber fork. AFAIK these methods were implemented, the way it is expecting, in 2 open PRs: protobuf#411 and protobuf#415.

I hope that once I create respective patches in the rubygem-protobuf I will be able to successfully build cucumber-messages.

@jackorp
Copy link
Contributor

jackorp commented Mar 12, 2021

I succeeded in building both the rubygem protobuf and the rubygem cucumber messages.

However, I did not find a way to make it work without creating a diff from the newest protobuf-cucumber fork version to the last protobuf version. For my solution see rubygem protobuf spec.
@pvalena does using the patch from versions sound sane?

I tried these approaches:
Building with patches from PRs 410, 411, and 415 from the protobuf github repo and their combinations.
Building with the protobuf-cucumber gem (all currently available versions), the only version that didn't fail to build either the rubygem-protobuf or the rubygem-cucumber-messages was v3.10.8 i.e. the latest.

@pvalena
Copy link
Member Author

pvalena commented Mar 16, 2021

So, basically, we're getting protobuf-cucumber?

Did all the all other approaches failed?

@jackorp
Copy link
Contributor

jackorp commented Mar 16, 2021

So, basically, we're getting protobuf-cucumber?

yes that is true.

Did all the all other approaches failed?

Yes, I did not succeed in applying the mentioned PRs in a way that would satisfy tests in cucumber messages and I don't feel like scouting the protobuf-cucumber source repo for the actual difference to identify where it splits from pull requests. I tried a bit but realized very soon that it would take me a few days which IMHO is not worth it.

@pvalena
Copy link
Member Author

pvalena commented Mar 17, 2021

Maybe we should simply have it provide protobuf-cucumber then? (Both in %gemspec and .spec.)

Alternatively, we could package protobuf-cucumber directly (I don't favor this option). I'd the reflect change in the version, however.

I'd also love to see this resolved / negotiated with upstream.

@voxik WDYT?

@jackorp
Copy link
Contributor

jackorp commented Mar 17, 2021

After an off-issue discussion with @pvalena I gave it one more try and found out finally what made the difference (badly resolved merge conflict JFTR).

Rubygem-protobuf build now succeeds from the PRs and cucumber-messages build succeeds as well (failure is there only because I didn't bump the NVR).

I plan to ping the protobuf upstream about how the status of the PRs.

@pvalena pvalena closed this as completed Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants