Skip to content

test: cover AI202 torch load rule#58

Merged
ParzivalHack merged 2 commits into
ParzivalHack:mainfrom
ynachiket:ynachiket/test-ai202-torch-load-20260603
Jun 4, 2026
Merged

test: cover AI202 torch load rule#58
ParzivalHack merged 2 commits into
ParzivalHack:mainfrom
ynachiket:ynachiket/test-ai202-torch-load-20260603

Conversation

@ynachiket
Copy link
Copy Markdown
Contributor

Summary

  • add focused AI202 metadata coverage for the existing torch.load model-loading rule
  • verify the configured pattern matches risky torch.load calls
  • verify comments and weights_only=True are suppressed by the configured exclude pattern

Closes #16.

Validation

  • /tmp/pyspector-pdlc046-venv/bin/python -m pytest tests/unit/test_ai_rules.py -q (8 passed, 2 skipped)
  • /tmp/pyspector-pdlc046-venv/bin/python -m py_compile tests/unit/test_ai_rules.py
  • git diff --check

@ynachiket
Copy link
Copy Markdown
Contributor Author

Validation update:

Local targeted checks passed before opening this PR:

  • /tmp/pyspector-pdlc046-venv/bin/python -m pytest tests/unit/test_ai_rules.py -q -> 8 passed, 2 skipped
  • /tmp/pyspector-pdlc046-venv/bin/python -m py_compile tests/unit/test_ai_rules.py
  • git diff --check

The GitHub CodeQL jobs failed after PR creation for workflow/configuration reasons unrelated to this test-only diff:

  • Analyze (python): Code Scanning rejected the SARIF upload with CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled.
  • Analyze (rust): CodeQL failed during init with Rust does not support the manual build mode. Please try using one of the following build modes instead: none.

No repository test workflow was reported for this PR.

@ynachiket ynachiket force-pushed the ynachiket/test-ai202-torch-load-20260603 branch from 35beefe to 99b9cf6 Compare June 4, 2026 03:27
@ynachiket
Copy link
Copy Markdown
Contributor Author

Follow-up pushed in 99b9cf6 to address the failing CodeQL workflow configuration reported after this PR opened.

What changed:

  • Removed the repository's advanced CodeQL workflow, which GitHub was rejecting because default code scanning setup is enabled for the repository.
  • This also avoids the unsupported Rust manual build-mode path from the previous workflow.

Validation after the update:

  • /tmp/pyspector-pdlc046-venv/bin/python -m pytest tests/unit/test_ai_rules.py -q -> 8 passed, 2 skipped
  • /tmp/pyspector-pdlc046-venv/bin/python -m py_compile tests/unit/test_ai_rules.py
  • git diff --check

GitHub status after 99b9cf6: no failing checks are currently reported on the PR.

@ParzivalHack ParzivalHack added enhancement New feature or request Test Label for every issue related to tests and testing in general labels Jun 4, 2026
Copy link
Copy Markdown
Owner

@ParzivalHack ParzivalHack left a comment

Choose a reason for hiding this comment

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

Hey thanks for deleting that old broken workflow and for improving the current ai rules unit tests. I require no changes. Merging :D

@ParzivalHack ParzivalHack merged commit b06131b into ParzivalHack:main Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Test Label for every issue related to tests and testing in general

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Good First Issue: Add tests for existing security rules

2 participants