Skip to content

Use a pure-Python requirement in the diff scan test - #968

Merged
attiasas merged 1 commit into
jfrog:devfrom
attiasas:bugfix/windows-diff-scan-pip-fixture
Nov 30, 2026
Merged

attiasas merged 1 commit into
jfrog:devfrom
attiasas:bugfix/windows-diff-scan-pip-fixture

Conversation

@attiasas

@attiasas attiasas commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

`TestAudit_DiffScanFlow` runs a real `pip install` on the shared fixture `tests/testdata/projects/jas/jas/requirements.txt`, which pins `PyYAML==5.2`. PyYAML 5.2 has no wheel for current Python versions, so pip builds it from source. On the current `windows-2025-vs2026` runner image that build fails (the MSVC `vcvarsall.bat` call fails with "The input line is too long"), so SBOM generation fails and the test sees no Xray calls.

Change

The test overwrites the requirements file in its own temp copy of the project with `Werkzeug==1.0.1`, a pure-Python wheel. The shared fixture is unchanged, so the other tests that rely on PyYAML 5.2 are unaffected. The fake "previous results" in the test still differ from the installed set, so the single graph-scan POST and GET it expects are still made.

Testing

  • `go test ./commands/audit/ -run TestAudit_DiffScanFlow` passes locally on macOS.
  • Full `go test ./...` fails on `dev` with the same set of tests (Gradle, dotnet, pnpm, analyzer-manager MCP, and Xray-dependent tests), because the local machine lacks those tools and network access. This PR does not change that.

Made with Cursor

Summary by CodeRabbit

  • Tests
    • Updated an audit test to use a different package version, avoiding a source-build failure on modern Windows runners.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The audit diff scan test now writes Werkzeug==1.0.1 to the copied project’s requirements.txt before running.

Changes: Audit diff scan test

Layer / File(s) Summary
Set audit test requirements
commands/audit/audit_test.go
TestAudit_DiffScanFlow writes Werkzeug==1.0.1 to the copied project’s requirements.txt. A comment notes that the shared fixture’s pinned PyYAML version requires a source build that fails on modern Windows runners.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other · Severity of issue fixed: Low

Suggested reviewers: eranturgeman

Merge Risk: Minimal · up to 0148e

This only changes a test so it avoids a PyYAML source build on the Windows runner. No production behavior changes and there are no merge-blocking concerns.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Use a pure-Python requirement in the diff scan test" matches the main change. TestAudit_DiffScanFlow now overwrites the copied project's requirements.txt with Werkzeug==1.0.1, a pure-Python…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Use a pure-Python requirement in the diff scan test" matches the main change. TestAudit_DiffScanFlow now overwrites the copied project's requirements.txt with Werkzeug==1.0.1, a pure-Python package, which avoids the PyYAML source build on Windows runners. The title is specific and concise, and the change is test-only.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI; Enforced overrides: Organization, Workspace
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 9c771487-275f-44d2-a6cf-9c45f786dd6d
Commits

Reviewing files that changed from the base of the PR and between 34f1f8d and 0148e24.

Files selected for processing: 1

  • commands/audit/audit_test.go

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@attiasas attiasas added ignore for release Automatically generated release notes safe to test Approve running integration tests on a pull request labels Nov 29, 2026
@attiasas
attiasas requested a review from a team November 29, 2026 10:08
@github-actions github-actions Bot removed the safe to test Approve running integration tests on a pull request label Nov 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👍 Frogbot scanned this pull request and did not find any new security issues.


@attiasas
attiasas merged commit a730f97 into jfrog:dev Nov 30, 2026
119 of 134 checks passed
@attiasas
attiasas deleted the bugfix/windows-diff-scan-pip-fixture branch November 30, 2026 10:59

This branch was successfully deployed

1 active deployment
frogbot — 0148e24d Deployed Nov 29, 2026 by attiasas via scan-pull-request #4886
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore for release Automatically generated release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants