RLC Rebase prep: testing fixups#76
Open
PlaidCat wants to merge 3 commits into
Open
Conversation
These tests were not updated and are failing. RLC rebase will be expanding test coverage but these needed fixed.
There was a problem hiding this comment.
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-covplus 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.
7d79827 to
76c5d3e
Compare
76c5d3e to
7fb6872
Compare
73b5de3 to
d13a9f1
Compare
bmastbergen
reviewed
Jun 25, 2026
bmastbergen
left a comment
Collaborator
There was a problem hiding this comment.
Couple of little things. Otherwise, LGTM
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.
d13a9f1 to
977ad4c
Compare
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 |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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