Skip to content

Commit b64e565

Browse files
authored
Merge pull request #221 from yast/drop-yast2-journal-dependency
Drop yast2 journal dependency
2 parents 6bd8847 + 9548906 commit b64e565

4 files changed

Lines changed: 47 additions & 24 deletions

File tree

package/yast2-services-manager.changes

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
-------------------------------------------------------------------
2+
Thu Apr 9 13:49:00 UTC 2026 - Ladislav Slezák <lslezak@suse.com>
3+
4+
- Drop the yast2-journal build dependency in SLES, this allows also
5+
dropping libyui from SLES (related to bsc#1254978)
6+
- 5.0.3
7+
18
-------------------------------------------------------------------
29
Tue Mar 10 09:00:28 UTC 2026 - Michal Filka <mfilka@suse.com>
310

@@ -379,7 +386,6 @@ Wed Dec 17 12:18:46 CET 2014 - schubi@suse.de
379386
- 3.1.38
380387

381388
-------------------------------------------------------------------
382-
383389
Thu Dec 4 09:51:33 UTC 2014 - jreidinger@suse.com
384390

385391
- remove X-KDE-Library from desktop file (bnc#899104)

package/yast2-services-manager.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@ BuildRequires: ruby
3737
# 'target' argument for Installation::AutoClient#export method
3838
BuildRequires: yast2 >= 4.3.10
3939
BuildRequires: yast2-ruby-bindings >= 1.2.0
40-
# To show service logs
40+
41+
# only in openSUSE Tumbleweed or Leap, not in SLES
42+
%if 0%{?suse_version} == 1699 || 0%{?is_opensuse}
43+
# needed just to run an unit test
4144
BuildRequires: yast2-journal >= 4.1.1
45+
%endif
46+
4247
# Support for 'data' directory in rake install task
4348
BuildRequires: rubygem(%{rb_default_ruby_abi}:yast-rake) >= 0.1.7
4449
BuildRequires: rubygem(%{rb_default_ruby_abi}:rspec)

test/clients/services_manager_test.rb

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
require_relative '../test_helper'
2424

2525
require "yast"
26-
require "y2journal"
26+
begin
27+
require "y2journal"
28+
rescue LoadError
29+
puts "yast2-journal not installed, skipping journal tests"
30+
end
2731
require "services-manager/clients/services_manager"
2832

2933
describe Y2ServicesManager::Clients::ServicesManager do
@@ -42,16 +46,18 @@
4246
subject.run
4347
end
4448

45-
context "when yast2-journal is installed" do
46-
before do
47-
allow(subject).to receive(:journal_loaded?).and_return(true)
48-
end
49+
if defined?(::Y2Journal)
50+
context "when yast2-journal is installed" do
51+
before do
52+
allow(subject).to receive(:journal_loaded?).and_return(true)
53+
end
4954

50-
it "runs the dialog with a button to show the logs" do
51-
expect(Y2ServicesManager::Dialogs::ServicesManager).to receive(:new)
52-
.with(hash_including(show_logs_button: true)).and_return(dialog)
55+
it "runs the dialog with a button to show the logs" do
56+
expect(Y2ServicesManager::Dialogs::ServicesManager).to receive(:new)
57+
.with(hash_including(show_logs_button: true)).and_return(dialog)
5358

54-
subject.run
59+
subject.run
60+
end
5561
end
5662
end
5763

test/dialogs/services_manager_test.rb

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
require_relative '../test_helper'
2424

2525
require "yast"
26-
require "y2journal"
26+
begin
27+
require "y2journal"
28+
rescue LoadError
29+
puts "yast2-journal not installed, skipping journal tests"
30+
end
2731
require "services-manager/dialogs/services_manager"
2832

2933
describe Y2ServicesManager::Dialogs::ServicesManager do
@@ -331,24 +335,26 @@ def expect_refresh_buttons(&block)
331335
include_examples "save with errors"
332336
end
333337

334-
context "when user selects 'Show Log' button" do
335-
let(:user_input) { [:logs_button, :cancel] }
338+
if defined?(::Y2Journal)
339+
context "when user selects 'Show Log' button" do
340+
let(:user_input) { [:logs_button, :cancel] }
336341

337-
let(:entries_dialog) { instance_double(Y2Journal::EntriesDialog, run: nil) }
342+
let(:entries_dialog) { instance_double(Y2Journal::EntriesDialog, run: nil) }
338343

339-
let(:services_specs) { [sshd_specs2, postfix_specs] }
344+
let(:services_specs) { [sshd_specs2, postfix_specs] }
340345

341-
let(:sshd_specs2) { sshd_specs.merge(keywords: keywords) }
346+
let(:sshd_specs2) { sshd_specs.merge(keywords: keywords) }
342347

343-
let(:keywords) { ["sshd.service", "sshd.socket"] }
348+
let(:keywords) { ["sshd.service", "sshd.socket"] }
344349

345-
it "shows the systemd journal entries for the selected service" do
346-
expect(Y2Journal::EntriesDialog).to receive(:new) do |params|
347-
filters = params[:query].filters["unit"]
348-
expect(filters).to contain_exactly(*keywords)
349-
end.and_return(entries_dialog)
350+
it "shows the systemd journal entries for the selected service" do
351+
expect(Y2Journal::EntriesDialog).to receive(:new) do |params|
352+
filters = params[:query].filters["unit"]
353+
expect(filters).to contain_exactly(*keywords)
354+
end.and_return(entries_dialog)
350355

351-
subject.run
356+
subject.run
357+
end
352358
end
353359
end
354360

0 commit comments

Comments
 (0)