Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2-add-on for openSUSE:Factory 
checked in at 2022-01-25 17:35:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-add-on (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-add-on.new.1938 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-add-on"

Tue Jan 25 17:35:48 2022 rev:118 rq:947779 version:4.4.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-add-on/yast2-add-on.changes        
2021-12-03 20:35:45.532144113 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-add-on.new.1938/yast2-add-on.changes      
2022-01-25 17:36:39.522091115 +0100
@@ -1,0 +2,14 @@
+Thu Jan 20 16:40:26 UTC 2022 - David Diaz <dgonza...@suse.com>
+
+- Restore the repo unexpanded URL to get it properly saved in
+  the /etc/zypp/repos.d file (bsc#972046, bsc#1194851).
+- 4.4.7
+
+-------------------------------------------------------------------
+Thu Jan 20 16:11:51 UTC 2022 - Ladislav Slez??k <lsle...@suse.cz>
+
+- Enable RSpec verifying doubles in unit tests to ensure that
+  the mocked methods really exist (bsc#1194784)
+- 4.4.6
+
+-------------------------------------------------------------------

Old:
----
  yast2-add-on-4.4.5.tar.bz2

New:
----
  yast2-add-on-4.4.7.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-add-on.spec ++++++
--- /var/tmp/diff_new_pack.N7bEeh/_old  2022-01-25 17:36:41.090080316 +0100
+++ /var/tmp/diff_new_pack.N7bEeh/_new  2022-01-25 17:36:41.094080288 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package yast2-add-on
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-add-on
-Version:        4.4.5
+Version:        4.4.7
 Release:        0
 Summary:        YaST2 - Add-On media installation code
 License:        GPL-2.0-only

++++++ yast2-add-on-4.4.5.tar.bz2 -> yast2-add-on-4.4.7.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.4.5/.github/workflows/ci.yml 
new/yast2-add-on-4.4.7/.github/workflows/ci.yml
--- old/yast2-add-on-4.4.5/.github/workflows/ci.yml     2021-12-02 
22:40:59.000000000 +0100
+++ new/yast2-add-on-4.4.7/.github/workflows/ci.yml     2022-01-20 
21:54:51.000000000 +0100
@@ -8,8 +8,14 @@
 jobs:
   Tests:
     runs-on: ubuntu-latest
+
+    strategy:
+      fail-fast: false
+      matrix:
+        distro:  [ "tumbleweed", "leap_latest" ]
+
     container:
-      image: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+      image: 
registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby
 
     steps:
 
@@ -28,14 +34,22 @@
 
     # send the coverage report to coveralls.io
     - name: Coveralls Report
+      # send it only from the TW build to avoid duplicate submits
+      if: ${{ matrix.distro == 'tumbleweed' }}
       uses: coverallsapp/github-action@master
       with:
         github-token: ${{ secrets.GITHUB_TOKEN }}
 
   Rubocop:
     runs-on: ubuntu-latest
+
+    strategy:
+      fail-fast: false
+      matrix:
+        distro: [ "leap_latest" ]
+
     container:
-      image: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+      image: 
registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby
 
     steps:
 
@@ -47,8 +61,14 @@
 
   Package:
     runs-on: ubuntu-latest
+
+    strategy:
+      fail-fast: false
+      matrix:
+        distro:  [ "tumbleweed", "leap_latest" ]
+
     container:
-      image: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+      image: 
registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby
 
     steps:
 
@@ -60,8 +80,14 @@
 
   Yardoc:
     runs-on: ubuntu-latest
+
+    strategy:
+      fail-fast: false
+      matrix:
+        distro: [ "leap_latest" ]
+
     container:
-      image: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+      image: 
registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby
 
     steps:
 
@@ -75,8 +101,14 @@
   # checks into one job avoids that overhead
   Checks:
     runs-on: ubuntu-latest
+
+    strategy:
+      fail-fast: false
+      matrix:
+        distro: [ "leap_latest" ]
+
     container:
-      image: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+      image: 
registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby
 
     steps:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.4.5/.rubocop.yml 
new/yast2-add-on-4.4.7/.rubocop.yml
--- old/yast2-add-on-4.4.5/.rubocop.yml 2021-12-02 22:40:59.000000000 +0100
+++ new/yast2-add-on-4.4.7/.rubocop.yml 2022-01-20 21:54:51.000000000 +0100
@@ -30,6 +30,8 @@
 # ExcludedMethods: refine
 Metrics/BlockLength:
   Max: 350
+  Exclude:
+  - test/**/*
 
 # Offense count: 5
 # Configuration parameters: CountBlocks.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.4.5/package/yast2-add-on.changes 
new/yast2-add-on-4.4.7/package/yast2-add-on.changes
--- old/yast2-add-on-4.4.5/package/yast2-add-on.changes 2021-12-02 
22:40:59.000000000 +0100
+++ new/yast2-add-on-4.4.7/package/yast2-add-on.changes 2022-01-20 
21:54:51.000000000 +0100
@@ -1,4 +1,18 @@
 -------------------------------------------------------------------
+Thu Jan 20 16:40:26 UTC 2022 - David Diaz <dgonza...@suse.com>
+
+- Restore the repo unexpanded URL to get it properly saved in
+  the /etc/zypp/repos.d file (bsc#972046, bsc#1194851).
+- 4.4.7
+
+-------------------------------------------------------------------
+Thu Jan 20 16:11:51 UTC 2022 - Ladislav Slez??k <lsle...@suse.cz>
+
+- Enable RSpec verifying doubles in unit tests to ensure that
+  the mocked methods really exist (bsc#1194784)
+- 4.4.6
+
+-------------------------------------------------------------------
 Thu Dec  2 17:06:27 UTC 2021 - Ladislav Slez??k <lsle...@suse.cz>
 
 - Drop support for subscription-tools, that package is not present
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.4.5/package/yast2-add-on.spec 
new/yast2-add-on-4.4.7/package/yast2-add-on.spec
--- old/yast2-add-on-4.4.5/package/yast2-add-on.spec    2021-12-02 
22:40:59.000000000 +0100
+++ new/yast2-add-on-4.4.7/package/yast2-add-on.spec    2022-01-20 
21:54:51.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-add-on
-Version:        4.4.5
+Version:        4.4.7
 Release:        0
 Summary:        YaST2 - Add-On media installation code
 License:        GPL-2.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-add-on-4.4.5/src/lib/add-on/clients/add-on_auto.rb 
new/yast2-add-on-4.4.7/src/lib/add-on/clients/add-on_auto.rb
--- old/yast2-add-on-4.4.5/src/lib/add-on/clients/add-on_auto.rb        
2021-12-02 22:40:59.000000000 +0100
+++ new/yast2-add-on-4.4.7/src/lib/add-on/clients/add-on_auto.rb        
2022-01-20 21:54:51.000000000 +0100
@@ -31,11 +31,14 @@
 
 module Yast
   class AddOnAutoClient < ::Installation::AutoClient
+    def initialize
+      Yast.include self, "add-on/add-on-workflow.rb"
+      super
+    end
+
     def run
       textdomain "add-on"
 
-      Yast.include self, "add-on/add-on-workflow.rb"
-
       progress_orig = Progress.set(false)
       ret = super
       Progress.set(progress_orig)
@@ -242,6 +245,10 @@
           adjust_source_attributes(add_on, source_id)
           install_product(product)
 
+          # Restore the unexpanded URL to have the original URL
+          # in the saved /etc/zypp/repos.d file (bsc#972046, bsc#1194851).
+          Pkg.SourceChangeUrl(source_id, media_url)
+
           return :continue
         end
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.4.5/test/add-on-workflow_test.rb 
new/yast2-add-on-4.4.7/test/add-on-workflow_test.rb
--- old/yast2-add-on-4.4.5/test/add-on-workflow_test.rb 2021-12-02 
22:40:59.000000000 +0100
+++ new/yast2-add-on-4.4.7/test/add-on-workflow_test.rb 2022-01-20 
21:54:51.000000000 +0100
@@ -4,16 +4,19 @@
 
 require_relative "../src/include/add-on/add-on-workflow.rb"
 
-# just a dummy class for including the tested methods
-class AddOnAddOnWorkflowIncludeTest
-  include Yast::AddOnAddOnWorkflowInclude
-end
-
 Yast.import "AddOnProduct"
 Yast.import "SourceDialogs"
 
 describe Yast::AddOnAddOnWorkflowInclude do
-  subject { AddOnAddOnWorkflowIncludeTest.new }
+  subject do
+    # anonymous class for testing the include
+    klass = Class.new do
+      include Yast::AddOnAddOnWorkflowInclude
+      def TypeDialogOpts(_arg1, _arg2); end
+    end
+
+    klass.new
+  end
 
   describe ".media_type_selection" do
     context "Full medium installation with no add-ons yet" do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.4.5/test/test_helper.rb 
new/yast2-add-on-4.4.7/test/test_helper.rb
--- old/yast2-add-on-4.4.5/test/test_helper.rb  2021-12-02 22:40:59.000000000 
+0100
+++ new/yast2-add-on-4.4.7/test/test_helper.rb  2022-01-20 21:54:51.000000000 
+0100
@@ -7,18 +7,16 @@
 ENV["LC_ALL"] = "en_US.UTF-8"
 
 require "yast"
+require "yast/rspec"
 
-# Stub a module to prevent its importation
-#
-# Useful for modules from different YaST packages, to avoid build dependencies
-def stub_module(name)
-  Yast.const_set(name.to_sym, Class.new { def self.fake_method; end })
+# configure RSpec
+RSpec.configure do |config|
+  config.mock_with :rspec do |c|
+    # 
https://relishapp.com/rspec/rspec-mocks/v/3-0/docs/verifying-doubles/partial-doubles
+    c.verify_partial_doubles = true
+  end
 end
 
-# Stub classes from other modules to speed up a build
-stub_module("AutoinstGeneral")
-stub_module("AutoinstSoftware")
-
 if ENV["COVERAGE"]
   require "simplecov"
   SimpleCov.start do
@@ -45,3 +43,7 @@
     ]
   end
 end
+
+# mock missing YaST modules
+Yast::RSpec::Helpers.define_yast_module("AutoinstSoftware", methods: [:pmInit])
+Yast::RSpec::Helpers.define_yast_module("AutoinstGeneral")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-add-on-4.4.5/test/y2add_on/clients/add-on_auto_test.rb 
new/yast2-add-on-4.4.7/test/y2add_on/clients/add-on_auto_test.rb
--- old/yast2-add-on-4.4.5/test/y2add_on/clients/add-on_auto_test.rb    
2021-12-02 22:40:59.000000000 +0100
+++ new/yast2-add-on-4.4.7/test/y2add_on/clients/add-on_auto_test.rb    
2022-01-20 21:54:51.000000000 +0100
@@ -313,12 +313,14 @@
 
     context "when there are add-ons products" do
       let(:ask_on_error) { true }
+      let(:unexpanded_url) { "RELURL://product-$releasever.url" }
+      let(:expanded_url) { "RELURL://product-15.0.url" }
       let(:add_on_products) do
         [
           {
             "alias"        => "produc_alias",
             "ask_on_error" => ask_on_error,
-            "media_url"    => "RELURL://product.url",
+            "media_url"    => unexpanded_url,
             "priority"     => 20,
             "product_dir"  => "/"
           }
@@ -349,34 +351,87 @@
       end
 
       before do
-        allow(Yast::AddOnProduct).to 
receive(:add_on_products).and_return(add_on_products)
         allow(Yast::Pkg).to receive(:SourceEditSet)
         allow(Yast::Pkg).to receive(:SourceReleaseAll)
         allow(Yast::Pkg).to receive(:SourceCreate).and_return(1)
         allow(Yast::Pkg).to receive(:SourceEditGet).and_return(repos)
         allow(Yast::Pkg).to receive(:ExpandedUrl)
-        # To test indirectly the "preferred_name_for" method
+        # For testing #preferred_name_for" indirectly
         allow(Yast::Pkg).to receive(:RepositoryScan)
           .with(anything)
           .and_return([["Updated repo", "/"]])
+
+        allow(Yast::AddOnProduct).to 
receive(:add_on_products).and_return(add_on_products)
+
+        # For testing regresion with $releasever (bsc#1194851)
+        allow(Yast::AddOnProduct).to 
receive(:SetRepoUrlAlias).and_return(expanded_url)
+      end
+
+      it "stores repos according to information given" do
+        expect(Yast::Pkg).to receive(:SourceEditSet).with(repos_to_store)
+
+        client.write
+      end
+
+      it "releases the media accessors" do
+        expect(Yast::Pkg).to receive(:SourceReleaseAll)
+
+        client.write
+      end
+
+      # For testing regresion with $releasever (bsc#1194851)
+      it "restores the unexpanded URL" do
+        expect(Yast::Pkg).to receive(:SourceChangeUrl).with(1, unexpanded_url)
+
+        client.write
       end
 
       context "and product creation fails" do
         before do
+          allow(Yast::Report).to receive(:Error)
           allow(Yast::Pkg).to receive(:SourceCreate).and_return(-1)
+          allow(Yast::Popup).to 
receive(:ContinueCancel).and_return(retry_on_error, false)
         end
 
+        let(:retry_on_error) { true }
+
         context "ask_on_error=true" do
-          let(:ask_on_error) { true }
+          it "ask the user to make it available" do
+            expect(Yast::Popup).to receive(:ContinueCancel)
 
-          it "ask to make it available" do
-            expect(Yast::Popup).to receive(:ContinueCancel).and_return false
+            client.write
+          end
 
-            # We are returning false on the ContinueCancel mock, so we decide 
to
-            # stop retrying and the error is finally displayed
-            allow(Yast::Report).to receive(:Error)
+          context "and user wants to retry" do
+            let(:retry_on_error) { true }
 
-            client.write
+            it "tries it again" do
+              expect(Yast::Pkg).to receive(:SourceCreate).with(expanded_url, 
"/").twice
+
+              client.write
+            end
+
+            it "does not reports an error while retrying" do
+              expect(Yast::Report).to receive(:Error).exactly(1).times
+
+              client.write
+            end
+          end
+
+          context "and user decides not retrying" do
+            let(:retry_on_error) { false }
+
+            it "does not try it again" do
+              expect(Yast::Pkg).to receive(:SourceCreate).once
+
+              client.write
+            end
+
+            it "reports an error" do
+              expect(Yast::Report).to receive(:Error)
+
+              client.write
+            end
           end
         end
 
@@ -385,6 +440,8 @@
 
           it "does not ask to make it available" do
             expect(Yast::Popup).to_not receive(:ContinueCancel)
+
+            client.write
           end
 
           it "reports the error" do
@@ -394,18 +451,6 @@
           end
         end
       end
-
-      it "stores repos according to information given" do
-        expect(Yast::Pkg).to receive(:SourceEditSet).with(repos_to_store)
-
-        client.write
-      end
-
-      it "releases the media accessors" do
-        expect(Yast::Pkg).to receive(:SourceReleaseAll)
-
-        client.write
-      end
     end
   end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-add-on-4.4.5/test/y2add_on/clients/inst_add-on_test.rb 
new/yast2-add-on-4.4.7/test/y2add_on/clients/inst_add-on_test.rb
--- old/yast2-add-on-4.4.5/test/y2add_on/clients/inst_add-on_test.rb    
2021-12-02 22:40:59.000000000 +0100
+++ new/yast2-add-on-4.4.7/test/y2add_on/clients/inst_add-on_test.rb    
2022-01-20 21:54:51.000000000 +0100
@@ -16,11 +16,11 @@
     before do
       allow(Yast::Linuxrc).to 
receive(:InstallInf).with("addon").and_return(addons)
       allow(subject).to receive(:NetworkSetupForAddons).and_return(:next)
-      allow(subject).to receive(:InstallProduct)
+      allow_any_instance_of(Yast::AddOnAddOnWorkflowInclude).to 
receive(:InstallProduct)
       allow(Yast::AddOnProduct).to 
receive(:skip_add_ons).and_return(skip_add_ons)
       allow(Yast::Installation).to 
receive(:add_on_selected).and_return(add_on_selected)
       allow(Yast::InstURL).to receive(:installInf2Url).and_return(inst_url)
-      allow(subject).to receive(:RunAddOnMainDialog).and_return(:next)
+      allow_any_instance_of(Yast::AddOnAddOnWorkflowInclude).to 
receive(:RunAddOnMainDialog).and_return(:next)
     end
 
     context "when add-on products selection should be skipped" do

Reply via email to