Skip to content

Commit 0b74462

Browse files
algattikCopilot
andcommitted
test(skills): cover shared RPI instruction bootstrap
🧪 - Generated by Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d606de9 commit 0b74462

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

scripts/tests/security/Test-HveCoreFreshness.Tests.ps1

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,40 @@ Describe 'RPI bootstrap workflow contract' -Tag 'Contract' {
158158
$declaredSkills | Should -Be $script:RequiredRpiSkills
159159
}
160160

161+
It 'Downloads the shared tracking instruction from the reviewed commit' {
162+
$script:RpiStep.run | Should -Match (
163+
'tracking_instruction="\.github/instructions/hve-core/copilot-tracking\.instructions\.md"'
164+
)
165+
$script:RpiStep.run | Should -Match 'gh api'
166+
$script:RpiStep.run | Should -Match (
167+
'copilot-tracking\.instructions\.md\?ref=\$RPI_SKILLS_REF'
168+
)
169+
$script:RpiStep.run | Should -Match (
170+
'--header "Accept: application/vnd\.github\.raw\+json"'
171+
)
172+
$script:RpiStep.run | Should -Match '> "\$tracking_instruction"'
173+
}
174+
161175
It 'Runs last and fails the setup workflow on installation errors' {
162176
$steps = @($script:CheckedInWorkflow.jobs.'copilot-setup-steps'.steps)
163177

164178
$steps[-1].name | Should -Be 'Bootstrap hve-core RPI skills'
165179
$script:RpiStep.PSObject.Properties.Name | Should -Not -Contain 'continue-on-error'
166180
}
167181

168-
It 'Keeps the generated skills gitignored and untracked' {
182+
It 'Keeps the generated RPI artifacts ignored and untracked' {
169183
$gitignore = Get-Content -Path (Join-Path $script:RepoRoot '.gitignore') -Raw
170-
$trackedFiles = @(git -C $script:RepoRoot ls-files -- '.github/skills/rpi-*')
184+
$markdownlintConfig = Get-Content -Path (Join-Path $script:RepoRoot '.markdownlint-cli2.jsonc') -Raw
185+
$cspellConfig = Get-Content -Path (Join-Path $script:RepoRoot '.cspell.json') -Raw
186+
$trackingInstruction = '.github/instructions/hve-core/copilot-tracking.instructions.md'
187+
$trackedFiles = @(git -C $script:RepoRoot ls-files -- '.github/skills/rpi-*' $trackingInstruction)
171188

172189
$gitignore | Should -Match '(?m)^\.github/skills/rpi-\*/$'
190+
$gitignore | Should -Match (
191+
'(?m)^\.github/instructions/hve-core/copilot-tracking\.instructions\.md$'
192+
)
193+
$markdownlintConfig | Should -Match ([regex]::Escape($trackingInstruction))
194+
$cspellConfig | Should -Match ([regex]::Escape($trackingInstruction))
173195
$trackedFiles | Should -BeNullOrEmpty
174196
}
175197
}

0 commit comments

Comments
 (0)