Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4a85e0e
test: Move global test code into BeforeAll block for Pester v5
deadlydog Apr 24, 2026
8cebfe2
test: Import module with using syntax
deadlydog Apr 24, 2026
6e66146
test: Pull in PAT from environment variable
deadlydog Apr 24, 2026
10f2663
test: Add tests to make sure tests are setup properly
deadlydog Apr 24, 2026
6f1b40c
Add initial dummy module that will be used for testing
deadlydog Apr 24, 2026
aa2c892
chore: Delete fake modules tests
deadlydog Apr 24, 2026
eaad50d
chore: Add comments to dummy module
deadlydog Apr 24, 2026
be4c151
feat: Create script for publishing new fake module versions for testi…
deadlydog Apr 24, 2026
2d6e559
Publish a few more versions
deadlydog Apr 24, 2026
50b9468
test: Update tests to use dummy open source module and feed
deadlydog Apr 24, 2026
559cf7d
Remove dummy tests file
deadlydog Apr 24, 2026
a4332c8
Move tests file to live beside module
deadlydog Apr 24, 2026
5aeee40
Update comment in tests
deadlydog Apr 24, 2026
f7db0c0
chore: Spellcheck ignore
deadlydog Apr 25, 2026
899dfa1
test: Fix test file path
deadlydog Apr 25, 2026
7854d02
ci: Allow tests to access feed
deadlydog Apr 25, 2026
28b602d
chore: Change feed test module is published to so it is private and r…
deadlydog Apr 25, 2026
2dbdea0
test: Use proper Pester v5 syntax for Mocks
deadlydog Apr 27, 2026
882937d
style: typo
deadlydog Apr 27, 2026
7a20201
refactor: Cleanup code a bit
deadlydog Apr 27, 2026
d44e6fa
test: Remove both repositories and package sources for feed
deadlydog Apr 27, 2026
8c9fd07
test refactor: Rename function to be more explicit
deadlydog Apr 27, 2026
b20c2d2
style: whitespace
deadlydog Apr 27, 2026
6589daf
chore: Add Dockerfile and VS Code task for running pester tests in a …
deadlydog Apr 27, 2026
1105c3d
test: Update expected error message
deadlydog Apr 27, 2026
68ba80a
Run tests in Docker by default
deadlydog Apr 27, 2026
8303ab9
chore: Add more logging in CI pipeline
deadlydog Apr 28, 2026
734281d
chore: Add more CI logging
deadlydog Apr 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"unshown"
],
"ignoreWords": [
"Deadlydog",
"devcontainer",
"pkgs",
"pwsh"
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/build-and-test-powershell-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,19 @@ jobs:

- name: Run Pester tests on Windows PowerShell to ensure backward compatibility
shell: powershell
env:
AZURE_ARTIFACTS_TESTING_FEED_PAT: ${{ secrets.DEADLYDOG_OPENSOURCEPACKAGESFEED_AZDO_PAT }}
run: |
Write-Output "Pester version being used:"
Import-Module -Name Pester
Get-Module -Name Pester

Write-Output "PowerShell version being used:"
$PSVersionTable

Write-Output "Host information:"
$host

Write-Output "Running all Pester tests in the repo:"
$pesterConfig = New-PesterConfiguration @{
Output = @{ Verbosity = 'Detailed' }
Expand All @@ -130,11 +138,19 @@ jobs:

- name: Run Pester tests and generate code coverage report
shell: pwsh
env:
AZURE_ARTIFACTS_TESTING_FEED_PAT: ${{ secrets.DEADLYDOG_OPENSOURCEPACKAGESFEED_AZDO_PAT }}
run: |
Write-Output "Pester version being used:"
Import-Module -Name Pester
Get-Module -Name Pester

Write-Output "PowerShell version being used:"
$PSVersionTable

Write-Output "Host information:"
$host

Write-Output "Running all Pester tests in the repo:"
$pesterConfig = New-PesterConfiguration @{
Output = @{ Verbosity = 'Detailed' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ jobs:

- name: Run smoke tests
shell: pwsh
env:
AZURE_ARTIFACTS_TESTING_FEED_PAT: ${{ secrets.DEADLYDOG_OPENSOURCEPACKAGESFEED_AZDO_PAT }}
run: |
[string] $smokeTestsScriptPath = "$Env:artifactsDirectoryPath/Invoke-SmokeTests.ps1"

Expand Down Expand Up @@ -123,6 +125,8 @@ jobs:

- name: Run smoke tests
shell: powershell
env:
AZURE_ARTIFACTS_TESTING_FEED_PAT: ${{ secrets.DEADLYDOG_OPENSOURCEPACKAGESFEED_AZDO_PAT }}
run: |
[string] $smokeTestsScriptPath = "$Env:artifactsDirectoryPath/Invoke-SmokeTests.ps1"

Expand Down Expand Up @@ -189,6 +193,8 @@ jobs:

- name: Run smoke tests
shell: pwsh
env:
AZURE_ARTIFACTS_TESTING_FEED_PAT: ${{ secrets.DEADLYDOG_OPENSOURCEPACKAGESFEED_AZDO_PAT }}
run: |
[string] $smokeTestsScriptPath = "$Env:artifactsDirectoryPath/Invoke-SmokeTests.ps1"

Expand Down Expand Up @@ -230,6 +236,8 @@ jobs:

- name: Run smoke tests
shell: powershell
env:
AZURE_ARTIFACTS_TESTING_FEED_PAT: ${{ secrets.DEADLYDOG_OPENSOURCEPACKAGESFEED_AZDO_PAT }}
run: |
[string] $smokeTestsScriptPath = "$Env:artifactsDirectoryPath/Invoke-SmokeTests.ps1"

Expand Down
47 changes: 46 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"isDefault": true
},
"dependsOn": [
"Run all Pester tests"
"Run Pester tests in Docker"
]
},
{
Expand Down Expand Up @@ -140,6 +140,51 @@
"problemMatcher": [
"$func-powershell-watch"
]
},
{
"label": "Build Docker image for Pester tests",
"type": "shell",
"options": {
"shell": {
"executable": "pwsh",
"args": [
"-NoProfile",
"-Command"
]
}
},
"command": "docker build -t pester-tests:latest .",
"group": "build",
"presentation": {
"reveal": "always",
"panel": "dedicated",
"clear": true
},
"problemMatcher": []
},
{
"label": "Run Pester tests in Docker",
"type": "shell",
"options": {
"shell": {
"executable": "pwsh",
"args": [
"-NoProfile",
"-Command"
]
}
},
"command": "docker run --rm -e AZURE_ARTIFACTS_TESTING_FEED_PAT=$Env:AZURE_ARTIFACTS_TESTING_FEED_PAT pester-tests:latest",
"dependsOn": [
"Build Docker image for Pester tests"
],
"group": "test",
"presentation": {
"reveal": "always",
"panel": "dedicated",
"clear": true
},
"problemMatcher": []
}
]
}
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Use .NET 10 runtime as base image
FROM mcr.microsoft.com/dotnet/sdk:10.0

# Install PowerShell
RUN apt-get update && \
apt-get install -y curl gnupg apt-transport-https && \
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-bullseye-prod bullseye main" > /etc/apt/sources.list.d/microsoft.list && \
apt-get update && \
apt-get install -y powershell && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Create working directory
WORKDIR /workspace

# Copy the module and tests into the container
COPY . .

# Set PowerShell as the default shell
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# Install required PowerShell modules
RUN Install-Module -Name PowerShellGet -RequiredVersion 2.2.5 -Force && \
Install-Module -Name Pester -Force

# Run Pester tests
ENTRYPOINT ["pwsh", "-NoProfile", "-Command", "Invoke-Pester -Configuration (New-PesterConfiguration @{ Output = @{ Verbosity = 'Detailed' }})"]
Loading
Loading