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

ActiveGraph exception prevents single tests from running. #1718

Open
knirirr opened this issue Jan 25, 2024 · 2 comments
Open

ActiveGraph exception prevents single tests from running. #1718

knirirr opened this issue Jan 25, 2024 · 2 comments

Comments

@knirirr
Copy link

knirirr commented Jan 25, 2024

In a Rails 7.1.3 application with activegraph-f86d54c8ebf6, neo4j-ruby-driver-4.4.5, and Neo4j 4.1.6 the test_helper file contains require 'active_graph'. Running all the tests with rake test is fine, but running single test with e.g. rails test test/models/example_model.rb will throw the following exception:

~/.rvm/gems/ruby-3.2.2@my_app/bundler/gems/activegraph-f86d54c8ebf6/lib/active_graph.rb:32:in `<main>': uninitialized constant ActiveGraph (NameError)

Neo4j::Driver::Result.prepend ActiveGraph::Core::Result
                                               ^^^^^^^^
Did you mean?  ActiveSupport
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from ~/Work/Web/MyApp-API/test/test_helper.rb:4:in `<main>'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from ~/Work/Web/MyApp-API/test/models/my_app_record_test.rb:1:in `<main>'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/railties-7.1.3/lib/rails/test_unit/runner.rb:51:in `block in load_tests'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/railties-7.1.3/lib/rails/test_unit/runner.rb:51:in `each'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/railties-7.1.3/lib/rails/test_unit/runner.rb:51:in `load_tests'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/railties-7.1.3/lib/rails/test_unit/runner.rb:43:in `run'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/railties-7.1.3/lib/rails/commands/test/test_command.rb:33:in `perform'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/thor-1.3.0/lib/thor/command.rb:28:in `run'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/thor-1.3.0/lib/thor/invocation.rb:127:in `invoke_command'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/railties-7.1.3/lib/rails/command/base.rb:178:in `invoke_command'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/thor-1.3.0/lib/thor.rb:527:in `dispatch'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/railties-7.1.3/lib/rails/command/base.rb:73:in `perform'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/railties-7.1.3/lib/rails/command.rb:71:in `block in invoke'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/railties-7.1.3/lib/rails/command.rb:149:in `with_argv'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/railties-7.1.3/lib/rails/command.rb:69:in `invoke'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/railties-7.1.3/lib/rails/commands.rb:18:in `<main>'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from ~/.rvm/gems/ruby-3.2.2@my_app/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
	from bin/rails:4:in `<main>'

This appears to originate from the require call in test_helper.

@klobuczek
Copy link
Member

@knirirr could you check activegraph-11.5.0.beta.3? Thank you

@knirirr
Copy link
Author

knirirr commented Feb 6, 2024

Apologies, I didn't see the notification. For the moment I've re-written my code to use the Neo4j http interface instead.
So, please feel free to close this unless you think it would be of any use to anyone else.

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