Azure / Azure/autorest.powershell

test-module.ps1 ignores local Az.Accounts even though its version is higher

Open
#1,472 1 comment 0 reactions 0 assignees View on GitHub
P1 Tracking
Dominant language
C#
Stars
123
Forks
99
PR merge metrics
No merged PRs in 30d

Description

`test-module.ps1` uses locally installed Az.Accounts if its version is higher than the embedded one, but it didn't and caused the test cases of Functions to fail.

To reproduce

```powershell
git checkout main
git reset --hard upstream/main
git checkout -b functions-update-stacks-may-2025-base

# generate code
autorest --reset
autorest --powershell --debug --verbose 3>&1 2>&1 > log.txt

# build module
.\build-module.ps1

# run tests
.\test-module.ps1 -Playback

Tests completed in 9.32s
Tests Passed: 0, Failed: 64, Skipped: 18, Pending: 0, Inconclusive: 0

PS C:\Users\x\code\azure-powershell\src\Functions\Functions.Autorest [68.08s]> gmo az.accounts -li

Directory: C:\Users\x\Documents\PowerShell\Modules

ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 4.2.0 Az.Accounts Core,Desk {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave…}

Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 4.0.2 Az.Accounts Core,Desk {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave…}

```

Mannually remove the one in .\generated\modules\Az.Accounts can workaround this problem.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.