appmap 0.83.4 → 0.84.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +16 -0
- data/CHANGELOG.md +33 -0
- data/appmap.gemspec +3 -2
- data/lib/appmap/agent.rb +6 -0
- data/lib/appmap/{gem_hooks → builtin_hooks}/activesupport.yml +6 -0
- data/lib/appmap/builtin_hooks/net/http.yml +1 -1
- data/lib/appmap/builtin_hooks/openssl.yml +34 -0
- data/lib/appmap/builtin_hooks/ruby.yml +1 -1
- data/lib/appmap/config.rb +3 -3
- data/lib/appmap/event.rb +2 -2
- data/lib/appmap/gem_hooks/actionpack.yml +2 -0
- data/lib/appmap/gem_hooks/random.yml +12 -0
- data/lib/appmap/handler/{eval.rb → eval_handler.rb} +4 -4
- data/lib/appmap/handler/{function.rb → function_handler.rb} +1 -1
- data/lib/appmap/handler/{net_http.rb → net_http_handler.rb} +3 -3
- data/lib/appmap/handler/open_ssl_handler.rb +16 -0
- data/lib/appmap/handler/rails/render_handler.rb +2 -2
- data/lib/appmap/handler/rails/template.rb +2 -2
- data/lib/appmap/hook/method.rb +1 -1
- data/lib/appmap/trace.rb +1 -1
- data/lib/appmap/util.rb +1 -0
- data/lib/appmap/version.rb +1 -1
- data/lib/appmap.rb +0 -7
- metadata +13 -361
- data/spec/class_map_spec.rb +0 -28
- data/spec/config_spec.rb +0 -155
- data/spec/depends/api_spec.rb +0 -196
- data/spec/depends/spec_helper.rb +0 -18
- data/spec/display_string_spec.rb +0 -40
- data/spec/fixtures/config/incomplete_config.yml +0 -1
- data/spec/fixtures/config/invalid_config.yml +0 -2
- data/spec/fixtures/config/invalid_yaml_config.yml +0 -3
- data/spec/fixtures/config/maximal_config.yml +0 -14
- data/spec/fixtures/config/missing_path_or_gem.yml +0 -3
- data/spec/fixtures/config/valid_config.yml +0 -3
- data/spec/fixtures/database.yml +0 -11
- data/spec/fixtures/depends/.gitignore +0 -2
- data/spec/fixtures/depends/app/controllers/api/api_keys_controller.rb +0 -2
- data/spec/fixtures/depends/app/controllers/organizations_controller.rb +0 -2
- data/spec/fixtures/depends/app/models/api_key.rb +0 -2
- data/spec/fixtures/depends/app/models/configuration.rb +0 -2
- data/spec/fixtures/depends/app/models/show.rb +0 -2
- data/spec/fixtures/depends/app/models/user.rb +0 -2
- data/spec/fixtures/depends/spec/actual_rspec_test.rb +0 -7
- data/spec/fixtures/depends/spec/api_spec.rb +0 -2
- data/spec/fixtures/depends/spec/user_spec.rb +0 -2
- data/spec/fixtures/depends/test/actual_minitest_test.rb +0 -5
- data/spec/fixtures/hook/.gitignore +0 -2
- data/spec/fixtures/hook/app/controllers/api/api_keys_controller.rb +0 -1
- data/spec/fixtures/hook/app/controllers/organizations_controller.rb +0 -1
- data/spec/fixtures/hook/app/models/api_key.rb +0 -1
- data/spec/fixtures/hook/app/models/configuration.rb +0 -1
- data/spec/fixtures/hook/app/models/show.rb +0 -1
- data/spec/fixtures/hook/app/models/user.rb +0 -1
- data/spec/fixtures/hook/attr_accessor.rb +0 -5
- data/spec/fixtures/hook/compare.rb +0 -7
- data/spec/fixtures/hook/constructor.rb +0 -7
- data/spec/fixtures/hook/custom_instance_method.rb +0 -11
- data/spec/fixtures/hook/exception_method.rb +0 -61
- data/spec/fixtures/hook/exclude.rb +0 -15
- data/spec/fixtures/hook/instance_method.rb +0 -31
- data/spec/fixtures/hook/kwargs.rb +0 -11
- data/spec/fixtures/hook/labels.rb +0 -6
- data/spec/fixtures/hook/method_named_call.rb +0 -11
- data/spec/fixtures/hook/pkg_a/a.rb +0 -7
- data/spec/fixtures/hook/prepended_override.rb +0 -14
- data/spec/fixtures/hook/protected_method.rb +0 -29
- data/spec/fixtures/hook/report_parameters.rb +0 -8
- data/spec/fixtures/hook/singleton_method.rb +0 -63
- data/spec/fixtures/hook/spec/api_spec.rb +0 -1
- data/spec/fixtures/hook/spec/user_spec.rb +0 -1
- data/spec/fixtures/hook/sub_packages.rb +0 -7
- data/spec/fixtures/rack_users_app/.dockerignore +0 -2
- data/spec/fixtures/rack_users_app/.gitignore +0 -2
- data/spec/fixtures/rack_users_app/Gemfile +0 -10
- data/spec/fixtures/rack_users_app/appmap.yml +0 -3
- data/spec/fixtures/rack_users_app/config.ru +0 -2
- data/spec/fixtures/rack_users_app/lib/app.rb +0 -36
- data/spec/fixtures/rails5_users_app/.dockerignore +0 -1
- data/spec/fixtures/rails5_users_app/.gitignore +0 -39
- data/spec/fixtures/rails5_users_app/.rspec +0 -1
- data/spec/fixtures/rails5_users_app/.ruby-version +0 -1
- data/spec/fixtures/rails5_users_app/Gemfile +0 -54
- data/spec/fixtures/rails5_users_app/Rakefile +0 -6
- data/spec/fixtures/rails5_users_app/app/controllers/api/users_controller.rb +0 -29
- data/spec/fixtures/rails5_users_app/app/controllers/application_controller.rb +0 -2
- data/spec/fixtures/rails5_users_app/app/controllers/concerns/.keep +0 -0
- data/spec/fixtures/rails5_users_app/app/controllers/health_controller.rb +0 -5
- data/spec/fixtures/rails5_users_app/app/controllers/users_controller.rb +0 -21
- data/spec/fixtures/rails5_users_app/app/models/activerecord/user.rb +0 -18
- data/spec/fixtures/rails5_users_app/app/models/concerns/.keep +0 -0
- data/spec/fixtures/rails5_users_app/app/models/sequel/user.rb +0 -25
- data/spec/fixtures/rails5_users_app/app/views/layouts/application.html.haml +0 -7
- data/spec/fixtures/rails5_users_app/app/views/users/index.html.haml +0 -7
- data/spec/fixtures/rails5_users_app/appmap.yml +0 -11
- data/spec/fixtures/rails5_users_app/bin/appmap +0 -29
- data/spec/fixtures/rails5_users_app/bin/byebug +0 -29
- data/spec/fixtures/rails5_users_app/bin/gli +0 -29
- data/spec/fixtures/rails5_users_app/bin/htmldiff +0 -29
- data/spec/fixtures/rails5_users_app/bin/ldiff +0 -29
- data/spec/fixtures/rails5_users_app/bin/nokogiri +0 -29
- data/spec/fixtures/rails5_users_app/bin/rackup +0 -29
- data/spec/fixtures/rails5_users_app/bin/rails +0 -4
- data/spec/fixtures/rails5_users_app/bin/rake +0 -29
- data/spec/fixtures/rails5_users_app/bin/rspec +0 -29
- data/spec/fixtures/rails5_users_app/bin/ruby-parse +0 -29
- data/spec/fixtures/rails5_users_app/bin/ruby-rewrite +0 -29
- data/spec/fixtures/rails5_users_app/bin/sequel +0 -29
- data/spec/fixtures/rails5_users_app/bin/setup +0 -25
- data/spec/fixtures/rails5_users_app/bin/sprockets +0 -29
- data/spec/fixtures/rails5_users_app/bin/thor +0 -29
- data/spec/fixtures/rails5_users_app/bin/update +0 -25
- data/spec/fixtures/rails5_users_app/config/application.rb +0 -45
- data/spec/fixtures/rails5_users_app/config/boot.rb +0 -3
- data/spec/fixtures/rails5_users_app/config/credentials.yml.enc +0 -1
- data/spec/fixtures/rails5_users_app/config/database.yml +0 -1
- data/spec/fixtures/rails5_users_app/config/environment.rb +0 -5
- data/spec/fixtures/rails5_users_app/config/environments/development.rb +0 -40
- data/spec/fixtures/rails5_users_app/config/environments/production.rb +0 -68
- data/spec/fixtures/rails5_users_app/config/environments/test.rb +0 -39
- data/spec/fixtures/rails5_users_app/config/initializers/application_controller_renderer.rb +0 -8
- data/spec/fixtures/rails5_users_app/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/fixtures/rails5_users_app/config/initializers/cors.rb +0 -16
- data/spec/fixtures/rails5_users_app/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/fixtures/rails5_users_app/config/initializers/inflections.rb +0 -16
- data/spec/fixtures/rails5_users_app/config/initializers/mime_types.rb +0 -4
- data/spec/fixtures/rails5_users_app/config/initializers/wrap_parameters.rb +0 -9
- data/spec/fixtures/rails5_users_app/config/locales/en.yml +0 -33
- data/spec/fixtures/rails5_users_app/config/routes.rb +0 -11
- data/spec/fixtures/rails5_users_app/config.ru +0 -5
- data/spec/fixtures/rails5_users_app/db/migrate/20190728211408_create_users.rb +0 -9
- data/spec/fixtures/rails5_users_app/db/schema.rb +0 -23
- data/spec/fixtures/rails5_users_app/features/api_users.feature +0 -13
- data/spec/fixtures/rails5_users_app/features/support/env.rb +0 -4
- data/spec/fixtures/rails5_users_app/features/support/hooks.rb +0 -11
- data/spec/fixtures/rails5_users_app/features/support/steps.rb +0 -18
- data/spec/fixtures/rails5_users_app/lib/tasks/.keep +0 -0
- data/spec/fixtures/rails5_users_app/log/.keep +0 -0
- data/spec/fixtures/rails5_users_app/public/robots.txt +0 -1
- data/spec/fixtures/rails5_users_app/spec/controllers/users_controller_api_spec.rb +0 -42
- data/spec/fixtures/rails5_users_app/spec/controllers/users_controller_spec.rb +0 -27
- data/spec/fixtures/rails5_users_app/spec/models/user_spec.rb +0 -29
- data/spec/fixtures/rails5_users_app/spec/rails_helper.rb +0 -57
- data/spec/fixtures/rails5_users_app/spec/spec_helper.rb +0 -96
- data/spec/fixtures/rails5_users_app/users_app/.gitignore +0 -20
- data/spec/fixtures/rails6_users_app/.dockerignore +0 -1
- data/spec/fixtures/rails6_users_app/.gitignore +0 -39
- data/spec/fixtures/rails6_users_app/.rspec +0 -1
- data/spec/fixtures/rails6_users_app/Gemfile +0 -28
- data/spec/fixtures/rails6_users_app/Rakefile +0 -6
- data/spec/fixtures/rails6_users_app/app/controllers/api/users_controller.rb +0 -28
- data/spec/fixtures/rails6_users_app/app/controllers/application_controller.rb +0 -2
- data/spec/fixtures/rails6_users_app/app/controllers/concerns/.keep +0 -0
- data/spec/fixtures/rails6_users_app/app/controllers/health_controller.rb +0 -5
- data/spec/fixtures/rails6_users_app/app/controllers/users_controller.rb +0 -21
- data/spec/fixtures/rails6_users_app/app/models/activerecord/user.rb +0 -18
- data/spec/fixtures/rails6_users_app/app/models/concerns/.keep +0 -0
- data/spec/fixtures/rails6_users_app/app/models/sequel/user.rb +0 -25
- data/spec/fixtures/rails6_users_app/app/views/layouts/application.html.haml +0 -7
- data/spec/fixtures/rails6_users_app/app/views/users/index.html.haml +0 -7
- data/spec/fixtures/rails6_users_app/appmap.yml +0 -14
- data/spec/fixtures/rails6_users_app/bin/appmap +0 -29
- data/spec/fixtures/rails6_users_app/bin/byebug +0 -29
- data/spec/fixtures/rails6_users_app/bin/gli +0 -29
- data/spec/fixtures/rails6_users_app/bin/htmldiff +0 -29
- data/spec/fixtures/rails6_users_app/bin/ldiff +0 -29
- data/spec/fixtures/rails6_users_app/bin/nokogiri +0 -29
- data/spec/fixtures/rails6_users_app/bin/rackup +0 -29
- data/spec/fixtures/rails6_users_app/bin/rails +0 -4
- data/spec/fixtures/rails6_users_app/bin/rake +0 -29
- data/spec/fixtures/rails6_users_app/bin/rspec +0 -29
- data/spec/fixtures/rails6_users_app/bin/ruby-parse +0 -29
- data/spec/fixtures/rails6_users_app/bin/ruby-rewrite +0 -29
- data/spec/fixtures/rails6_users_app/bin/sequel +0 -29
- data/spec/fixtures/rails6_users_app/bin/setup +0 -25
- data/spec/fixtures/rails6_users_app/bin/sprockets +0 -29
- data/spec/fixtures/rails6_users_app/bin/thor +0 -29
- data/spec/fixtures/rails6_users_app/bin/update +0 -25
- data/spec/fixtures/rails6_users_app/config/application.rb +0 -45
- data/spec/fixtures/rails6_users_app/config/boot.rb +0 -3
- data/spec/fixtures/rails6_users_app/config/credentials.yml.enc +0 -1
- data/spec/fixtures/rails6_users_app/config/database.yml +0 -1
- data/spec/fixtures/rails6_users_app/config/environment.rb +0 -5
- data/spec/fixtures/rails6_users_app/config/environments/development.rb +0 -40
- data/spec/fixtures/rails6_users_app/config/environments/production.rb +0 -68
- data/spec/fixtures/rails6_users_app/config/environments/test.rb +0 -39
- data/spec/fixtures/rails6_users_app/config/initializers/application_controller_renderer.rb +0 -8
- data/spec/fixtures/rails6_users_app/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/fixtures/rails6_users_app/config/initializers/cors.rb +0 -16
- data/spec/fixtures/rails6_users_app/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/fixtures/rails6_users_app/config/initializers/inflections.rb +0 -16
- data/spec/fixtures/rails6_users_app/config/initializers/mime_types.rb +0 -4
- data/spec/fixtures/rails6_users_app/config/initializers/wrap_parameters.rb +0 -9
- data/spec/fixtures/rails6_users_app/config/locales/en.yml +0 -33
- data/spec/fixtures/rails6_users_app/config/routes.rb +0 -11
- data/spec/fixtures/rails6_users_app/config.ru +0 -5
- data/spec/fixtures/rails6_users_app/db/migrate/20190728211408_create_users.rb +0 -9
- data/spec/fixtures/rails6_users_app/db/schema.rb +0 -23
- data/spec/fixtures/rails6_users_app/features/api_users.feature +0 -13
- data/spec/fixtures/rails6_users_app/features/support/env.rb +0 -4
- data/spec/fixtures/rails6_users_app/features/support/hooks.rb +0 -11
- data/spec/fixtures/rails6_users_app/features/support/steps.rb +0 -18
- data/spec/fixtures/rails6_users_app/lib/tasks/.keep +0 -0
- data/spec/fixtures/rails6_users_app/lib/tasks/appmap.rake +0 -23
- data/spec/fixtures/rails6_users_app/log/.keep +0 -0
- data/spec/fixtures/rails6_users_app/package.json +0 -8
- data/spec/fixtures/rails6_users_app/public/robots.txt +0 -1
- data/spec/fixtures/rails6_users_app/spec/controllers/users_controller_api_spec.rb +0 -42
- data/spec/fixtures/rails6_users_app/spec/controllers/users_controller_spec.rb +0 -27
- data/spec/fixtures/rails6_users_app/spec/models/user_spec.rb +0 -29
- data/spec/fixtures/rails6_users_app/spec/rails_helper.rb +0 -57
- data/spec/fixtures/rails6_users_app/spec/spec_helper.rb +0 -96
- data/spec/fixtures/rails6_users_app/test/controllers/functional_calc_test.rb +0 -10
- data/spec/fixtures/rails6_users_app/test/integration/integration_calc_test.rb +0 -12
- data/spec/fixtures/rails6_users_app/users_app/.gitignore +0 -20
- data/spec/fixtures/rails6_users_app/yarn.lock +0 -2020
- data/spec/fixtures/rails7_users_app/.dockerignore +0 -1
- data/spec/fixtures/rails7_users_app/.gitattributes +0 -7
- data/spec/fixtures/rails7_users_app/.gitignore +0 -31
- data/spec/fixtures/rails7_users_app/.rspec +0 -1
- data/spec/fixtures/rails7_users_app/Gemfile +0 -75
- data/spec/fixtures/rails7_users_app/README.md +0 -24
- data/spec/fixtures/rails7_users_app/Rakefile +0 -6
- data/spec/fixtures/rails7_users_app/app/assets/config/manifest.js +0 -4
- data/spec/fixtures/rails7_users_app/app/assets/images/.keep +0 -0
- data/spec/fixtures/rails7_users_app/app/assets/stylesheets/application.css +0 -15
- data/spec/fixtures/rails7_users_app/app/channels/application_cable/channel.rb +0 -4
- data/spec/fixtures/rails7_users_app/app/channels/application_cable/connection.rb +0 -4
- data/spec/fixtures/rails7_users_app/app/controllers/application_controller.rb +0 -2
- data/spec/fixtures/rails7_users_app/app/controllers/concerns/.keep +0 -0
- data/spec/fixtures/rails7_users_app/app/helpers/application_helper.rb +0 -2
- data/spec/fixtures/rails7_users_app/app/javascript/application.js +0 -3
- data/spec/fixtures/rails7_users_app/app/javascript/controllers/application.js +0 -9
- data/spec/fixtures/rails7_users_app/app/javascript/controllers/hello_controller.js +0 -7
- data/spec/fixtures/rails7_users_app/app/javascript/controllers/index.js +0 -11
- data/spec/fixtures/rails7_users_app/app/jobs/application_job.rb +0 -7
- data/spec/fixtures/rails7_users_app/app/mailers/application_mailer.rb +0 -4
- data/spec/fixtures/rails7_users_app/app/models/application_record.rb +0 -3
- data/spec/fixtures/rails7_users_app/app/models/concerns/.keep +0 -0
- data/spec/fixtures/rails7_users_app/app/models/instance.rb +0 -7
- data/spec/fixtures/rails7_users_app/app/models/instructor.rb +0 -7
- data/spec/fixtures/rails7_users_app/app/views/layouts/application.html.erb +0 -16
- data/spec/fixtures/rails7_users_app/app/views/layouts/mailer.html.erb +0 -13
- data/spec/fixtures/rails7_users_app/app/views/layouts/mailer.text.erb +0 -1
- data/spec/fixtures/rails7_users_app/appmap.yml +0 -3
- data/spec/fixtures/rails7_users_app/bin/bundle +0 -114
- data/spec/fixtures/rails7_users_app/bin/importmap +0 -4
- data/spec/fixtures/rails7_users_app/bin/rails +0 -4
- data/spec/fixtures/rails7_users_app/bin/rake +0 -4
- data/spec/fixtures/rails7_users_app/bin/setup +0 -33
- data/spec/fixtures/rails7_users_app/config/application.rb +0 -22
- data/spec/fixtures/rails7_users_app/config/boot.rb +0 -4
- data/spec/fixtures/rails7_users_app/config/cable.yml +0 -10
- data/spec/fixtures/rails7_users_app/config/credentials.yml.enc +0 -1
- data/spec/fixtures/rails7_users_app/config/database.yml +0 -1
- data/spec/fixtures/rails7_users_app/config/environment.rb +0 -5
- data/spec/fixtures/rails7_users_app/config/environments/development.rb +0 -70
- data/spec/fixtures/rails7_users_app/config/environments/production.rb +0 -93
- data/spec/fixtures/rails7_users_app/config/environments/test.rb +0 -60
- data/spec/fixtures/rails7_users_app/config/importmap.rb +0 -7
- data/spec/fixtures/rails7_users_app/config/initializers/assets.rb +0 -12
- data/spec/fixtures/rails7_users_app/config/initializers/content_security_policy.rb +0 -26
- data/spec/fixtures/rails7_users_app/config/initializers/filter_parameter_logging.rb +0 -8
- data/spec/fixtures/rails7_users_app/config/initializers/inflections.rb +0 -16
- data/spec/fixtures/rails7_users_app/config/initializers/permissions_policy.rb +0 -11
- data/spec/fixtures/rails7_users_app/config/locales/en.yml +0 -33
- data/spec/fixtures/rails7_users_app/config/puma.rb +0 -43
- data/spec/fixtures/rails7_users_app/config/routes.rb +0 -6
- data/spec/fixtures/rails7_users_app/config/storage.yml +0 -34
- data/spec/fixtures/rails7_users_app/config.ru +0 -6
- data/spec/fixtures/rails7_users_app/db/migrate/20220328093141_create_instances.rb +0 -8
- data/spec/fixtures/rails7_users_app/db/migrate/20220328093154_create_instructors.rb +0 -8
- data/spec/fixtures/rails7_users_app/db/schema.rb +0 -27
- data/spec/fixtures/rails7_users_app/db/seeds.rb +0 -7
- data/spec/fixtures/rails7_users_app/lib/assets/.keep +0 -0
- data/spec/fixtures/rails7_users_app/lib/tasks/.keep +0 -0
- data/spec/fixtures/rails7_users_app/log/.keep +0 -0
- data/spec/fixtures/rails7_users_app/public/404.html +0 -67
- data/spec/fixtures/rails7_users_app/public/422.html +0 -67
- data/spec/fixtures/rails7_users_app/public/500.html +0 -66
- data/spec/fixtures/rails7_users_app/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/fixtures/rails7_users_app/public/apple-touch-icon.png +0 -0
- data/spec/fixtures/rails7_users_app/public/favicon.ico +0 -0
- data/spec/fixtures/rails7_users_app/public/robots.txt +0 -1
- data/spec/fixtures/rails7_users_app/storage/.keep +0 -0
- data/spec/fixtures/rails7_users_app/test/application_system_test_case.rb +0 -5
- data/spec/fixtures/rails7_users_app/test/channels/application_cable/connection_test.rb +0 -11
- data/spec/fixtures/rails7_users_app/test/controllers/.keep +0 -0
- data/spec/fixtures/rails7_users_app/test/fixtures/files/.keep +0 -0
- data/spec/fixtures/rails7_users_app/test/fixtures/instances.yml +0 -11
- data/spec/fixtures/rails7_users_app/test/fixtures/instructors.yml +0 -11
- data/spec/fixtures/rails7_users_app/test/helpers/.keep +0 -0
- data/spec/fixtures/rails7_users_app/test/integration/.keep +0 -0
- data/spec/fixtures/rails7_users_app/test/mailers/.keep +0 -0
- data/spec/fixtures/rails7_users_app/test/models/.keep +0 -0
- data/spec/fixtures/rails7_users_app/test/models/instance_test.rb +0 -6
- data/spec/fixtures/rails7_users_app/test/models/instructor_test.rb +0 -7
- data/spec/fixtures/rails7_users_app/test/system/.keep +0 -0
- data/spec/fixtures/rails7_users_app/test/test_helper.rb +0 -13
- data/spec/handler/class_with_eval.rb +0 -13
- data/spec/handler/eval_spec.rb +0 -73
- data/spec/hook_spec.rb +0 -1216
- data/spec/open_spec.rb +0 -19
- data/spec/rails_recording_spec.rb +0 -281
- data/spec/rails_spec_helper.rb +0 -107
- data/spec/rails_test_spec.rb +0 -35
- data/spec/railtie_spec.rb +0 -25
- data/spec/record_net_http_spec.rb +0 -161
- data/spec/record_sql_rails_pg_spec.rb +0 -59
- data/spec/remote_recording_spec.rb +0 -108
- data/spec/service/config_analyzer_spec.rb +0 -102
- data/spec/service/integration_test_path_finder_spec.rb +0 -24
- data/spec/service/validator/violation_spec.rb +0 -68
- data/spec/spec_helper.rb +0 -37
- data/spec/swagger/swagger_spec.rb +0 -85
- data/spec/util_spec.rb +0 -38
- data/test/agent_setup_init_test.rb +0 -39
- data/test/agent_setup_status_test.rb +0 -84
- data/test/agent_setup_validate_test.rb +0 -102
- data/test/bundle_vendor_test.rb +0 -35
- data/test/cucumber_test.rb +0 -72
- data/test/expectations/openssl_test_key_sign1.json +0 -53
- data/test/expectations/openssl_test_key_sign2-3.1.json +0 -53
- data/test/expectations/openssl_test_key_sign2.json +0 -58
- data/test/fixtures/bundle_vendor_app/Gemfile +0 -8
- data/test/fixtures/bundle_vendor_app/appmap.yml +0 -4
- data/test/fixtures/bundle_vendor_app/cli.rb +0 -54
- data/test/fixtures/cli_record_test/appmap.yml +0 -3
- data/test/fixtures/cli_record_test/lib/cli_record_test/main.rb +0 -9
- data/test/fixtures/cucumber4_recorder/Gemfile +0 -5
- data/test/fixtures/cucumber4_recorder/appmap.yml +0 -3
- data/test/fixtures/cucumber4_recorder/features/say_hello.feature +0 -5
- data/test/fixtures/cucumber4_recorder/features/support/env.rb +0 -5
- data/test/fixtures/cucumber4_recorder/features/support/hooks.rb +0 -11
- data/test/fixtures/cucumber4_recorder/features/support/steps.rb +0 -9
- data/test/fixtures/cucumber4_recorder/lib/hello.rb +0 -7
- data/test/fixtures/cucumber_recorder/Gemfile +0 -5
- data/test/fixtures/cucumber_recorder/appmap.yml +0 -3
- data/test/fixtures/cucumber_recorder/features/say_hello.feature +0 -5
- data/test/fixtures/cucumber_recorder/features/support/env.rb +0 -5
- data/test/fixtures/cucumber_recorder/features/support/hooks.rb +0 -11
- data/test/fixtures/cucumber_recorder/features/support/steps.rb +0 -9
- data/test/fixtures/cucumber_recorder/lib/hello.rb +0 -7
- data/test/fixtures/gem_test/Gemfile +0 -7
- data/test/fixtures/gem_test/appmap.yml +0 -3
- data/test/fixtures/gem_test/test/parser_test.rb +0 -12
- data/test/fixtures/minitest_recorder/Gemfile +0 -5
- data/test/fixtures/minitest_recorder/appmap.yml +0 -3
- data/test/fixtures/minitest_recorder/lib/hello.rb +0 -5
- data/test/fixtures/minitest_recorder/test/hello_test.rb +0 -12
- data/test/fixtures/mocha_mock_app/Gemfile +0 -5
- data/test/fixtures/mocha_mock_app/appmap.yml +0 -5
- data/test/fixtures/mocha_mock_app/lib/sheep.rb +0 -5
- data/test/fixtures/mocha_mock_app/test/sheep_test.rb +0 -18
- data/test/fixtures/openssl_recorder/Gemfile +0 -3
- data/test/fixtures/openssl_recorder/appmap.yml +0 -3
- data/test/fixtures/openssl_recorder/lib/openssl_cert_sign.rb +0 -94
- data/test/fixtures/openssl_recorder/lib/openssl_encrypt.rb +0 -34
- data/test/fixtures/openssl_recorder/lib/openssl_key_sign.rb +0 -28
- data/test/fixtures/process_recorder/appmap.yml +0 -3
- data/test/fixtures/process_recorder/hello.rb +0 -9
- data/test/fixtures/rspec_recorder/Gemfile +0 -5
- data/test/fixtures/rspec_recorder/appmap.yml +0 -3
- data/test/fixtures/rspec_recorder/lib/hello.rb +0 -5
- data/test/fixtures/rspec_recorder/spec/decorated_hello_spec.rb +0 -21
- data/test/fixtures/rspec_recorder/spec/labeled_hello_spec.rb +0 -9
- data/test/fixtures/rspec_recorder/spec/plain_hello_spec.rb +0 -9
- data/test/gem_test.rb +0 -35
- data/test/inspect_cli_test.rb +0 -12
- data/test/minitest_test.rb +0 -37
- data/test/mock_compatibility_test.rb +0 -45
- data/test/openssl_test.rb +0 -54
- data/test/record_process_test.rb +0 -35
- data/test/rspec_test.rb +0 -63
- data/test/test_helper.rb +0 -8
@@ -1,108 +0,0 @@
|
|
1
|
-
require 'rails_spec_helper'
|
2
|
-
|
3
|
-
require 'random-port'
|
4
|
-
|
5
|
-
require 'net/http'
|
6
|
-
require 'socket'
|
7
|
-
|
8
|
-
describe 'remote recording', :order => :defined do
|
9
|
-
include_context 'Rails app pg database', 'spec/fixtures/rails6_users_app' do
|
10
|
-
before(:all) do
|
11
|
-
@service_port = RandomPort::Pool::SINGLETON.acquire
|
12
|
-
@app.prepare_db
|
13
|
-
@server = @app.spawn_cmd \
|
14
|
-
"./bin/rails server -p #{@service_port}",
|
15
|
-
'ORM_MODULE' => 'sequel',
|
16
|
-
'APPMAP' => 'true'
|
17
|
-
|
18
|
-
uri = URI("http://localhost:#{@service_port}/health")
|
19
|
-
|
20
|
-
100.times do
|
21
|
-
begin
|
22
|
-
Net::HTTP.get(uri)
|
23
|
-
break
|
24
|
-
rescue Errno::ECONNREFUSED
|
25
|
-
sleep 0.1
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def json_body(res)
|
31
|
-
JSON.parse(res.body).deep_symbolize_keys
|
32
|
-
end
|
33
|
-
|
34
|
-
after(:all) do
|
35
|
-
if @server
|
36
|
-
Process.kill 'INT', @server
|
37
|
-
Process.wait @server
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
let(:service_address) { URI("http://localhost:#{@service_port}") }
|
42
|
-
let(:users_path) { '/users' }
|
43
|
-
let(:record_path) { '/_appmap/record' }
|
44
|
-
|
45
|
-
it 'returns the recording status' do
|
46
|
-
res = Net::HTTP.start(service_address.hostname, service_address.port) { |http|
|
47
|
-
http.request(Net::HTTP::Get.new(record_path))
|
48
|
-
}
|
49
|
-
|
50
|
-
expect(res).to be_a(Net::HTTPOK)
|
51
|
-
expect(res['Content-Type']).to eq('application/json')
|
52
|
-
expect(json_body(res)).to eq(enabled: false)
|
53
|
-
end
|
54
|
-
|
55
|
-
it 'starts a new recording session' do
|
56
|
-
res = Net::HTTP.start(service_address.hostname, service_address.port) { |http|
|
57
|
-
http.request(Net::HTTP::Post.new(record_path))
|
58
|
-
}
|
59
|
-
|
60
|
-
expect(res).to be_a(Net::HTTPOK)
|
61
|
-
end
|
62
|
-
|
63
|
-
it 'reflects the recording status' do
|
64
|
-
res = Net::HTTP.start(service_address.hostname, service_address.port) { |http|
|
65
|
-
http.request(Net::HTTP::Get.new(record_path))
|
66
|
-
}
|
67
|
-
|
68
|
-
expect(res).to be_a(Net::HTTPOK)
|
69
|
-
expect(res['Content-Type']).to eq('application/json')
|
70
|
-
expect(json_body(res)).to eq(enabled: true)
|
71
|
-
end
|
72
|
-
|
73
|
-
it 'fails to start a new recording session while recording is already active' do
|
74
|
-
res = Net::HTTP.start(service_address.hostname, service_address.port) { |http|
|
75
|
-
http.request(Net::HTTP::Post.new(record_path))
|
76
|
-
}
|
77
|
-
|
78
|
-
expect(res).to be_a(Net::HTTPConflict)
|
79
|
-
end
|
80
|
-
|
81
|
-
it 'stops recording' do
|
82
|
-
# Generate some events
|
83
|
-
Net::HTTP.start(service_address.hostname, service_address.port) { |http|
|
84
|
-
http.request(Net::HTTP::Get.new(users_path) )
|
85
|
-
}
|
86
|
-
|
87
|
-
res = Net::HTTP.start(service_address.hostname, service_address.port) { |http|
|
88
|
-
http.request(Net::HTTP::Delete.new(record_path))
|
89
|
-
}
|
90
|
-
|
91
|
-
expect(res).to be_a(Net::HTTPOK)
|
92
|
-
expect(res['Content-Type']).to eq('application/json')
|
93
|
-
|
94
|
-
data = json_body(res)
|
95
|
-
expect(data[:metadata]).to be_truthy
|
96
|
-
expect(data[:classMap].length).to be > 0
|
97
|
-
expect(data[:events].length).to be > 0
|
98
|
-
end
|
99
|
-
|
100
|
-
it 'fails to stop recording if there is no active recording session' do
|
101
|
-
res = Net::HTTP.start(service_address.hostname, service_address.port) { |http|
|
102
|
-
http.request(Net::HTTP::Delete.new(record_path))
|
103
|
-
}
|
104
|
-
|
105
|
-
expect(res).to be_a(Net::HTTPNotFound)
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
@@ -1,102 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'appmap/service/config_analyzer'
|
5
|
-
|
6
|
-
describe AppMap::Service::ConfigAnalyzer do
|
7
|
-
subject { described_class.new(config_file) }
|
8
|
-
|
9
|
-
context 'with non-existing config' do
|
10
|
-
let(:config_file) { 'spec/fixtures/config/non_existing_config.yml'}
|
11
|
-
|
12
|
-
describe '.app_name' do
|
13
|
-
it 'returns nil' do
|
14
|
-
expect(subject.app_name).to be_nil
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe '.is_valid?' do
|
19
|
-
it 'returns false' do
|
20
|
-
expect(subject.valid?).to be_falsey
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
describe '.is_present?' do
|
25
|
-
it 'returns false' do
|
26
|
-
expect(subject.present?).to be_falsey
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'with valid but non rails config' do
|
32
|
-
let(:config_file) { 'spec/fixtures/config/valid_config.yml'}
|
33
|
-
|
34
|
-
describe '.app_name' do
|
35
|
-
it 'returns app name value from config' do
|
36
|
-
expect(subject.app_name).to eq('appmap')
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'is valid' do
|
41
|
-
expect(subject.errors).to eq(['AppMap auto-configuration is currently not available for non Rails projects'])
|
42
|
-
end
|
43
|
-
|
44
|
-
describe '.is_present?' do
|
45
|
-
it 'returns true' do
|
46
|
-
expect(subject.present?).to be_truthy
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
context 'with maximal valid config' do
|
52
|
-
let(:config_file) { 'spec/fixtures/config/maximal_config.yml'}
|
53
|
-
|
54
|
-
it 'is valid' do
|
55
|
-
expect(subject.errors).to eq(['AppMap auto-configuration is currently not available for non Rails projects'])
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
context 'with invalid YAML config' do
|
60
|
-
let(:config_file) { 'spec/fixtures/config/invalid_yaml_config.yml'}
|
61
|
-
|
62
|
-
describe '.app_name' do
|
63
|
-
it 'returns app name value from config' do
|
64
|
-
expect(subject.app_name).to be_nil
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
describe '.is_valid?' do
|
69
|
-
it 'returns false' do
|
70
|
-
expect(subject.valid?).to be_falsey
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
describe '.is_present?' do
|
75
|
-
it 'return true' do
|
76
|
-
expect(subject.present?).to be_truthy
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
context 'with incomplete config' do
|
82
|
-
let(:config_file) { 'spec/fixtures/config/incomplete_config.yml'}
|
83
|
-
|
84
|
-
describe '.app_name' do
|
85
|
-
it 'returns nil' do
|
86
|
-
expect(subject.app_name).to eq('app')
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
describe '.is_valid?' do
|
91
|
-
it 'guesses paths and returns true ' do
|
92
|
-
expect(subject.valid?).to be_falsey
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
describe '.is_present?' do
|
97
|
-
it 'returns true' do
|
98
|
-
expect(subject.present?).to be_truthy
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|
102
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'appmap/service/integration_test_path_finder'
|
5
|
-
|
6
|
-
describe AppMap::Service::IntegrationTestPathFinder do
|
7
|
-
subject { described_class.new('./spec/fixtures/rails6_users_app/') }
|
8
|
-
|
9
|
-
describe '.count' do
|
10
|
-
it 'counts existing paths' do
|
11
|
-
expect(subject.count_paths).to be(3)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
describe '.find' do
|
16
|
-
it 'finds paths' do
|
17
|
-
expect(subject.find).to eq({
|
18
|
-
rspec: %w[spec/controllers],
|
19
|
-
minitest: %w[test/controllers test/integration],
|
20
|
-
cucumber: []
|
21
|
-
})
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,68 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'appmap/service/validator/violation'
|
5
|
-
|
6
|
-
describe AppMap::Service::Validator::Violation do
|
7
|
-
describe '.error' do
|
8
|
-
let(:message) { 'error' }
|
9
|
-
|
10
|
-
context 'with default parameters' do
|
11
|
-
subject { described_class.error(message: :message) }
|
12
|
-
|
13
|
-
it 'builds an error' do
|
14
|
-
expect(subject.level).to be :error
|
15
|
-
expect(subject.message).to be :message
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
context 'with default parameters' do
|
20
|
-
subject do
|
21
|
-
described_class.error(
|
22
|
-
message: :message,
|
23
|
-
setting: :setting,
|
24
|
-
filename: :filename,
|
25
|
-
detailed_message: :detailed_message,
|
26
|
-
help_urls: :help_urls
|
27
|
-
)
|
28
|
-
end
|
29
|
-
|
30
|
-
let(:filename) { 'filename' }
|
31
|
-
let(:setting) { 'setting' }
|
32
|
-
let(:detailed_message) { 'details' }
|
33
|
-
let(:help_urls) { %w[123 456] }
|
34
|
-
|
35
|
-
it 'builds an error' do
|
36
|
-
expect(subject.level).to be :error
|
37
|
-
expect(subject.message).to be :message
|
38
|
-
expect(subject.setting).to be :setting
|
39
|
-
expect(subject.detailed_message).to be :detailed_message
|
40
|
-
expect(subject.help_urls).to be :help_urls
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
describe '.warning' do
|
45
|
-
let(:message) { 'warning' }
|
46
|
-
|
47
|
-
context 'with default parameters' do
|
48
|
-
subject { described_class.warning(message: :message) }
|
49
|
-
|
50
|
-
it 'builds an error' do
|
51
|
-
expect(subject.level).to be :warning
|
52
|
-
expect(subject.message).to be :message
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
describe '#to_hash' do
|
58
|
-
subject { described_class.warning(message: :message) }
|
59
|
-
|
60
|
-
let(:message) { 'warning' }
|
61
|
-
|
62
|
-
it 'returns correct hash' do
|
63
|
-
expect(subject.to_h['level']).to be :warning
|
64
|
-
expect(subject.to_h['message']).to be :message
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
require 'net/http'
|
3
|
-
require 'json'
|
4
|
-
require 'yaml'
|
5
|
-
require 'English'
|
6
|
-
require 'byebug'
|
7
|
-
require 'webdrivers/chromedriver'
|
8
|
-
|
9
|
-
# Disable default initialization of AppMap
|
10
|
-
ENV['APPMAP_INITIALIZE'] = 'false'
|
11
|
-
|
12
|
-
require 'appmap'
|
13
|
-
|
14
|
-
RSpec.configure do |config|
|
15
|
-
config.example_status_persistence_file_path = "tmp/rspec_failed_examples.txt"
|
16
|
-
config.profile_examples = true
|
17
|
-
end
|
18
|
-
|
19
|
-
# Re-run the Rails specs without re-generating the data. This is useful for efficiently enhancing and
|
20
|
-
# debugging the test itself.
|
21
|
-
def use_existing_data?
|
22
|
-
ENV['USE_EXISTING_DATA'] == 'true'
|
23
|
-
end
|
24
|
-
|
25
|
-
def ruby_2?
|
26
|
-
RUBY_VERSION.split('.')[0].to_i == 2
|
27
|
-
end
|
28
|
-
|
29
|
-
shared_context 'collect events' do
|
30
|
-
def collect_events(tracer)
|
31
|
-
[].tap do |events|
|
32
|
-
while tracer.event?
|
33
|
-
events << tracer.next_event.to_h
|
34
|
-
end
|
35
|
-
end.map(&AppMap::Util.method(:sanitize_event))
|
36
|
-
end
|
37
|
-
end
|
@@ -1,85 +0,0 @@
|
|
1
|
-
require_relative '../rails_spec_helper'
|
2
|
-
|
3
|
-
describe 'rake appmap:swagger' do
|
4
|
-
include_context 'Rails app pg database', "spec/fixtures/rails6_users_app" unless use_existing_data?
|
5
|
-
include_context 'rails integration test setup'
|
6
|
-
|
7
|
-
unless use_existing_data?
|
8
|
-
before(:all) do
|
9
|
-
@app.run_cmd './bin/rake appmap:swagger'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
# The swagger-building logic is mostly in the JS code. So what we are really testing here
|
14
|
-
# is the Rails integration - the rake task and integration with the appmap.yml.
|
15
|
-
it 'generates openapi_stable.yml' do
|
16
|
-
swagger = YAML.load(File.read(File.join(tmpdir, 'swagger', 'openapi_stable.yaml'))).deep_symbolize_keys
|
17
|
-
|
18
|
-
expect(swagger).to eq(YAML.load(<<~YAML
|
19
|
-
:openapi: 3.0.1
|
20
|
-
:info:
|
21
|
-
:title: Usersapp API
|
22
|
-
:version: 1.1.0
|
23
|
-
:paths:
|
24
|
-
:/api/users:
|
25
|
-
:get:
|
26
|
-
:responses:
|
27
|
-
:200:
|
28
|
-
:content:
|
29
|
-
:application/json: {}
|
30
|
-
:requestBody:
|
31
|
-
:content: {}
|
32
|
-
:post:
|
33
|
-
:responses:
|
34
|
-
:201:
|
35
|
-
:content:
|
36
|
-
:application/json: {}
|
37
|
-
:422:
|
38
|
-
:content:
|
39
|
-
:application/json: {}
|
40
|
-
:requestBody:
|
41
|
-
:content:
|
42
|
-
:application/x-www-form-urlencoded:
|
43
|
-
:schema:
|
44
|
-
:type: object
|
45
|
-
:properties:
|
46
|
-
:login:
|
47
|
-
:type: string
|
48
|
-
:password:
|
49
|
-
:type: string
|
50
|
-
:user:
|
51
|
-
:type: object
|
52
|
-
:properties:
|
53
|
-
:login:
|
54
|
-
:type: string
|
55
|
-
:password:
|
56
|
-
:type: string
|
57
|
-
:/users:
|
58
|
-
:get:
|
59
|
-
:responses:
|
60
|
-
:200:
|
61
|
-
:content:
|
62
|
-
:text/html: {}
|
63
|
-
:/users/{id}:
|
64
|
-
:get:
|
65
|
-
:responses:
|
66
|
-
:200:
|
67
|
-
:content:
|
68
|
-
:text/plain: {}
|
69
|
-
:parameters:
|
70
|
-
- :name: id
|
71
|
-
:in: path
|
72
|
-
:schema:
|
73
|
-
:type: string
|
74
|
-
:required: true
|
75
|
-
:components:
|
76
|
-
:securitySchemes: {}
|
77
|
-
:servers:
|
78
|
-
- :url: http://{defaultHost}
|
79
|
-
:variables:
|
80
|
-
:defaultHost:
|
81
|
-
:default: localhost:3000
|
82
|
-
YAML
|
83
|
-
))
|
84
|
-
end
|
85
|
-
end
|
data/spec/util_spec.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'appmap/util'
|
5
|
-
|
6
|
-
describe AppMap::Util do
|
7
|
-
describe 'scenario_filename' do
|
8
|
-
let(:subject) { AppMap::Util.method(:scenario_filename) }
|
9
|
-
it 'leaves short names alone' do
|
10
|
-
expect(subject.call('foobar')).to eq('foobar.appmap.json')
|
11
|
-
end
|
12
|
-
it 'has a customizable suffix' do
|
13
|
-
expect(subject.call('foobar', extension: '.json')).to eq('foobar.json')
|
14
|
-
end
|
15
|
-
it 'limits the filename length' do
|
16
|
-
fname = (0...104).map { |i| ((i % 26) + 97).chr }.join
|
17
|
-
|
18
|
-
expect(subject.call(fname, max_length: 50)).to eq('abcdefghijklmno-RAd_SFbH1sUZ_OXfwPsfzw.appmap.json')
|
19
|
-
end
|
20
|
-
end
|
21
|
-
describe 'swaggerize path' do
|
22
|
-
it 'replaces rails-style parameters' do
|
23
|
-
expect(AppMap::Util.swaggerize_path('/org/:org_id(.:format)')).to eq('/org/{org_id}')
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'strips the format specifier' do
|
27
|
-
expect(AppMap::Util.swaggerize_path('/org(.:format)')).to eq('/org')
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'ignores malformed parameter specs' do
|
31
|
-
expect(AppMap::Util.swaggerize_path('/org/o:rg_id')).to eq('/org/o:rg_id')
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'ignores already swaggerized paths' do
|
35
|
-
expect(AppMap::Util.swaggerize_path('/org/{org_id}')).to eq('/org/{org_id}')
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'test_helper'
|
5
|
-
|
6
|
-
class AgentSetupInitTest < Minitest::Test
|
7
|
-
CONFIG_FILENAME = '123.yml'
|
8
|
-
EXPECTED_CONFIG_CONTENT = %(---
|
9
|
-
name: appmap-ruby
|
10
|
-
packages:
|
11
|
-
- path: lib
|
12
|
-
language: ruby
|
13
|
-
appmap_dir: tmp/appmap
|
14
|
-
)
|
15
|
-
|
16
|
-
def test_init_when_config_exists
|
17
|
-
output = `./exe/appmap-agent-init`
|
18
|
-
assert_equal 0, $CHILD_STATUS.exitstatus
|
19
|
-
expected = JSON.pretty_generate({
|
20
|
-
configuration: {
|
21
|
-
filename: 'appmap.yml',
|
22
|
-
contents: EXPECTED_CONFIG_CONTENT
|
23
|
-
}
|
24
|
-
})
|
25
|
-
assert_equal expected, output.strip
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_init_with_custom_config_filename
|
29
|
-
output = `./exe/appmap-agent-init -c #{CONFIG_FILENAME}`
|
30
|
-
assert_equal 0, $CHILD_STATUS.exitstatus
|
31
|
-
expected = JSON.pretty_generate({
|
32
|
-
configuration: {
|
33
|
-
filename: CONFIG_FILENAME,
|
34
|
-
contents: EXPECTED_CONFIG_CONTENT
|
35
|
-
}
|
36
|
-
})
|
37
|
-
assert_equal expected, output.strip
|
38
|
-
end
|
39
|
-
end
|
@@ -1,84 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'test_helper'
|
5
|
-
|
6
|
-
class AgentSetupInitTest < Minitest::Test
|
7
|
-
def test_status_gem
|
8
|
-
output = `./exe/appmap-agent-status`
|
9
|
-
assert_equal 0, $CHILD_STATUS.exitstatus
|
10
|
-
expected = {
|
11
|
-
test_commands: [],
|
12
|
-
properties: {
|
13
|
-
config: {
|
14
|
-
app: 'AppMap Rubygem',
|
15
|
-
present: true,
|
16
|
-
valid: false
|
17
|
-
},
|
18
|
-
project: {
|
19
|
-
agentVersion: AppMap::VERSION,
|
20
|
-
language: 'ruby',
|
21
|
-
remoteRecordingCapable: false,
|
22
|
-
integrationTests: false
|
23
|
-
}
|
24
|
-
}
|
25
|
-
}
|
26
|
-
assert_equal JSON.pretty_generate(expected), output.strip
|
27
|
-
end
|
28
|
-
|
29
|
-
def test_status_rails_app
|
30
|
-
output = `cd spec/fixtures/rails6_users_app && bundle exec ../../../exe/appmap-agent-status`
|
31
|
-
assert_equal 0, $CHILD_STATUS.exitstatus
|
32
|
-
expected = {
|
33
|
-
test_commands: [
|
34
|
-
{
|
35
|
-
framework: :rspec,
|
36
|
-
command: {
|
37
|
-
program: 'bundle',
|
38
|
-
args: %w[exec rspec ./spec/controllers],
|
39
|
-
environment: {
|
40
|
-
APPMAP: 'true',
|
41
|
-
DISABLE_SPRING: 'true'
|
42
|
-
}
|
43
|
-
}
|
44
|
-
},
|
45
|
-
{
|
46
|
-
framework: :minitest,
|
47
|
-
command: {
|
48
|
-
program: 'bundle',
|
49
|
-
args: %w[exec ruby ./test/controllers],
|
50
|
-
environment: {
|
51
|
-
APPMAP: 'true',
|
52
|
-
DISABLE_SPRING: 'true'
|
53
|
-
}
|
54
|
-
}
|
55
|
-
},
|
56
|
-
{
|
57
|
-
framework: :minitest,
|
58
|
-
command: {
|
59
|
-
program: 'bundle',
|
60
|
-
args: %w[exec ruby ./test/integration],
|
61
|
-
environment: {
|
62
|
-
APPMAP: 'true',
|
63
|
-
DISABLE_SPRING: 'true'
|
64
|
-
}
|
65
|
-
}
|
66
|
-
}
|
67
|
-
],
|
68
|
-
properties: {
|
69
|
-
config: {
|
70
|
-
app: 'rails6_users_app',
|
71
|
-
present: true,
|
72
|
-
valid: false
|
73
|
-
},
|
74
|
-
project: {
|
75
|
-
agentVersion: AppMap::VERSION,
|
76
|
-
language: 'ruby',
|
77
|
-
remoteRecordingCapable: false,
|
78
|
-
integrationTests: true
|
79
|
-
}
|
80
|
-
}
|
81
|
-
}
|
82
|
-
assert_equal JSON.pretty_generate(expected), output.strip
|
83
|
-
end
|
84
|
-
end
|
@@ -1,102 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'test_helper'
|
4
|
-
|
5
|
-
schema_path = File.expand_path('../../config-schema.yml', __FILE__)
|
6
|
-
CONFIG_SCHEMA = YAML.safe_load(File.read(schema_path))
|
7
|
-
class AgentSetupValidateTest < Minitest::Test
|
8
|
-
NON_EXISTING_CONFIG_FILENAME = '123.yml'
|
9
|
-
INVALID_YAML_CONFIG_FILENAME = 'spec/fixtures/config/invalid_yaml_config.yml'
|
10
|
-
INVALID_CONFIG_FILENAME = 'spec/fixtures/config/invalid_config.yml'
|
11
|
-
MISSING_PATH_OR_GEM_CONFIG_FILENAME = 'spec/fixtures/config/missing_path_or_gem.yml'
|
12
|
-
|
13
|
-
def check_output(output, expected_errors)
|
14
|
-
expected = JSON.pretty_generate(
|
15
|
-
{
|
16
|
-
version: 2,
|
17
|
-
errors: expected_errors,
|
18
|
-
schema: CONFIG_SCHEMA
|
19
|
-
}
|
20
|
-
)
|
21
|
-
assert_equal(expected, output.strip)
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_init_when_config_exists
|
25
|
-
output = `./exe/appmap-agent-validate`
|
26
|
-
assert_equal 0, $CHILD_STATUS.exitstatus
|
27
|
-
check_output(output, [
|
28
|
-
{
|
29
|
-
level: :error,
|
30
|
-
message: 'AppMap auto-configuration is currently not available for non Rails projects'
|
31
|
-
}
|
32
|
-
])
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_init_with_non_existing_config_file
|
36
|
-
output = `./exe/appmap-agent-validate -c #{NON_EXISTING_CONFIG_FILENAME}`
|
37
|
-
assert_equal 0, $CHILD_STATUS.exitstatus
|
38
|
-
check_output(output, [
|
39
|
-
{
|
40
|
-
level: :error,
|
41
|
-
message: 'AppMap auto-configuration is currently not available for non Rails projects'
|
42
|
-
},
|
43
|
-
{
|
44
|
-
level: :error,
|
45
|
-
filename: NON_EXISTING_CONFIG_FILENAME,
|
46
|
-
message: "AppMap configuration #{NON_EXISTING_CONFIG_FILENAME} file does not exist"
|
47
|
-
}
|
48
|
-
])
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_init_with_invalid_YAML
|
52
|
-
output = `./exe/appmap-agent-validate -c #{INVALID_YAML_CONFIG_FILENAME}`
|
53
|
-
assert_equal 0, $CHILD_STATUS.exitstatus
|
54
|
-
check_output(output, [
|
55
|
-
{
|
56
|
-
level: :error,
|
57
|
-
message: 'AppMap auto-configuration is currently not available for non Rails projects'
|
58
|
-
},
|
59
|
-
{
|
60
|
-
level: :error,
|
61
|
-
filename: INVALID_YAML_CONFIG_FILENAME,
|
62
|
-
message: "AppMap configuration #{INVALID_YAML_CONFIG_FILENAME} is not valid YAML",
|
63
|
-
detailed_message: "(#{INVALID_YAML_CONFIG_FILENAME}): " \
|
64
|
-
'did not find expected key while parsing a block mapping at line 1 column 1'
|
65
|
-
}
|
66
|
-
])
|
67
|
-
end
|
68
|
-
|
69
|
-
def test_init_with_invalid_data_config
|
70
|
-
output = `./exe/appmap-agent-validate -c #{INVALID_CONFIG_FILENAME}`
|
71
|
-
assert_equal 0, $CHILD_STATUS.exitstatus
|
72
|
-
check_output(output, [
|
73
|
-
{
|
74
|
-
level: :error,
|
75
|
-
message: 'AppMap auto-configuration is currently not available for non Rails projects'
|
76
|
-
},
|
77
|
-
{
|
78
|
-
level: :error,
|
79
|
-
filename: INVALID_CONFIG_FILENAME,
|
80
|
-
message: "AppMap configuration #{INVALID_CONFIG_FILENAME} could not be loaded",
|
81
|
-
detailed_message: "no implicit conversion of String into Integer"
|
82
|
-
}
|
83
|
-
])
|
84
|
-
end
|
85
|
-
|
86
|
-
def test_init_with_missing_package_key
|
87
|
-
output = `./exe/appmap-agent-validate -c #{MISSING_PATH_OR_GEM_CONFIG_FILENAME}`
|
88
|
-
assert_equal 0, $CHILD_STATUS.exitstatus
|
89
|
-
check_output(output, [
|
90
|
-
{
|
91
|
-
level: :error,
|
92
|
-
message: 'AppMap auto-configuration is currently not available for non Rails projects'
|
93
|
-
},
|
94
|
-
{
|
95
|
-
level: :error,
|
96
|
-
filename: MISSING_PATH_OR_GEM_CONFIG_FILENAME,
|
97
|
-
message: "AppMap configuration #{MISSING_PATH_OR_GEM_CONFIG_FILENAME} could not be loaded",
|
98
|
-
detailed_message: "AppMap config 'package' element should specify 'gem' or 'path'"
|
99
|
-
}
|
100
|
-
])
|
101
|
-
end
|
102
|
-
end
|