-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy path.build-local-unit-tests.ps1
More file actions
51 lines (43 loc) · 1.42 KB
/
Copy path.build-local-unit-tests.ps1
File metadata and controls
51 lines (43 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<#
.SYNOPSIS
Runs a single CosmosDB unit test suite in a fresh pwsh session.
.DESCRIPTION
Convenience wrapper around tests/scripts/Invoke-UnitTests.ps1 that runs a
single unit test suite without requiring Azure credentials. Each invocation
starts a new pwsh process so that CosmosDB.dll is not locked from a previous
build or test run.
.PARAMETER ResourceType
The resource type whose unit test suite to run. Must match one of the
CosmosDB.<ResourceType>.Tests.ps1 files in tests/Unit/.
.EXAMPLE
./.build-local-unit-tests.ps1 -ResourceType accounts
Runs the accounts unit test suite.
.EXAMPLE
./.build-local-unit-tests.ps1 -ResourceType users
Runs the users unit test suite.
.NOTES
Run ./.build-local.ps1 -Tasks build before running unit tests for the first
time, or after editing source files, to ensure the module output is up to date.
#>
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[ValidateSet(
'accounts',
'attachments',
'collections',
'databases',
'documents',
'generic',
'offers',
'permissions',
'storedprocedures',
'triggers',
'userdefinedfunctions',
'users',
'utils'
)]
[System.String] $ResourceType
)
& pwsh -NoProfile -File (Join-Path -Path $PSScriptRoot -ChildPath 'tests/scripts/Invoke-UnitTests.ps1') -ResourceType $ResourceType
exit $LASTEXITCODE