From 163d7b96c00f9c30372c9d3917e678b90a5906c9 Mon Sep 17 00:00:00 2001 From: sidey79 <7968127+sidey79@users.noreply.github.com> Date: Sun, 27 Dec 2020 23:30:08 +0100 Subject: [PATCH 1/5] prove.yml - try to catch error in classic tests (cherry picked from commit 657680e0b8cf71a9a364df4d525e3aded590d337) --- .github/workflows/prove.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/prove.yml b/.github/workflows/prove.yml index 49e3cb40e..e2eceb2ef 100644 --- a/.github/workflows/prove.yml +++ b/.github/workflows/prove.yml @@ -55,9 +55,11 @@ jobs: flags: unittests,fhem,modules name: fhem (testscripts) ${{ matrix.perl }} - name: run make test (classic fhem unittest module) + id: classic_make_test run: | timeout 40 bash -c 'while /usr/bin/pgrep perl >> /dev/null; do sleep 1; echo .; done;' make test PERL_OPTS="-MDevel::Cover" 2>make_error.txt && sudo pkill "^perl" + echo "::set-output name=exitcode::$(echo $?)" cat make_error.txt timeout 40 bash -c 'while /usr/bin/pgrep perl >> /dev/null; do sleep 1; echo .; done;' || sudo pkill "^perl" sleep 3 @@ -73,4 +75,8 @@ jobs: file: ./cover_db/clover.xml flags: unittest name: unittest module ${{ matrix.perl }} + - name: Fail if there was an error during tests + run: exit 1 + if: ${{ steps.classic_make_test.outputs.exitcode != 0 }} + \ No newline at end of file From 7cd2a2d73bdaaa5c0ac2c8fe60920180620aa39b Mon Sep 17 00:00:00 2001 From: sidey79 <7968127+sidey79@users.noreply.github.com> Date: Sun, 27 Dec 2020 23:31:06 +0100 Subject: [PATCH 2/5] 00_SIGNALduino.pm -Wrong version assignment in SIGNALduino_CheckVersionResp fixed and tests corrected --- FHEM/00_SIGNALduino.pm | 8 ++++++-- ...est_02_sub_SIGNALduino_CheckVersionResp-definition.txt | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/FHEM/00_SIGNALduino.pm b/FHEM/00_SIGNALduino.pm index 181a25f1c..116679a49 100644 --- a/FHEM/00_SIGNALduino.pm +++ b/FHEM/00_SIGNALduino.pm @@ -1382,8 +1382,12 @@ sub SIGNALduino_CheckVersionResp { ### ToDo, manchmal kommen Mu Nachrichten in $msg und somit ist keine Version feststellbar !!! if (defined($msg)) { $hash->{logMethod}->($hash, 5, "$name: CheckVersionResp, called with $msg"); - $msg =~ m/($gets{$hash->{ucCmd}->{cmd}}[4])/; - $hash->{version} = $1; + delete $hash->{version}; + if ($msg =~ m/($gets{$hash->{ucCmd}->{cmd}}[4])/ ) { + $hash->{version} = $1; + } else { + delete $hash->{version}; + } } else { $hash->{logMethod}->($hash, 5, "$name: CheckVersionResp, called without msg"); # Aufruf durch Timeout! diff --git a/UnitTest/tests/test_02_sub_SIGNALduino_CheckVersionResp-definition.txt b/UnitTest/tests/test_02_sub_SIGNALduino_CheckVersionResp-definition.txt index 4e9594b1d..d23070670 100644 --- a/UnitTest/tests/test_02_sub_SIGNALduino_CheckVersionResp-definition.txt +++ b/UnitTest/tests/test_02_sub_SIGNALduino_CheckVersionResp-definition.txt @@ -41,9 +41,9 @@ defmod test_02_sub_SIGNALduino_CheckVersionResp UnitTest dummyDuino ( subtest 'Test SIGNALduino_CheckVersionResp timeout' => sub { plan(1); # mock like SIGNALduino_StartInit - $hash->{DevState} = 'waitInit'; - $hash->{ucCmd}->{responseSub} = \&SIGNALduino_CheckVersionResp; - $hash->{ucCmd}->{cmd} = "version"; + $targetHash->{DevState} = 'waitInit'; + $targetHash->{ucCmd}->{responseSub} = \&SIGNALduino_CheckVersionResp; + $targetHash->{ucCmd}->{cmd} = "version"; # Simulate timeout behaviour my ($ret,undef)=SIGNALduino_CheckVersionResp($targetHash); like($ret,qr/^$target: CheckVersionResp, Not an SIGNALduino device, got for V: undef$/,"check return message"); From 1f67684a53938aba64ebef4f320046c0a0ab5d46 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sun, 27 Dec 2020 22:31:54 +0000 Subject: [PATCH 3/5] Automatic updated controls and CHANGED --- CHANGED | 3 +++ controls_signalduino.txt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGED b/CHANGED index 1df5f7aeb..3dc5b2b66 100644 --- a/CHANGED +++ b/CHANGED @@ -1,3 +1,6 @@ +2020-12-27 - 00_SIGNALduino.pm + + -Wrong version assignment in SIGNALduino_CheckVersionResp fixed and tests corrected 2020-12-20 - Decoding and sending protocol 24 (#915) SD_ProtocolData.pm: change protocol u24 to P24 diff --git a/controls_signalduino.txt b/controls_signalduino.txt index 1b03a8cdd..f14d88c41 100644 --- a/controls_signalduino.txt +++ b/controls_signalduino.txt @@ -1,4 +1,4 @@ -UPD 2020-12-20_21:49:49 216539 FHEM/00_SIGNALduino.pm +UPD 2020-12-27_23:31:06 216628 FHEM/00_SIGNALduino.pm UPD 2020-06-15_17:41:39 17876 FHEM/10_FS10.pm UPD 2020-05-26_11:51:12 20465 FHEM/10_SD_GT.pm UPD 2016-09-18_21:22:06 10111 FHEM/14_BresserTemeo.pm From c7590b34f946f6dadd57e2c196dfecf73cdc130d Mon Sep 17 00:00:00 2001 From: sidey79 <7968127+sidey79@users.noreply.github.com> Date: Mon, 28 Dec 2020 00:01:23 +0100 Subject: [PATCH 4/5] 00_SIGNALduino.pm Removed duplicate delete --- FHEM/00_SIGNALduino.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/FHEM/00_SIGNALduino.pm b/FHEM/00_SIGNALduino.pm index 116679a49..e42ca8644 100644 --- a/FHEM/00_SIGNALduino.pm +++ b/FHEM/00_SIGNALduino.pm @@ -1382,7 +1382,6 @@ sub SIGNALduino_CheckVersionResp { ### ToDo, manchmal kommen Mu Nachrichten in $msg und somit ist keine Version feststellbar !!! if (defined($msg)) { $hash->{logMethod}->($hash, 5, "$name: CheckVersionResp, called with $msg"); - delete $hash->{version}; if ($msg =~ m/($gets{$hash->{ucCmd}->{cmd}}[4])/ ) { $hash->{version} = $1; } else { From af9f9f30a259d21a3fd0d05afe30e4500a7ea680 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sun, 27 Dec 2020 23:01:51 +0000 Subject: [PATCH 5/5] Automatic updated controls and CHANGED --- CHANGED | 1 + controls_signalduino.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGED b/CHANGED index 3dc5b2b66..ca8b039ef 100644 --- a/CHANGED +++ b/CHANGED @@ -1,3 +1,4 @@ +2020-12-27 - Merge branch 'repair_unitest' of ssh://github.com/RFD-FHEM/RFFHEM into repair_unitest 2020-12-27 - 00_SIGNALduino.pm -Wrong version assignment in SIGNALduino_CheckVersionResp fixed and tests corrected diff --git a/controls_signalduino.txt b/controls_signalduino.txt index f14d88c41..134c402bb 100644 --- a/controls_signalduino.txt +++ b/controls_signalduino.txt @@ -1,4 +1,4 @@ -UPD 2020-12-27_23:31:06 216628 FHEM/00_SIGNALduino.pm +UPD 2020-12-28_00:01:23 216599 FHEM/00_SIGNALduino.pm UPD 2020-06-15_17:41:39 17876 FHEM/10_FS10.pm UPD 2020-05-26_11:51:12 20465 FHEM/10_SD_GT.pm UPD 2016-09-18_21:22:06 10111 FHEM/14_BresserTemeo.pm