Skip to content

Commit

Permalink
Merge pull request #15401 from eduardoj/refactoring/remove_unneeded_w…
Browse files Browse the repository at this point in the history
…arning_ii

Remove warning comments about using VCR (II)
  • Loading branch information
eduardoj committed Dec 19, 2023
2 parents 40abbae + 94c8960 commit 1d9c198
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 47 deletions.
2 changes: 0 additions & 2 deletions src/api/spec/controllers/source_attribute_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# CONFIG['global_write_through'] = true

RSpec.describe SourceAttributeController, :vcr do
render_views

Expand Down
4 changes: 0 additions & 4 deletions src/api/spec/controllers/source_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# WARNING: Some tests require real backend answers, so make sure you uncomment
# this line and start a test backend.
# CONFIG['global_write_through'] = true

RSpec.describe SourceController, :vcr do
let(:user) { create(:confirmed_user, :with_home, login: 'tom') }
let(:project) { user.home_project }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# CONFIG['global_write_through'] = true

RSpec.describe SourceProjectConfigController, :vcr do
let(:user) { create(:confirmed_user, :with_home, login: 'tom') }
let(:project) { user.home_project }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# CONFIG['global_write_through'] = true

RSpec.describe SourceProjectMetaController, :vcr do
render_views

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# CONFIG['global_write_through'] = true

RSpec.describe SourceProjectPackageMetaController, :vcr do
render_views
let(:user) { create(:confirmed_user, login: 'tom') }
Expand Down
4 changes: 0 additions & 4 deletions src/api/spec/controllers/webui/kiwi/images_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# WARNING: Some tests require real backend answers, so make sure you uncomment
# this line and start a test backend.
# CONFIG['global_write_through'] = true

RSpec.describe Webui::Kiwi::ImagesController, :vcr do
let(:project) { create(:project, name: 'fake_project') }
let(:user) { create(:confirmed_user, :with_home, login: 'tom') }
Expand Down
19 changes: 0 additions & 19 deletions src/api/spec/factories/packages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
end

after(:create) do |package, evaluator|
# NOTE: Enable global write through when writing new VCR cassetes.
# ensure the backend knows the project
if CONFIG['global_write_through']
Backend::Connection.put("/source/#{CGI.escape(package.project.name)}/#{CGI.escape(package.name)}/_config", Faker::Lorem.paragraph)
Backend::Connection.put(
Expand All @@ -68,8 +66,6 @@
end

after(:create) do |package, evaluator|
# NOTE: Enable global write through when writing new VCR cassetes.
# ensure the backend knows the project
if CONFIG['global_write_through']
Backend::Connection.put(
"/source/#{CGI.escape(package.project.name)}/#{CGI.escape(package.name)}/#{evaluator.file_name}", evaluator.file_content
Expand All @@ -91,8 +87,6 @@
end

after(:create) do |package, evaluator|
# NOTE: Enable global write through when writing new VCR cassetes.
# ensure the backend knows the project
if CONFIG['global_write_through']
full_path = "/source/#{package.project.name}/#{package.name}/#{evaluator.changes_file_name}"
Backend::Connection.put(Addressable::URI.escape(full_path), evaluator.changes_file_content)
Expand All @@ -106,9 +100,6 @@
end

after(:create) do |package, evaluator|
# NOTE: Enable global write through when writing new VCR cassetes.
# ensure the backend knows the project

flavor_xml = evaluator.flavors.map { |flavor| "<flavor>#{flavor}</flavor>" }.join
flavor_xml = "<multibuild>#{flavor_xml}</multibuild>"
if CONFIG['global_write_through']
Expand All @@ -127,8 +118,6 @@

file_content = "<link package=\"#{target_package}\" project=\"#{target_package.project}\" />"

# NOTE: Enable global write through when writing new VCR cassetes.
# ensure the backend knows the project
if CONFIG['global_write_through']
Backend::Connection.put(
"/source/#{CGI.escape(package.project.name)}/#{CGI.escape(package.name)}/_link", file_content
Expand All @@ -147,8 +136,6 @@
PackageKind.create(package_id: package.id, kind: 'link')
file_content = "<link package=\"#{evaluator.remote_package_name}\" project=\"#{remote_project.name}\" />"

# NOTE: Enable global write through when writing new VCR cassetes.
# ensure the backend knows the project
if CONFIG['global_write_through']
Backend::Connection.put(
"/source/#{CGI.escape(package.project.name)}/#{CGI.escape(package.name)}/_link", file_content
Expand Down Expand Up @@ -187,8 +174,6 @@

factory :package_with_service do
after(:create) do |package|
# NOTE: Enable global write through when writing new VCR cassetes.
# ensure the backend knows the project
if CONFIG['global_write_through']
Backend::Connection.put(Addressable::URI.escape("/source/#{package.project.name}/#{package.name}/_service"),
File.read('spec/fixtures/files/download_url_service.xml'))
Expand All @@ -198,8 +183,6 @@

factory :package_with_broken_service do
after(:create) do |package|
# NOTE: Enable global write through when writing new VCR cassetes.
# ensure the backend knows the project
if CONFIG['global_write_through']
Backend::Connection.put(Addressable::URI.escape("/source/#{package.project.name}/#{package.name}/_service"),
'<service>broken</service>')
Expand Down Expand Up @@ -227,8 +210,6 @@
end

after(:create) do |package, evaluator|
# NOTE: Enable global write through when writing new VCR cassetes.
# ensure the backend knows the project
if CONFIG['global_write_through']
full_path = "/source/#{package.project.name}/#{package.name}/#{evaluator.kiwi_file_name}"
Backend::Connection.put(Addressable::URI.escape(full_path), evaluator.kiwi_file_content)
Expand Down
4 changes: 0 additions & 4 deletions src/api/spec/jobs/issue_tracker_write_to_backend_job_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# WARNING: Some tests require real backend answers, so make sure you uncomment
# this line and start a test backend.
# CONFIG['global_write_through'] = true

RSpec.describe IssueTrackerWriteToBackendJob, :vcr do
include ActiveJob::TestHelper

Expand Down
4 changes: 0 additions & 4 deletions src/api/spec/jobs/update_backend_infos_job_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# WARNING: Some tests require real backend answers, so make sure you uncomment
# this line and start a test backend.
# CONFIG['global_write_through'] = true

RSpec.describe UpdateBackendInfosJob, :vcr do
let(:project) { create(:project, name: 'apache') }
let(:package) { create(:package, name: 'mod_ssl', project: project) }
Expand Down
4 changes: 0 additions & 4 deletions src/api/spec/models/kiwi/image_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
require 'webmock/rspec'

# WARNING: Some tests require real backend answers, so make sure you uncomment
# this line and start a test backend.
# CONFIG['global_write_through'] = true

RSpec.describe Kiwi::Image, :vcr do
include_context 'a kiwi image xml'
include_context 'an invalid kiwi image xml'
Expand Down

0 comments on commit 1d9c198

Please sign in to comment.