Hello community, here is the log from the commit of package yast2-journal for openSUSE:Factory checked in at 2015-08-05 19:14:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-journal (Old) and /work/SRC/openSUSE:Factory/.yast2-journal.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-journal" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-journal/yast2-journal.changes 2015-07-08 06:59:13.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-journal.new/yast2-journal.changes 2015-08-05 19:14:12.000000000 +0200 @@ -1,0 +2,8 @@ +Fri Jul 31 13:18:29 UTC 2015 - [email protected] + +- Synced version numbering with the rest of YaST modules (last + step for fate#318486). +- Enhancements in automated tests and code quality. +- 3.1.1 + +------------------------------------------------------------------- Old: ---- yast2-journal-0.2.3.tar.bz2 New: ---- yast2-journal-3.1.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-journal.spec ++++++ --- /var/tmp/diff_new_pack.89WpMe/_old 2015-08-05 19:14:13.000000000 +0200 +++ /var/tmp/diff_new_pack.89WpMe/_new 2015-08-05 19:14:13.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-journal -Version: 0.2.3 +Version: 3.1.1 Release: 0 BuildArch: noarch @@ -38,6 +38,8 @@ BuildRequires: rubygem(yast-rake) # for tests BuildRequires: rubygem(rspec) +# First version with Yast::UI.OpenUI and libyui-terminal +BuildRequires: libyui-ncurses >= 2.47.1 Url: https://github.com/ancorgs/yast-journal Summary: YaST2 - Reading of systemd journal @@ -52,7 +54,8 @@ %setup -n %{name}-%{version} %check -rake test:unit +# Enable UI tests in headless systems like Jenkins +libyui-terminal rake test:unit %install rake install DESTDIR="%{buildroot}" ++++++ yast2-journal-0.2.3.tar.bz2 -> yast2-journal-3.1.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-journal-0.2.3/.rubocop.yml new/yast2-journal-3.1.1/.rubocop.yml --- old/yast2-journal-0.2.3/.rubocop.yml 2015-06-29 17:52:26.000000000 +0200 +++ new/yast2-journal-3.1.1/.rubocop.yml 2015-07-31 15:42:27.000000000 +0200 @@ -10,6 +10,10 @@ Metrics/AbcSize: Max: 20 +# We have agreed that 90 is still fine (it fits github view) +Metrics/LineLength: + Max: 90 + # journalctl output is UTF-8, so are the comments explaning it Style/AsciiComments: Enabled: false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-journal-0.2.3/.travis.yml new/yast2-journal-3.1.1/.travis.yml --- old/yast2-journal-0.2.3/.travis.yml 2015-06-29 17:52:26.000000000 +0200 +++ new/yast2-journal-3.1.1/.travis.yml 2015-07-31 15:42:27.000000000 +0200 @@ -3,7 +3,7 @@ # disable rvm, use system Ruby - rvm reset - wget https://raw.githubusercontent.com/yast/yast-devtools/master/travis-tools/travis_setup.sh -- sh ./travis_setup.sh -p "yast2-devtools yast2 rake" -g "rspec:2.14.1 yast-rake gettext simplecov coveralls rubocop:0.29.1" +- sh ./travis_setup.sh -p "yast2-devtools yast2 rake" -g "rspec:3.3.0 yast-rake gettext simplecov coveralls rubocop:0.29.1" script: - rake check:pot - rubocop diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-journal-0.2.3/README.md new/yast2-journal-3.1.1/README.md --- old/yast2-journal-0.2.3/README.md 2015-06-29 17:52:26.000000000 +0200 +++ new/yast2-journal-3.1.1/README.md 2015-07-31 15:42:27.000000000 +0200 @@ -2,7 +2,7 @@ =========================== [](https://travis-ci.org/yast/yast-journal) -[](https://coveralls.io/r/yast/yast-journal?branch=master) +[](https://coveralls.io/github/yast/yast-journal?branch=master) [](https://codeclimate.com/github/yast/yast-journal) A module for [YaST](http://yast.github.io) to read the systemd journal in a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-journal-0.2.3/package/yast2-journal.changes new/yast2-journal-3.1.1/package/yast2-journal.changes --- old/yast2-journal-0.2.3/package/yast2-journal.changes 2015-06-29 17:52:26.000000000 +0200 +++ new/yast2-journal-3.1.1/package/yast2-journal.changes 2015-07-31 15:42:27.000000000 +0200 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Fri Jul 31 13:18:29 UTC 2015 - [email protected] + +- Synced version numbering with the rest of YaST modules (last + step for fate#318486). +- Enhancements in automated tests and code quality. +- 3.1.1 + +------------------------------------------------------------------- Mon Jun 29 14:16:12 UTC 2015 - [email protected] - Honor internationalization settings when displaying dates diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-journal-0.2.3/package/yast2-journal.spec new/yast2-journal-3.1.1/package/yast2-journal.spec --- old/yast2-journal-0.2.3/package/yast2-journal.spec 2015-07-01 09:32:36.000000000 +0200 +++ new/yast2-journal-3.1.1/package/yast2-journal.spec 2015-07-31 15:42:27.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-journal -Version: 0.2.3 +Version: 3.1.1 Release: 0 BuildArch: noarch @@ -38,6 +38,8 @@ BuildRequires: rubygem(yast-rake) # for tests BuildRequires: rubygem(rspec) +# First version with Yast::UI.OpenUI and libyui-terminal +BuildRequires: libyui-ncurses >= 2.47.1 Group: System/YaST License: GPL-2.0 or GPL-3.0 @@ -52,7 +54,8 @@ %setup -n %{name}-%{version} %check -rake test:unit +# Enable UI tests in headless systems like Jenkins +libyui-terminal rake test:unit %install rake install DESTDIR="%{buildroot}" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-journal-0.2.3/src/lib/systemd_journal/query_dialog.rb new/yast2-journal-3.1.1/src/lib/systemd_journal/query_dialog.rb --- old/yast2-journal-0.2.3/src/lib/systemd_journal/query_dialog.rb 2015-07-01 09:32:36.000000000 +0200 +++ new/yast2-journal-3.1.1/src/lib/systemd_journal/query_dialog.rb 2015-07-31 15:42:27.000000000 +0200 @@ -73,22 +73,27 @@ finish_dialog(query_from_widgets) end - # Event callbacks for changes in the interval time widgets - [:until_date, :until_time, :since_date, :since_time].each do |widget| - define_method(:"#{widget}_handler") do - # Automatically select the dates-based interval - Yast::UI.ChangeWidget(Id(:interval), :CurrentButton, "Hash") + # Registers the callbacks for changes in the UI + def self.define_event_callbacks + # Event callbacks for changes in the interval time widgets + [:until_date, :until_time, :since_date, :since_time].each do |widget| + define_method(:"#{widget}_handler") do + # Automatically select the dates-based interval + Yast::UI.ChangeWidget(Id(:interval), :CurrentButton, "Hash") + end end - end - # Event callbacks for changes in the filter fields - QueryPresenter.filters.each do |filter| - define_method(:"#{filter[:name]}_value_handler") do - # Automatically check the corresponding checkbox - Yast::UI.ChangeWidget(Id(filter[:name]), :Value, true) + # Event callbacks for changes in the filter fields + QueryPresenter.filters.each do |filter| + define_method(:"#{filter[:name]}_value_handler") do + # Automatically check the corresponding checkbox + Yast::UI.ChangeWidget(Id(filter[:name]), :Value, true) + end end end + define_event_callbacks + private # Translates the value of the widgets to a new QueryPresenter object @@ -122,16 +127,35 @@ # Array of radio buttons to select the interval def interval_buttons QueryPresenter.intervals.map do |int| - if int[:value] == Hash - selected = @query.interval.is_a?(Hash) - additional_widgets = [HSpacing(1)] + dates_widgets - else - selected = int[:value] == @query.interval - additional_widgets = [] - end - button = RadioButton(Id(int[:value].to_s), int[:label], selected) + Left( + HBox( + interval_button(int), + *interval_additional_widgets(int) + ) + ) + end + end + + # Radio button to select a given interval + # + # @param int [Hash] interval as returned by QueryPresenter.intervals + def interval_button(int) + if int[:value] == Hash + selected = @query.interval.is_a?(Hash) + else + selected = int[:value] == @query.interval + end + RadioButton(Id(int[:value].to_s), int[:label], selected) + end - Left(HBox(button, *additional_widgets)) + # Additional widgets to display after the radio button for a given interval + # + # @param int [Hash] interval as returned by QueryPresenter.intervals + def interval_additional_widgets(int) + if int[:value] == Hash + [HSpacing(1)] + dates_widgets + else + [] end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-journal-0.2.3/test/entry_presenter_test.rb new/yast2-journal-3.1.1/test/entry_presenter_test.rb --- old/yast2-journal-0.2.3/test/entry_presenter_test.rb 2015-06-29 17:52:26.000000000 +0200 +++ new/yast2-journal-3.1.1/test/entry_presenter_test.rb 2015-07-31 15:42:27.000000000 +0200 @@ -1,4 +1,4 @@ -#! rspec +#! /usr/bin/rspec # Copyright (c) 2014 SUSE LLC. # All Rights Reserved. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-journal-0.2.3/test/entry_test.rb new/yast2-journal-3.1.1/test/entry_test.rb --- old/yast2-journal-0.2.3/test/entry_test.rb 2015-06-29 17:52:26.000000000 +0200 +++ new/yast2-journal-3.1.1/test/entry_test.rb 2015-07-31 15:42:27.000000000 +0200 @@ -1,4 +1,4 @@ -#! rspec +#! /usr/bin/rspec # Copyright (c) 2014 SUSE LLC. # All Rights Reserved. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-journal-0.2.3/test/journalctl_test.rb new/yast2-journal-3.1.1/test/journalctl_test.rb --- old/yast2-journal-0.2.3/test/journalctl_test.rb 2015-06-29 17:52:26.000000000 +0200 +++ new/yast2-journal-3.1.1/test/journalctl_test.rb 2015-07-31 15:42:27.000000000 +0200 @@ -1,4 +1,4 @@ -#! rspec +#! /usr/bin/rspec # Copyright (c) 2014 SUSE LLC. # All Rights Reserved. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-journal-0.2.3/test/query_dialog_test.rb new/yast2-journal-3.1.1/test/query_dialog_test.rb --- old/yast2-journal-0.2.3/test/query_dialog_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-journal-3.1.1/test/query_dialog_test.rb 2015-07-31 15:42:27.000000000 +0200 @@ -0,0 +1,113 @@ +#! /usr/bin/rspec +# Copyright (c) 2014 SUSE LLC. +# All Rights Reserved. + +# This program is free software; you can redistribute it and/or +# modify it under the terms of version 2 or 3 of the GNU General +# Public License as published by the Free Software Foundation. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, contact SUSE LLC. + +# To contact Novell about this file by physical or electronic mail, +# you may find current contact information at www.suse.com + +require_relative "spec_helper" +require "systemd_journal/query_dialog" + +if !ENV["TRAVIS"] + describe SystemdJournal::QueryDialog do + def property(id, property) + Yast::UI.QueryWidget(Id(id), property) + end + + # Sends a user input to libyui, optionally running some code before. + # + # @param value [Symbol/String] the input expected by UI.UserInput + # @param pre_hook [Proc] code used to tie the expectations or any other + # action to input events. For example, checking the final status of the + # dialog before closing it. The effect of an input can be checked on the + # pre_hook of the next one to make sure libyui has already applied all the + # changes. + def send_user_input(value, pre_hook: nil) + expect(Yast::UI).to receive(:UserInput) do + pre_hook.call if pre_hook + value + end + end + + before(:all) do + Yast.ui_component = "ncurses" + end + + before(:each) do + Yast::UI.OpenUI + + # The QueryPresenter needs to check the number of previous boots + allow_to_execute(/journalctl --list-boots/) + .and_return(cmd_result_for("list-boots-11")) + + # Ensure initial status of the dialog: + # all filter checkboxes unchecked... + Yast::UI.ChangeWidget(Id("unit"), :Value, false) + Yast::UI.ChangeWidget(Id("match"), :Value, false) + Yast::UI.ChangeWidget(Id("priority"), :Value, false) + # ...and interval set to 'since system's boot' + Yast::UI.ChangeWidget(Id(:interval), :CurrentButton, "0") + end + + after(:each) do + Yast::UI.CloseUI + end + + subject(:dialog) do + query_presenter = SystemdJournal::QueryPresenter.new + SystemdJournal::QueryDialog.new(query_presenter) + end + + describe "#match_value_handler" do + it "automatically checks the 'match' checkbox when value changes" do + send_user_input :match_value + send_user_input :ok, + pre_hook: -> { expect(property("match", :Value)).to eq true } + + dialog.run + end + end + + describe "#unit_value_handler" do + it "automatically checks the 'unit' checkbox when value changes" do + send_user_input :unit_value + send_user_input :ok, + pre_hook: -> { expect(property("unit", :Value)).to eq true } + + dialog.run + end + end + + describe "#until_date_handler" do + it "automatically checks the dates checkbox when 'until date' changes" do + send_user_input :until_date + send_user_input :ok, + pre_hook: -> { expect(property(:interval, :CurrentButton)).to eq "Hash" } + + dialog.run + end + end + + describe "#since_time_handler" do + it "automatically checks the dates checkbox when 'since time' changes" do + send_user_input :since_time + send_user_input :ok, + pre_hook: -> { expect(property(:interval, :CurrentButton)).to eq "Hash" } + + dialog.run + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-journal-0.2.3/test/query_presenter_test.rb new/yast2-journal-3.1.1/test/query_presenter_test.rb --- old/yast2-journal-0.2.3/test/query_presenter_test.rb 2015-06-29 17:52:26.000000000 +0200 +++ new/yast2-journal-3.1.1/test/query_presenter_test.rb 2015-07-31 15:42:27.000000000 +0200 @@ -1,4 +1,4 @@ -#! rspec +#! /usr/bin/rspec # Copyright (c) 2014 SUSE LLC. # All Rights Reserved. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-journal-0.2.3/test/query_test.rb new/yast2-journal-3.1.1/test/query_test.rb --- old/yast2-journal-0.2.3/test/query_test.rb 2015-06-29 17:52:26.000000000 +0200 +++ new/yast2-journal-3.1.1/test/query_test.rb 2015-07-31 15:42:27.000000000 +0200 @@ -1,4 +1,4 @@ -#! rspec +#! /usr/bin/rspec # Copyright (c) 2014 SUSE LLC. # All Rights Reserved. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-journal-0.2.3/test/spec_helper.rb new/yast2-journal-3.1.1/test/spec_helper.rb --- old/yast2-journal-0.2.3/test/spec_helper.rb 2015-06-29 17:52:26.000000000 +0200 +++ new/yast2-journal-3.1.1/test/spec_helper.rb 2015-07-31 15:42:27.000000000 +0200 @@ -26,7 +26,9 @@ if ENV["COVERAGE"] require "simplecov" - SimpleCov.start + SimpleCov.start do + add_filter "/test/" + end # for coverage we need to load all ruby files Dir["#{SRC_PATH}/lib/**/*.rb"].each { |f| require_relative f }
