Skip to content

Commit e41e40b

Browse files
committed
Merge branch 'development' of https://github.com/LowlyDBA/dba-multitool into development
2 parents f37e70b + 5c7a693 commit e41e40b

24 files changed

+329
-424
lines changed

.github/CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You can help contribute by:
1919

2020
## Testing Locally
2121

22-
See the testing readme in `\tests\README.md`
22+
See the testing readme in the [tests directory README](../tests/README.md)
2323

2424
## Style Guide
2525

@@ -28,9 +28,8 @@ Think :tshirt:, not :necktie:
2828

2929
### T-SQL
3030

31-
While there is no hard rule on T-SQL style enforced or linted in this project, use
32-
your discretion to fit the existing style and favor readability over a strict
33-
adherence to a specific style.
31+
T-SQL is linted against this [configuration](../appveyor/tsqllint)
32+
of TSQLLint via a Pester test.
3433

3534
### Markdown
3635

@@ -46,7 +45,8 @@ for your commits to be automatically linted using Github Actions.
4645

4746
PowerShell is only used in the automation piece of this project, but could probably
4847
benefit from being better documented and standardized. Right now no particular
49-
style is enforced, but one may be used in the future.
48+
style is enforced,
49+
but [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) is recommended.
5050

5151
[mdconfig]: https://github.com/LowlyDBA/dba-multitool/blob/master/.github/linters/.markdown-lint.yml
5252
[mdlint]: https://github.com/DavidAnson/markdownlint

appveyor/appveyor.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ version: 1.5.{build}
33
pull_requests:
44
do_not_increment_build_number: false
55
max_jobs: 2
6+
build: off
67

78
environment:
89
access_token:
@@ -75,11 +76,6 @@ install:
7576
- ps: .\appveyor\start_sqlserver.ps1
7677
- ps: .\appveyor\install_tsqlt.ps1
7778

78-
build_script:
79-
- ps: .\appveyor\generate_combined_script.ps1
80-
- ps: .\appveyor\install_tool.ps1
81-
- ps: .\appveyor\build_tsqlt_tests.ps1
82-
8379
# Non-covered test run
8480
test_script:
8581
- ps: .\appveyor\run_pester_tests.ps1
@@ -93,7 +89,8 @@ for:
9389

9490
# Setup codecov, SQL Cover
9591
before_test:
96-
- ps: .\appveyor\install_coverage_dependencies.ps1
92+
- ps: .\appveyor\install_dependencies.ps1 -CodeCoverage
93+
- ps: choco install codecov --no-progress --limit-output | Out-Null
9794

9895
# Run tests with SQL Cover analysis
9996
test_script:

appveyor/build_tsqlt_tests.ps1

Lines changed: 0 additions & 29 deletions
This file was deleted.

appveyor/generate_combined_script.ps1

Lines changed: 0 additions & 8 deletions
This file was deleted.

appveyor/generate_sample_markdown.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ param(
66
[string]$User = $env:AZURE_SQL_USER,
77
[string]$Pass = $env:AZURE_SQL_PASS,
88
[string]$Color = "Green"
9-
)
9+
)
1010

1111
$ErrorActionPreference = "Stop";
1212
$Url = "https://github.com/Microsoft/sql-server-samples/releases/download/wide-world-importers-v1.0/WideWorldImporters-Full.bak"

appveyor/install_azuresql.ps1

Lines changed: 0 additions & 16 deletions
This file was deleted.

appveyor/install_coverage_dependencies.ps1

Lines changed: 0 additions & 5 deletions
This file was deleted.

appveyor/install_dependencies.ps1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
param(
22
[Parameter()]
3+
[switch]$CodeCoverage,
34
$Color = "Green"
45
)
56

@@ -28,10 +29,18 @@ if (!(Get-Module -Name Pester | Where-Object { $PSItem.Version -lt 5.0.0 })) {
2829
Import-Module Pester -MinimumVersion 4.0.0
2930
}
3031

32+
# GoEddie SQLCover
33+
If ($CodeCoverage.IsPresent) {
34+
# Install code coverage tool
35+
If (!(Get-Package -Name GOEddie.SQLCover -ErrorAction SilentlyContinue)) {
36+
Install-Package GOEddie.SQLCover -Force | Out-Null
37+
}
38+
}
39+
3140
# Wait for Jobs before proceeding
3241
If ($TSQLLintJob) {
3342
Wait-Job $TSQLLintJob.Id | Out-Null
3443
}
3544
If ($DbaToolsJob) {
3645
Wait-Job $DbaToolsJob.Id | Out-Null
37-
}
46+
}

appveyor/install_tool.ps1

Lines changed: 0 additions & 26 deletions
This file was deleted.

appveyor/install_tsqlt.ps1

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,22 @@ param(
1414

1515
Write-Host "Installing tSQLt..." -ForegroundColor $Color
1616

17-
If ($IsAzureSQL) {
18-
$PWord = ConvertTo-SecureString -String $Pass -AsPlainText -Force
19-
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $PWord
17+
$Hash = @{
18+
SqlInstance = $SqlInstance
19+
Database = $Database
20+
EnableException = $true
21+
}
2022

21-
$hash = @{
22-
SqlInstance = $SqlInstance
23-
Database = $Database
24-
File = $tSQLtInstallScript
25-
SqlCredential = $Credential
26-
}
23+
If ($IsAzureSQL) {
24+
$SecPass = ConvertTo-SecureString -String $Pass -AsPlainText -Force
25+
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $SecPass
26+
$Hash.add("SqlCredential", $Credential)
2727

28-
Invoke-DbaQuery @hash
28+
Invoke-DbaQuery @hash -File $tSQLtInstallScript
2929
}
30+
3031
Else {
3132
Invoke-DbaQuery -SqlInstance $SqlInstance -Database $Master -File $clrscript | Out-Null
3233
Invoke-DbaQuery -SqlInstance $SqlInstance -Database $Master -File $CreateDBScript | Out-Null
33-
Invoke-DbaQuery -SqlInstance $SqlInstance -Database $Database -File $tSQLtInstallScript -MessagesToOutput
34+
Invoke-DbaQuery @Hash -File $tSQLtInstallScript -MessagesToOutput
3435
}

0 commit comments

Comments
 (0)