Skip to content

{Packaging} pytest version restricted - #10534

Open
mansoor sarfraz (msarfraz) wants to merge 1 commit into
mainfrom
msarfraz/pytest-version-fix
Open

mansoor sarfraz (msarfraz) wants to merge 1 commit into
mainfrom
msarfraz/pytest-version-fix

Conversation

@msarfraz

@msarfraz mansoor sarfraz (msarfraz) commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ️✔️ All clear

Breaking Changes Suppressions
️✔️ None ️✔️ None

Background
The Azure CLI Extensions unit tests are failing
Root Cause
The failures are caused by an incompatibility between pytest 9.2.0 and pytest-forked 1.7.5,
What breaks

  1. Pytest 9.2.0, released October 27, changed report internals. Test reports now store a structured NodeId object in id, rather than storing only the string nodeid. This is documented in pytest’s release notes.
  2. pytest-forked copies the report’s internal dictionary and serializes it using marshal.dumps. The new NodeId object cannot be marshalled, causing ValueError: unmarshallable object.
  3. The plugin catches that exception and exits the child process with status 3 without printing the traceback. Consequently, even passing tests appear as failed subprocesses. See the relevant pytest-forked implementation.
    The installation logs explain why this appeared suddenly: azdev allows pytest>=5.0.0, so fresh environments automatically installed 9.2.0. Pinning the azdev Git commit does not pin its transitive dependencies.

Immediate Solution

constrain pytest to 9.1.1 or pytest<9.2. Apply a CI dependency constraint such as pytest<9.2 during installation, and retain it across subsequent dependency-installation steps.

Copilot AI balanced review requested due to automatic review settings October 28, 2026 23:14
@yonzhan

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! We will review the pull request and get back to you soon.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the pipeline pytest-constraint change.

No open issues 🎉

What changed in this PR

Restricts pytest versions in the shared Azure Pipelines development setup to avoid the documented incompatibility with pytest-forked.

Changes:

  • Adds a pytest<9.2 constraint.
  • Exports PIP_CONSTRAINT for the setup script and makes it available to subsequent pipeline tasks.
File Description
.azure-pipelines/​templates/​azdev_setup.yml Configures pip to use the shared constraints file across pipeline tasks.
.azure-pipelines/​constraints.txt Caps pytest below 9.2 and documents the compatibility reason.

Review effort: Balanced

@x-engineering-agent

x-engineering-agent Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

X Engineering Agent Pull request review: Comments

mansoor sarfraz (@msarfraz) Non-blocking: 2 unrelated failures, 0 PR-related/uncertain. Unchanged logicapp and isolated scan supersede "Uncertain" below. No source change requested. Rerun/escalate Credential Scan.

Check Status Detail
Agent live tests Not run This is a review-only PR.
Regression coverage Not applicable Not applicable to the changed files.
Findings 1 low findings 1 low
Risk Risk 1/100 Low Low

To address

Tick each item as you address it.

  • Low Upstream CI

    Details and fix

    Azure.azure-cli-extensions

    • Result: failure
    • Included checks: Azure.azure-cli-extensions (Credential Scan)
    • Failure details:
      • Credential Scan / Post Analysis (Uncertain)
        • Evidence: Guardian is searching for results that meet the given criteria to break the build.
          Results Query Summary:
          Tool Filters (Include): credscan:Error
          Baselines: default
          Suppression Sets: default
          Policy: Microsoft
    1. Credential Scanner Error CSCAN-GENERAL0060 - File: src/logicapp/azext_logicapp/tests/latest/test_offline_commands.py:src/logicapp/azext_logicapp/tests/latest/test_offline_commands.py. Line: 584. Column 18.
      Signature: e3d45b7f3a06291f0298ea5ddd09abddbe9697796025808cb532b33907fdb5d0
      • Next action: Address the first actionable diagnostic quoted from the task log; do not infer a source-code cause from the aggregate build status.
      • Verify: Re-run Credential Scan / Post Analysis and confirm the quoted diagnostic is gone.
    1. Credential Scanner Error CSCAN-GENERAL0060 - File: src/logicapp/azext_logicapp/tests/latest/test_offline_commands.py:src/logicapp/azext_logicapp/tests/latest/test_offline_commands.py. Line: 584. Column 18.
      Signature: e3d45b7f3a06291f0298ea5ddd09abddbe9697796025808cb532b33907fdb5d0
      Tool: Credential Scanner: Rule: CSCAN-GENERAL0060 (General Password). https://aka.ms/credscan
      A potential secret was detected in 'test_offline_commands.py':(CSCAN-GENERAL0060 General Password) Validate file contains secrets, remove, roll credential, and use approved store. For additional information on secret remediation see https://aka.ms/credscan.
    2. Credential Scanner Error CSCAN-GENERAL0060 - File: src/logicapp/azext_logicapp/tests/latest/test_offline_commands.py:src/logicapp/azext_logicapp/tests/latest/test_offline_commands.py. Line: 612. Column 18.
      Signature: ea46caaadcca3368f4c855c705df3167c9773ee41f100fb2ab0d8b12899dfe89
      • Next action: Address the first actionable diagnostic quoted from the task log; do not infer a source-code cause from the aggregate build status.
      • Verify: Re-run Credential Scan / Post Analysis and confirm the quoted diagnostic is gone.
    1. Credential Scanner Error CSCAN-GENERAL0060 - File: src/logicapp/azext_logicapp/tests/latest/test_offline_commands.py:src/logicapp/azext_logicapp/tests/latest/test_offline_commands.py. Line: 584. Column 18.
      Signature: e3d45b7f3a06291f0298ea5ddd09abddbe9697796025808cb532b33907fdb5d0
      Tool: Credential Scanner: Rule: CSCAN-GENERAL0060 (General Password). https://aka.ms/credscan
      A potential secret was detected in 'test_offline_commands.py':(CSCAN-GENERAL0060 General Password) Validate file contains secrets, remove, roll credential, and use approved store. For additional information on secret remediation see https://aka.ms/credscan.
    2. Credential Scanner Error CSCAN-GENERAL0060 - File: src/logicapp/azext_logicapp/tests/latest/test_offline_commands.py:src/logicapp/azext_logicapp/tests/latest/test_offline_commands.py. Line: 612. Column 18.
      Signature: ea46caaadcca3368f4c855c705df3167c9773ee41f100fb2ab0d8b12899dfe89
      Tool: Credential Scanner: Rule: CSCAN-GENERAL0060 (General Password). https://aka.ms/credscan
      • Next action: Address the first actionable diagnostic quoted from the task log; do not infer a source-code cause from the aggregate build status.
      • Verify: Re-run Credential Scan / Post Analysis and confirm the quoted diagnostic is gone.
    • Credential Scan / Post Analysis (Uncertain)
      • Evidence: Suppressed results: 0
        Results excluded by tool filters: 0
        Results below minimum severity: 0
        Results classified as Pass: 0
        Results in flight: 0
        Guardian detected one or more breaking results.
        Error: Guardian exited with an error exit code: 8
        ##[section]Finishing: Post Analysis
      • Next action: Address the first actionable diagnostic quoted from the task log; do not infer a source-code cause from the aggregate build status.
      • Verify: Re-run Credential Scan / Post Analysis and confirm the quoted diagnostic is gone.
Review details

Test validation

  • Agent live test: Not run; this is a review-only PR. Check author-provided test evidence and upstream CI separately.
  • Regression coverage: Not applicable to the changed files.

Risk assessment

1/100 · Low

The Low rating reflects the detected change scope with no elevated security, reliability, customer, operational, dependency, sovereign-cloud, generated-output, or cross-component signal.

  • Change scope: 2 changed files, 4 changed lines (+4 / -0), including 0 production files.
  • Affected components: No production component was identified.
  • Risk drivers: No elevated risk signal was detected.
  • Regression evidence: No production-code regression-test signal applies.
  • Confidence: Low because no production changed-line evidence was available.
  • Required review: No additional owning-squad review signal was detected.

Ask the Agent

Tick a box to queue an action. Requires write access to this repository.

  • Re-review this PR
  • Run Agent live tests on this PR

X Engineering Agent · Reviewer · React with +1 or -1 to train the agent

@x-engineering-agent x-engineering-agent Bot added the X Engineering Agent Reviewed Agent reviewed this PR label Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Request X Engineering Agent Ask the agent to triage this issue or review this PR X Engineering Agent Reviewed Agent reviewed this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants