Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reviewdog for perl tests & errors - report unittest failure inline #1100

Merged
merged 58 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
cba8a95
.reviewdog
sidey79 Apr 24, 2022
6e934a1
prove.yml
sidey79 Apr 24, 2022
67c8c43
prove.yml
sidey79 Apr 24, 2022
bb671a2
00_SIGNALduino.pm
sidey79 Apr 24, 2022
7eb8819
Update Versiondate
actions-user Apr 24, 2022
77c81f4
.reviewdog.yml
sidey79 Apr 25, 2022
7f38d63
Update Versiondate
actions-user Apr 25, 2022
2d66f3a
Limit failure
sidey79 Apr 25, 2022
ac638fd
Update Versiondate
actions-user Apr 25, 2022
9a5adb6
.reviewdog
sidey79 Apr 25, 2022
e0f03c6
Merge branch 'test-reviewdog' of https://github.com/RFD-FHEM/RFFHEM i…
sidey79 Apr 25, 2022
a591be8
Update Versiondate
actions-user Apr 25, 2022
5e276a3
.reviewdog
sidey79 Apr 26, 2022
cffe32a
Update Versiondate
actions-user Apr 26, 2022
070d1cf
14_SD_WS.pm
sidey79 Apr 26, 2022
299c224
Update Versiondate
actions-user Apr 26, 2022
7ef8bf5
00_load.t
sidey79 Apr 26, 2022
fd485f5
Update Versiondate
actions-user Apr 26, 2022
d74ee52
Merge branch 'master' into test-reviewdog
sidey79 May 18, 2022
9f49c4e
Update Versiondate
actions-user May 18, 2022
19954be
Merge branch 'master' into test-reviewdog
HomeAutoUser Jul 19, 2022
483b49f
Merge branch 'master' into test-reviewdog
sidey79 Sep 10, 2022
26dc31d
Merge branch 'master' into test-reviewdog
HomeAutoUser Sep 12, 2022
f0e117f
Merge branch 'master' into test-reviewdog
sidey79 Oct 19, 2022
4fbf3b2
travis yaml is not needed anymore
sidey79 Oct 19, 2022
6e49dc9
Try pipefail to capture exit code from prove command
sidey79 Oct 19, 2022
1986f3c
try running reviewdog step always
sidey79 Oct 19, 2022
e5a7103
Run reviewdog setup always
sidey79 Oct 19, 2022
d14f8d0
add git diff command to reviwdog
sidey79 Oct 19, 2022
7816010
fix syntax
sidey79 Oct 19, 2022
f5f195a
add some more output
sidey79 Oct 19, 2022
1a08842
fix last commit
sidey79 Oct 19, 2022
ecd9678
get more detailed names from checks
sidey79 Oct 19, 2022
ba7a0d0
disable error outputs for prove step
sidey79 Oct 19, 2022
e93de63
fixed errorformat for raw prove log
sidey79 Oct 19, 2022
ec1141c
syntax fix for stopmarker
sidey79 Oct 19, 2022
383d4ca
Disable problem Marker
sidey79 Oct 20, 2022
9864aab
fix filenames
sidey79 Oct 20, 2022
3ff2bcb
detection of perl errors improved
sidey79 Oct 20, 2022
2ac1e79
Ausgabe der Meldungen angepasst
sidey79 Oct 20, 2022
ec335c3
try append testOutput
sidey79 Oct 20, 2022
90996ae
try without parllel execution
sidey79 Oct 20, 2022
4de3c9c
try tee as pipe with merge in prove
sidey79 Oct 20, 2022
e793fe2
try
sidey79 Oct 20, 2022
ba22dc5
separete output files for tests
sidey79 Oct 20, 2022
279a7b7
fix
sidey79 Oct 20, 2022
a1d5efa
write into correct location
sidey79 Oct 20, 2022
12e6fdc
fix directory location of testscripts
sidey79 Oct 20, 2022
3f145fd
back to earlier design
sidey79 Oct 20, 2022
b5b6685
run reviewdog only on pr
sidey79 Oct 20, 2022
f2f621f
remove tee from reviewdog
sidey79 Oct 20, 2022
40dccd5
improved reviewdog format
sidey79 Oct 20, 2022
802d726
cause syntax error
sidey79 Oct 20, 2022
8b79e67
remove syntax error
sidey79 Oct 22, 2022
358a7ae
Update Versiondate
actions-user Oct 22, 2022
c1cf5ea
pause push until tests are successfull
sidey79 Oct 23, 2022
f80ded3
Merge branch 'master' into test-reviewdog
sidey79 Oct 23, 2022
101d9f8
Update Versiondate
actions-user Oct 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 29 additions & 18 deletions .github/workflows/prove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ jobs:
install-modules-with: cpanm
install-modules-args: --no-interactive -v --installdeps

#- name: Install deps via cpanm
#run: |
#cpanm --notest --no-interactive -v --installdeps .
#cpanm --notest --no-interactive -v Devel::Cover::Report::Clover
#cpanm --no-interactive -v Storable
- name: install fhem via deb package
run: |
wget -qO - http://debian.fhem.de/archive.key | sudo apt-key add -
Expand All @@ -34,25 +29,26 @@ jobs:
# uses: mxschmitt/action-tmate@v1
- name: run prove on perl modules (testscripts)
run: |
prove -j2 --exec 'perl -MDevel::Cover=-silent,1 -I FHEM ' -I FHEM -r -v t/SD_Protoco*
- name: Create clover report
run: cover -report clover
- uses: codecov/codecov-action@v3.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./cover_db/clover.xml
flags: unittests,perl,modules
name: perl modules (testscripts) ${{ matrix.perl }}
echo "::remove-matcher owner=perl::"
prove -j3 --exec 'perl -MDevel::Cover=-silent,1 -I FHEM ' -I FHEM -r -v t/SD_Protoco* > >(tee -a ${GITHUB_WORKSPACE}/testOutput.stdout) 2> >(tee -a ${GITHUB_WORKSPACE}/testOutput.stderr >&2)
- name: run prove fhem testsuite ${{ matrix.perl }}
run: |
cp -R ${GITHUB_WORKSPACE}/FHEM/* ${FHEM_DIR}/FHEM/
cp -R ${GITHUB_WORKSPACE}/lib/* ${FHEM_DIR}/lib/
#find ${GITHUB_WORKSPACE}/t/FHEM -maxdepth 1 -regex '.*/t/FHEM/[0-9][0-9]_.*' -print0 | xargs -0 -I'{}' prove --exec 'perl -MDevel::Cover=-silent,1 fhem.pl -t' -I FHEM -r -vv -r "{}"
prove -j2 --exec 'perl -MDevel::Cover=-silent,1 fhem.pl -t' -I FHEM -vv -r ${GITHUB_WORKSPACE}/t/FHEM/
prove -j3 --exec 'perl -MDevel::Cover=-silent,1 fhem.pl -t' -I FHEM -v -r ${GITHUB_WORKSPACE}/t/FHEM/ > >(tee -a ${GITHUB_WORKSPACE}/testOutput.stdout) 2> >(tee -a ${GITHUB_WORKSPACE}/testOutput.stderr >&2)
working-directory: /opt/fhem/
env:
FHEM_DIR: /opt/fhem
- name: Create clover report
- name: Create clover report for perl Modules
run: cover -report clover
- uses: codecov/codecov-action@v3.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./cover_db/clover.xml
flags: unittests,perl,modules
name: perl modules (testscripts) ${{ matrix.perl }}

- name: Create clover report for fhem tests
working-directory: /opt/fhem/
run: cover -report clover
- uses: codecov/codecov-action@v3.1.1
Expand All @@ -62,4 +58,19 @@ jobs:
flags: unittests,fhem,modules
name: fhem (testscripts) ${{ matrix.perl }}


- uses: reviewdog/action-setup@v1
if: always() && github.event_name == 'pull_request'
with:
reviewdog_version: latest

- name: Run reviewdog
if: always() && github.event_name == 'pull_request' && !cancelled()
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
reviewdog \
-name=perl-${{ matrix.perl }} \
-reporter="github-pr-check" \
-filter-mode="file" \
--diff="git diff ${{ github.base_ref }}" \

14 changes: 10 additions & 4 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
BRANCH_NAME: ${{ steps.extract_branch.outputs.BRANCH_NAME }}
update:
needs: pr_check
if: needs.pr_check.outputs.result != 'true'
env:
CONTROLS_FILENAME: controls_signalduino.txt
runs-on: ubuntu-latest
Expand Down Expand Up @@ -87,9 +88,14 @@ jobs:
git ls-files --error-unmatch controls_signalduino.txt || git add controls_signalduino.txt
git ls-files --error-unmatch CHANGED || git add CHANGED
git diff --name-only --exit-code controls_signalduino.txt || git commit CHANGED controls_signalduino.txt -m "Automatic updated controls and CHANGED" || true
- name: git push
if: needs.pr_check.outputs.result != 'true'
uses: ad-m/github-push-action@v0.6.0
#- name: git push
# if: needs.pr_check.outputs.result != 'true'
# uses: ad-m/github-push-action@v0.6.0
# with:
# github_token: ${{ secrets.GH_TOKEN }}
# branch: ${{ steps.extract_branch.outputs.branch }}
- name: Push to branch
uses: CasperWA/push-protected@v2
with:
github_token: ${{ secrets.GH_TOKEN }}
token: ${{ secrets.GH_TOKEN }}
branch: ${{ steps.extract_branch.outputs.branch }}
23 changes: 23 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,11 @@ jobs:
path: |
${{ matrix.file }}
commit:
permissions:
contents: write
runs-on: ubuntu-latest
needs: modify
name: Commit and Push back
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -169,8 +172,28 @@ jobs:
git config --global user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Update Versiondate" -a && echo "::set-output name=status::true" || true

- name: Wait for tests to succeed
if: ${{ steps.commit.outputs.status }}
uses: lewagon/wait-on-check-action@v1.2.0
with:
running-workflow-name: 'Commit and Push back'
ref: ${{ github.head_ref }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 20
allowed-conclusions: success,skipped,cancelled,neutral

- name: git push
if: ${{ steps.commit.outputs.status }}
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GH_TOKEN }}
branch: ${{ github.head_ref }}

#- name: Push to branch
# uses: CasperWA/push-protected@v2
# with:
# token: ${{ secrets.GH_TOKEN }}
# branch: ${{ github.head_ref }}
# #unprotect_reviews: true

20 changes: 20 additions & 0 deletions .reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
runner:
perl-test2-tap:
cmd: cat testOutput.stderr
errorformat: # (optional if you use `format`)
- '%C# at %f line %l%.'
- '%E# Failed test %m'
- '%C# | %.%#'
- '%C# +-%.%#'
- '%-G%.%#'
level: error
perl-errors:
cmd: cat testOutput.stdout
errorformat:
- '%-G%m redefined at %f line %l%.%r'
- '%+Esyntax error at %f line %l%. "%m'
- '%+Z%p%m"'
- '%+E %m %.%# at %f line %l%.%#'
- '%+ZBEGIN failed%r'
- '%-Gok%.%#'
level: error
46 changes: 0 additions & 46 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions FHEM/14_SD_WS07.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##############################################
# $Id: 14_SD_WS07.pm 21666 2021-12-29 16:12:11Z elektron-bbs $
# $Id: 14_SD_WS07.pm 21666 2022-10-23 12:40:10Z sidey79 $
#
# The purpose of this module is to support serval eurochron
# weather sensors like eas8007 which use the same protocol
Expand Down Expand Up @@ -145,9 +145,9 @@ SD_WS07_Parse($$)
}

$model = $model."_".$models{$modelkey};
my $deviceCode;
my $longids = AttrVal($iohash->{NAME},'longids',0);
if ( ($longids ne "0") && ($longids eq "1" || $longids eq "ALL" || (",$longids," =~ m/,$model,/))) {
my $deviceCode;
my $longids = AttrVal($iohash->{NAME},'longids',0);
if ( ($longids ne "0") && ($longids eq "1" || $longids eq "ALL" || (",$longids," =~ m/,$model,/))) {
$deviceCode = $id.$channel;
Log3 $iohash,4, "$iohash->{NAME}: using longid $longids model $model";
} else {
Expand Down
2 changes: 1 addition & 1 deletion controls_signalduino.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ UPD 2020-10-03_11:48:15 11170 FHEM/14_SD_AS.pm
UPD 2021-07-13_20:29:34 29223 FHEM/14_SD_BELL.pm
UPD 2022-09-07_20:44:05 178780 FHEM/14_SD_UT.pm
UPD 2022-09-11_17:07:22 130779 FHEM/14_SD_WS.pm
UPD 2021-12-30_17:02:10 18709 FHEM/14_SD_WS07.pm
UPD 2022-10-23_14:39:30 18704 FHEM/14_SD_WS07.pm
UPD 2022-04-15_20:58:20 35384 FHEM/14_SD_WS09.pm
UPD 2020-04-13_23:15:56 14325 FHEM/14_SD_WS_Maverick.pm
UPD 2021-08-11_21:38:30 37904 FHEM/41_OREGON.pm
Expand Down
2 changes: 1 addition & 1 deletion t/FHEM/14_SD_WS/00_load.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use Test2::Tools::Compare qw{ is };
my $module = basename (dirname(__FILE__));

plan(1);
is(CommandReload(undef,$module), undef, "$module loaded");
is(CommandReload(undef,$module), U(), "$module loaded");

exit(0); # necessary

Expand Down