Project

General

Profile

Bug #13941

Core tests should not print API deprecation warnings

Added by Dominic Cleal over 4 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tests
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Many core functional tests print API deprecation warnings when testing deprecated API controllers, actions and parameters.

These Foreman::Deprecation.api_deprecation_warning calls should be expected in the tests so a) they don't clutter rake test output, and b) deprecation tests verify they're being logged too.

API v1 routes:

  1. DEPRECATION WARNING: Your API call uses deprecated behavior, Config templates were renamed to provisioning templates. (called from deprecated at /home/dcleal/code/foreman/foreman/app/controllers/api/v1/config_templates_controller.rb:98)
  2. DEPRECATION WARNING: Your API call uses deprecated behavior, Reports were renamed to ConfigReports. (called from deprecated at /home/dcleal/code/foreman/foreman/app/controllers/api/v1/reports_controller.rb:48)

API v2 routes:

  1. DEPRECATION WARNING: Your API call uses deprecated behavior, The resources /config_templates were moved to /provisioning_templates. Please use the new path instead. (called from deprecated at /home/dcleal/code/foreman/foreman/app/controllers/api/v2/config_templates_controller.rb:122)
  2. DEPRECATION WARNING: Your API call uses deprecated behavior, The resources /reports were moved to /config_reports. Please use the new path instead. (called from deprecated at /home/dcleal/code/foreman/foreman/app/controllers/api/v2/reports_controller.rb:66)
  3. DEPRECATION WARNING: Your API call uses deprecated behavior, The /status route is deprecated, please use the new /status/configuration instead. (called from status at /home/dcleal/code/foreman/foreman/app/controllers/api/v2/hosts_controller.rb:142)

Parameter checks:

  1. DEPRECATION WARNING: Your API call uses deprecated behavior, Field host_parameters_attributes.nested ignored. (called from block in check_create_host_nested at /home/dcleal/code/foreman/foreman/app/controllers/concerns/api/compatibility_checker.rb:9)
  2. DEPRECATION WARNING: Your API call uses deprecated behavior, Config templates were renamed to provisioning templates. (called from rename_config_template at /home/dcleal/code/foreman/foreman/app/controllers/api/v2/template_combinations_controller.rb:82)

Deprecation warning tests:

  1. DEPRECATION WARNING: You are using a deprecated behavior, it will be removed in version 1.9, More info. (called from block in <class:ForemanDeprecationTest> at /home/dcleal/code/foreman/foreman/test/unit/foreman_deprecation_test.rb:5)
  2. DEPRECATION WARNING: Your API call uses deprecated behavior, More info. (called from block (2 levels) in <class:ForemanDeprecationTest> at /home/dcleal/code/foreman/foreman/test/unit/foreman_deprecation_test.rb:19)

Related issues

Related to Foreman - Bug #13939: API v1 hosts rabl references deprecated puppet_status callClosed2016-02-29

Associated revisions

Revision d0732ecf (diff)
Added by Dominic Cleal about 4 years ago

fixes #13941 - expect deprecation warnings in tests

When testing deprecated routes, parameters etc, expect the deprecation
warnings to both test that it's logged and to prevent the logging from
cluttering test output.

History

#1 Updated by Dominic Cleal over 4 years ago

Also ReportImporter:

  1. DEPRECATION WARNING: You are using a deprecated behavior, it will be removed in version 1.13, Report model has turned to be STI, please use child classes. (called from create_report_and_logs at /home/dcleal/code/foreman/foreman/app/services/report_importer.rb:128)

#2 Updated by The Foreman Bot over 4 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3250 added

#3 Updated by Dominic Cleal over 4 years ago

  • Related to Bug #13939: API v1 hosts rabl references deprecated puppet_status call added

#4 Updated by Dominic Cleal about 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Dominic Cleal about 4 years ago

  • Legacy Backlogs Release (now unused) set to 136

Also available in: Atom PDF