janlelis / pws

Command-Line Password Safe 🔐︎
MIT License
208 stars 19 forks source link

Various Tests fail (some ruby-2.0 specific) #9

Closed terabyte closed 10 years ago

terabyte commented 11 years ago

Repro:

rvm use ruby-2.0.0-p195@pws --create
gem install bundler; bundle install
rake spec

Observe 1 spec fails

Failures:

  1) PWS::Format::V1_0 misc generates the same kdf, no matter which implementation
     Failure/Error: PWS::Format::V1_0.kdf_ruby(password, salt, iterations).should ==
     TypeError:
       nil can't be coerced into Fixnum
     # ./lib/pws/format/1.0.rb:150:in `kdf_ruby'
     # ./spec/pws_format_1_0_spec.rb:179:in `block (3 levels) in <top (required)>'

Finished in 1 minute 19.92 seconds
65 examples, 1 failure

Do the same with ruby-1.9.3-p429 and specs pass, so it is probably a ruby 2.0 breakage. I ran it several times to ensure it wasn't just a random flake.

In related news, under ruby 1.9.3, some cucumber tests fail:

Failing Scenarios:
cucumber features/add.feature:48 # Scenario: Set a new password for "github", this also sets the timestamp
cucumber features/show.feature:47 # Scenario: Also shows last change date for each entry
cucumber features/update.feature:48 # Scenario: Set a new password for "github", this also sets the timestamp

81 scenarios (3 failed, 78 passed)
515 steps (3 failed, 512 passed)
1m51.225s

Again, I ran several times to confirm it wasn't just flakes. All three tests reliably failed on my machine (using the procedure I outlined above).

I will try to figure it out and submit a pull request if I have time to investigate further. I may also have some security improvements and/or additional features in future pull requests (will probably be a new version of the data format, V1.1 or something, with more rounds).

Thanks! -Carl

janlelis commented 10 years ago

Hey Carl, thanks for all your contributions and sorry for answering so late!

The Ruby 2 issue was a problem with the pbkdf2 gem, which has been fixed now. Most of the other test fails are related to some issues with the aruba gem, which sometimes just behaves strangely. They are green now: https://travis-ci.org/janlelis/pws/jobs/21465776