Skip to content

RLC Rebase prep: testing fixups#76

Open
PlaidCat wants to merge 3 commits into
mainlinefrom
{jmaple}_rlc_rebase_testing
Open

RLC Rebase prep: testing fixups#76
PlaidCat wants to merge 3 commits into
mainlinefrom
{jmaple}_rlc_rebase_testing

Conversation

@PlaidCat

@PlaidCat PlaidCat commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

As a part of moving RLC Rebases off my laptop into this repo and mainline I wanted to improve our testing and test reporting updates.

This fixes the current tests, adds shell check to the precommits and adds test coverage to the PRs.

This will also be a test for the PR adding test coverage update process.

Local coverage

(venv311) [jmaple@devbox kernel-src-tree-tools]$ pytest --cov
.....................                                                                        [100%]
========================================== tests coverage ==========================================
_________________________ coverage: platform linux, python 3.11.13-final-0 _________________________

Name                        Stmts   Miss Branch BrPart  Cover   Missing
-----------------------------------------------------------------------
check_fips_changes.py          42     42     12      0     0%   8-67
check_kernel_commits.py       179    179     76      0     0%   3-371
ciq-cherry-pick.py            190    190     50      0     0%   1-426
ciq-tag.py                    146    146     16      0     0%   3-378
ciq_tag.py                    232    232     54      0     0%   1-464
jira_pr_check.py              180    180     80      0     0%   3-381
kt/ktlib/config.py             47      4      8      2    89%   52, 82-85
kt/ktlib/kernels.py            76     16     12      2    77%   51-59, 76-78, 108, 124-131
kt/ktlib/repo.py               29     15      2      0    45%   30-31, 34-35, 43-55
kt/ktlib/util.py               14      0      0      0   100%
release_config.py               2      2      0      0     0%   7-27
rolling-release-update.py     264    264    106      0     0%   1-412
run_interdiff.py              165    165     56      0     0%   3-244
update_lt_spec.py             219    219     46      0     0%   9-411
-----------------------------------------------------------------------
TOTAL                        1785   1654    518      4     6%
21 passed in 0.26s

If this works a test coverage will be updated below here

I guess we need it on the main branch as dispatch is not helping me here
The workflow has the execution and upload though
https://github.com/ctrliq/kernel-src-tree-tools/actions/runs/28176418390/job/83453900019?pr=76#step:7:34

These tests were not updated and are failing.  RLC rebase will be
expanding test coverage but these needed fixed.
@PlaidCat PlaidCat self-assigned this Jun 25, 2026
Copilot AI review requested due to automatic review settings June 25, 2026 14:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prepares the repo for RLC rebase work by fixing/adjusting existing tests and improving CI quality gates and reporting, including automated coverage reporting back into PRs.

Changes:

  • Update ktlib tests to reflect required config/kernel fields (e.g., user, mock_config, automated).
  • Add pytest-cov plus pytest/coverage configuration to standardize test and coverage behavior.
  • Extend PR CI to run tests with coverage, upload the report as an artifact, and add a follow-up workflow to post coverage into the PR body.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/kt/ktlib/test_kernels.py Updates test kernel fixtures to include required kernel fields.
tests/kt/ktlib/test_config.py Adds user to test config JSON and hardens default-load test against env leakage.
pyproject.toml Adds pytest-cov and configures pytest + coverage reporting defaults.
ciq_tag.py Minor lambda cleanup in tag insertion logic.
.pre-commit-config.yaml Pins ruff hook by SHA and adds shellcheck pre-commit hook.
.github/workflows/pr_check.yml Adds pytest+coverage execution and uploads the coverage artifact/PR metadata artifacts.
.github/workflows/pr_check_comment.yml New workflow_run job to download artifacts and append coverage to the PR body.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/pr_check_comment.yml Outdated
Comment thread ciq_tag.py Outdated
Copilot AI review requested due to automatic review settings June 25, 2026 14:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Comment thread .github/workflows/pr_check_comment.yml Outdated
Comment thread .github/workflows/pr_check_comment.yml
Comment thread .github/workflows/pr_check_comment.yml Outdated
Comment thread tests/kt/ktlib/test_config.py
Comment thread tests/kt/ktlib/test_config.py
Comment thread .github/workflows/pr_check.yml
Copilot AI review requested due to automatic review settings June 25, 2026 15:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Comment thread .github/workflows/pr_check_comment.yml Outdated
Comment thread .github/workflows/pr_check_comment.yml
Comment thread .github/workflows/pr_check_comment.yml
Comment thread .github/workflows/pr_check.yml
Comment thread .github/workflows/pr_check_comment.yml
Copilot AI review requested due to automatic review settings June 25, 2026 15:14
@PlaidCat PlaidCat force-pushed the {jmaple}_rlc_rebase_testing branch from 7d79827 to 76c5d3e Compare June 25, 2026 15:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Comment thread pyproject.toml
Comment thread .github/workflows/pr_check_comment.yml Outdated
Comment thread .github/workflows/pr_check_comment.yml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/pr_check_comment.yml
Comment thread .github/workflows/pr_check_comment.yml
@PlaidCat PlaidCat force-pushed the {jmaple}_rlc_rebase_testing branch 2 times, most recently from 73b5de3 to d13a9f1 Compare June 25, 2026 18:08

@bmastbergen bmastbergen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of little things. Otherwise, LGTM

Comment thread .pre-commit-config.yaml Outdated
Comment thread .github/workflows/pr_check.yml Outdated
PlaidCat added 2 commits June 25, 2026 17:15
Added shellcheck to the precommit.

WIWT: Pinned ruff-pre-commit to latest in the format SRE has been doing
with GitHub Actions.  Update caused changed and included that change.
Initial point to add in coverage reporting and updating the PR on
workflow execution.
Copilot AI review requested due to automatic review settings June 25, 2026 21:16
@PlaidCat PlaidCat force-pushed the {jmaple}_rlc_rebase_testing branch from d13a9f1 to 977ad4c Compare June 25, 2026 21:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Comment on lines +52 to +57
- name: Checksum PR Metadata
if: github.event_name == 'pull_request'
run: |
mkdir -p pr_metadata
cd pr_metadata && sha256sum *.txt > checksums.txt

Comment on lines +30 to +34
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: coverage-report
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event_name == 'workflow_dispatch' && inputs.run_id || github.event.workflow_run.id }}
Comment on lines +37 to +41
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: pr-metadata
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event_name == 'workflow_dispatch' && inputs.run_id || github.event.workflow_run.id }}
Comment on lines +57 to +67
- name: Read and Validate PR number
id: pr_number
env:
PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}
run: |
if [ -z "$PR_NUMBER" ] || ! [[ "$PR_NUMBER" =~ ^[0-9]+$ ]]; then
echo "Error: Could not determine PR number from workflow_run payload: $PR_NUMBER"
exit 1
fi
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_OUTPUT"
- name: Validate coverage report

@bmastbergen bmastbergen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥌

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment on lines +52 to +57
- name: Checksum PR Metadata
if: github.event_name == 'pull_request'
run: |
mkdir -p pr_metadata
cd pr_metadata && sha256sum *.txt > checksums.txt

Comment on lines +57 to +67
- name: Read and Validate PR number
id: pr_number
env:
PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}
run: |
if [ -z "$PR_NUMBER" ] || ! [[ "$PR_NUMBER" =~ ^[0-9]+$ ]]; then
echo "Error: Could not determine PR number from workflow_run payload: $PR_NUMBER"
exit 1
fi
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_OUTPUT"
- name: Validate coverage report
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants