Skip to content

ActiveGraph exception prevents single tests from running.  #1718

@knirirr

Description

@knirirr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions