Skip to content

Commit

Permalink
PR-checker - pylint improvements (#25)
Browse files Browse the repository at this point in the history
* Add manual option to run test jobs
* PR checker / manual dispatch - add branch handling

* PR-checker / get the pylint logs & status counter

The updated script in scripts-internal/ci needs a bit of tweaks here.

* Regenerated pylintrc -file

Match what we have in the system tests repo.
  • Loading branch information
JanneKiiskila authored Dec 20, 2023
1 parent a8cf1e6 commit c0add95
Show file tree
Hide file tree
Showing 3 changed files with 520 additions and 215 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/installation-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- 'requirements.txt'
- 'pytest.ini'
- '.github/workflows/installation-test.yml'
workflow_dispatch:

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
Expand All @@ -24,6 +25,9 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v3
with:
# Use the branch specified by the workflow_dispatch input or the pull_request event
ref: ${{ github.event.inputs.branch || github.event.pull_request.head.ref }}
- name: Install Python ${{ matrix.python-ver}}
uses: actions/setup-python@v4
with:
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/pr-checker.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
name: PR-checker
on: push
on:
push:
workflow_dispatch:
inputs:
python-version:
description: 'Python version to use'
default: '3.9'

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: izuma-system-tests-'${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
group: e2e-edge-'${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
Expand All @@ -23,8 +29,8 @@ jobs:
uses: actions/checkout@v4
with:
repository: PelionIoT/scripts-internal
path: scripts-internal
token: ${{ secrets.ACCESS_TOKEN }}

# Need to run this 1st, so that the other log files do not cause unnecessary findings
- name: Run misspell
if: always()
Expand All @@ -48,14 +54,13 @@ jobs:
- name: Run pylint (findings may not increase)
run: |
sudo apt-get install pylint
pylint --version
pylint --exit-zero --persistent=n tests/ izuma_systest_lib/ >pylint.log
echo "### pylint" >>$SUMMARY_FILE
pylintstats=$(scripts-internal/ci/more-lines-checker.sh ${{ github.event.repository.default_branch }} ${{ github.ref_name }} "pylint --exit-zero --persistent=n systemtest-library test_cases" | tail -n2)
pylint --version >>$SUMMARY_FILE
pylint --exit-zero --rcfile pylintrc --persistent=n tests/ izuma_systest_lib/ >pylint.log
pylintstats=$(scripts-internal/ci/more-lines-checker.sh ${{ github.event.repository.default_branch }} ${{ github.ref_name }} "pylint --exit-zero --rcfile pylintrc --persistent=n tests/ izuma_systest_lib/" pylint | tail -n3)
echo "$pylintstats" >>$SUMMARY_FILE
pylintscore=$(tail -2 pylint.log |head -1)
echo "$pylintscore" >>$SUMMARY_FILE
echo "$pylintstats"
if [[ $pylintstats == *"Oh no"* ]]; then
# More findings than earlier
echo "TEST_FAIL=true" >> $GITHUB_ENV
Expand Down
Loading

0 comments on commit c0add95

Please sign in to comment.