Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 12 additions & 6 deletions test/powershell/engine/ResourceValidation/LocProject.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

Describe "Localized resource files validation" -Tags "CI" {
Describe "LocProject.json file validation" -Tags "CI" {
BeforeAll {
$repoRoot = (Resolve-Path (Join-Path $PSScriptRoot ../../../..)).Path
## The 'LocProject.json' tests depend on running from a local PowerShell repo.
$skipTests = $env:PIPELINE_REPOSITORY_NAME -eq 'Release-Automation'
if ($skipTests) {
Write-Host "Skipping 'LocProject.json' tests in Release Automation." -ForegroundColor Yellow
return
}

$repoRoot = (Resolve-Path (Join-Path $PSScriptRoot ../../../..)).Path
$locProjectPath = Join-Path $repoRoot 'Localize' 'LocProject.json'
$content = Get-Content -Path $locProjectPath -Raw
$locProject = ConvertFrom-Json -InputObject $content
$content = Get-Content -Path $locProjectPath -Raw -ErrorAction Stop
$locProject = ConvertFrom-Json -InputObject $content -ErrorAction Stop
}

It 'Validate LocItems in LocProject.json' {
It 'Validate LocItems in LocProject.json' -Skip:$skipTests {
$locProject.Projects.Count | Should -Be 1
$project = $locProject.Projects[0]
$project.LanguageSet | Should -BeExactly 'VS_Main_Languages'
Expand All @@ -28,7 +34,7 @@ Describe "Localized resource files validation" -Tags "CI" {
}
}

It 'Validate total resource count' {
It 'Validate total resource count' -Skip:$skipTests {
$srcDir = Join-Path $repoRoot 'src'
$project = $locProject.Projects[0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Describe "Localized resource files validation" -Tags "CI" {

BeforeAll {
$repoSrcDir = (Resolve-Path (Join-Path $PSScriptRoot ../../../../src)).Path
$skipSatelliteAssemblyTest = !$IsWindows
if (!$skipSatelliteAssemblyTest -and $env:PIPELINE_REPOSITORY_NAME -eq 'Release-Automation') {
## Only MSIX packages include the localized satellite assemblies.
$isMSIXApp = Test-Path -Path (Join-Path $PSHOME 'AppxManifest.xml')
Comment thread
daxian-dbw marked this conversation as resolved.
$skipSatelliteAssemblyTest = -not $isMSIXApp
}

# Folders that exist in 'resources' folder but are not a localized resource directory.
$excludeDirs = @('Graphics')
Expand Down Expand Up @@ -87,7 +93,7 @@ Describe "Localized resource files validation" -Tags "CI" {
}
}

It "Satellite assemblies should be produced for '<Language>'" -TestCases $testCases2 -Skip:(!$IsWindows) {
It "Satellite assemblies should be produced for '<Language>'" -TestCases $testCases2 -Skip:$skipSatelliteAssemblyTest {
param($Language)

$satDir = Join-Path $PSHOME $Language
Expand Down
Loading