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

Tests failing with multiple NoMethodError #162

Open
Segaja opened this issue Oct 9, 2022 · 2 comments
Open

Tests failing with multiple NoMethodError #162

Segaja opened this issue Oct 9, 2022 · 2 comments

Comments

@Segaja
Copy link

Segaja commented Oct 9, 2022

When trying to run tests for version 2.0.21 with rake test I get this output:

/usr/bin/ruby -w -I"lib:test" /usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb "test/crypto_test.rb" "test/ctx_test.rb" "test/data_test.rb" "test/gpgme_test.rb" "test/key_test.rb" "test/signature_test.rb" "test/sub_key_test.rb"
/build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/ctx_test.rb:73: warning: assigned but unused variable - cipher
/build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/ctx_test.rb:74: warning: assigned but unused variable - ouput
/build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/ctx_test.rb:123: warning: assigned but unused variable - ctx
/build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/data_test.rb:28: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
/build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/data_test.rb:35: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
Run options: --seed 41060

# Running:

EEEEEE....EE.DEPRECATED: Use assert_nil if expecting nil from /build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/data_test.rb:126. This will fail in Minitest 6.
..........E......................E.F...........................EE.EEE..............................

Finished in 3.025648s, 37.0169 runs/s, 62.7965 assertions/s.

  1) Error:
GPGME::Key::usable_for?#test_0001_checks for the capabilities of the key and returns true if it matches all:
NoMethodError: undefined method `stubs' for #<GPGME::Key sec 1024R/5B5D5C77 2011-04-23 trust=nil, owner_trust=:unknown, capability=[:encrypt, :sign, :certify], subkeys=[#<GPGME::SubKey ssc 1024R/5B5D5C77 2011-04-23 trust=nil, capability=[:sign, :certify]>, #<GPGME::SubKey ssc 1024R/E427BED4 2011-04-23 trust=nil, capability=[:encrypt]>], uids=[#<GPGME::UserID Test number 1 <test1@example.com> validity=unknown, signatures=[]>]>
Did you mean?  stub
    /build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/key_test.rb:142:in `block (3 levels) in <top (required)>'

  2) Error:
GPGME::Key::usable_for?#test_0002_returns false if the key is expired or revoked or disabled or disabled:
NoMethodError: undefined method `stubs' for #<GPGME::Key sec 1024R/5B5D5C77 2011-04-23 trust=nil, owner_trust=:unknown, capability=[:encrypt, :sign, :certify], subkeys=[#<GPGME::SubKey ssc 1024R/5B5D5C77 2011-04-23 trust=nil, capability=[:sign, :certify]>, #<GPGME::SubKey ssc 1024R/E427BED4 2011-04-23 trust=nil, capability=[:encrypt]>], uids=[#<GPGME::UserID Test number 1 <test1@example.com> validity=unknown, signatures=[]>]>
Did you mean?  stub
    /build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/key_test.rb:154:in `block (3 levels) in <top (required)>'

  3) Error:
GPGME::Key::export#test_0001_exports any key that matches the pattern:
NoMethodError: undefined method `any_instance' for GPGME::Ctx:Class
    /build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/key_test.rb:69:in `block (3 levels) in <top (required)>'

  4) Error:
GPGME::Key::export#test_0003_can specify options for Ctx:
NoMethodError: undefined method `expects' for GPGME::Ctx:Class
    /build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/key_test.rb:81:in `block (3 levels) in <top (required)>'

  5) Error:
GPGME::Key::export#test_0002_exports any key that matches the pattern, can specify output:
NoMethodError: undefined method `any_instance' for GPGME::Ctx:Class
    /build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/key_test.rb:75:in `block (3 levels) in <top (required)>'

  6) Error:
GPGME::Key::export#test_0004_can export a minimal key:
NoMethodError: undefined method `any_instance' for GPGME::Ctx:Class
    /build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/key_test.rb:86:in `block (3 levels) in <top (required)>'

  7) Error:
GPGME::Key::import#test_0001_can import keys:
NoMethodError: undefined method `any_instance' for GPGME::Ctx:Class
    /build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/key_test.rb:110:in `block (3 levels) in <top (required)>'

  8) Error:
GPGME::Key::import#test_0002_can specify options for Ctx:
NoMethodError: undefined method `expects' for GPGME::Ctx:Class
    /build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/key_test.rb:117:in `block (3 levels) in <top (required)>'

  9) Error:
GPGME::Key::find#test_0005_filters by capabilities:
NoMethodError: undefined method `any_instance' for GPGME::Key:Class
    /build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/key_test.rb:59:in `block (3 levels) in <top (required)>'

 10) Error:
GPGME::Key#test_0006_returns the expiry date of the first subkey:
NoMethodError: undefined method `expects' for #<GPGME::SubKey ssc 1024R/77D66566 2011-04-23 trust=nil, capability=[:sign, :certify]>
Did you mean?  expires
    /build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/key_test.rb:195:in `block (2 levels) in <top (required)>'

 11) Failure:
GPGME::Ctx::key export/import#test_0001_exports and imports all keys when passing an empty string [/build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/ctx_test.rb:325]:
Expected: 5
  Actual: 4

 12) Error:
GPGME::Key::#export#test_0001_can export from the key instance:
NoMethodError: undefined method `expects' for GPGME::Key:Class
    /build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/key_test.rb:94:in `block (3 levels) in <top (required)>'

 13) Error:
GPGME::Key::#export#test_0002_can export from the key instance passing variables:
NoMethodError: undefined method `expects' for GPGME::Key:Class
    /build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/key_test.rb:101:in `block (3 levels) in <top (required)>'

 14) Error:
GPGME::Ctx#test_0003_closes itself if called with a block:
NoMethodError: undefined method `expects' for GPGME:Module
    /build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/ctx_test.rb:19:in `block (2 levels) in <top (required)>'

 15) Error:
GPGME::Ctx#test_0002_doesn't close itself:
NoMethodError: undefined method `expects' for GPGME:Module
    /build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/ctx_test.rb:14:in `block (2 levels) in <top (required)>'

 16) Error:
GPGME::Ctx#test_0004_can be closed with the release method:
NoMethodError: undefined method `expects' for GPGME:Module
    /build/ruby-gpgme/src/ruby-gpgme-2.0.21/test/ctx_test.rb:24:in `block (2 levels) in <top (required)>'

112 runs, 190 assertions, 1 failures, 15 errors, 0 skips
rake aborted!
Command failed with status (1): [ruby -w -I"lib:test" /usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb "test/crypto_test.rb" "test/ctx_test.rb" "test/data_test.rb" "test/gpgme_test.rb" "test/key_test.rb" "test/signature_test.rb" "test/sub_key_test.rb" ]

Tasks: TOP => test
(See full trace by running task with --trace)
@ueno
Copy link
Owner

ueno commented Oct 9, 2022

Since the CI is running well, this is probably specific to your setup. Could you provide more information, e.g., Ruby version, whether you are using system libraries or not?

@Segaja
Copy link
Author

Segaja commented Oct 10, 2022

ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-linux]
RubyGems Environment:
  - RUBYGEMS VERSION: 3.3.23
  - RUBY VERSION: 3.0.4 (2022-04-12 patchlevel 208) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/3.0.0
  - USER INSTALLATION DIRECTORY: /build/.local/share/gem/ruby/3.0.0
  - RUBY EXECUTABLE: /usr/bin/ruby
  - GIT EXECUTABLE:
  - EXECUTABLE DIRECTORY: /usr/bin
  - SPEC CACHE DIRECTORY: /build/.local/share/gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - x86_64-linux
  - GEM PATHS:
     - /usr/lib/ruby/gems/3.0.0
     - /build/.local/share/gem/ruby/3.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => true
     - :bulk_threshold => 1000
     - "gem" => "--user-install"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/bin
     - /usr/bin/site_perl
     - /usr/bin/vendor_perl
     - /usr/bin/core_perl

And Yes for the building and installation I use --use-system-libraries. Do I need to pass something to the tests to recognize this also?

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