Skip to content

Commit 5a0c911

Browse files
committed
Normalize eol
1 parent f3d651a commit 5a0c911

30 files changed

+3950
-3948
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text=auto
2+

.github/workflows/golangci-lint.yml

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
name: golangci-lint
2-
on:
3-
push:
4-
branches:
5-
- main
6-
pull_request:
7-
jobs:
8-
golangci-pr:
9-
name: lint-pr-changes
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/setup-go@v3
13-
with:
14-
go-version: 1.18
15-
- uses: actions/checkout@v3
16-
- name: golangci-lint
17-
uses: golangci/golangci-lint-action@v3
18-
with:
19-
version: latest
20-
only-new-issues: true
1+
name: golangci-lint
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
jobs:
8+
golangci-pr:
9+
name: lint-pr-changes
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/setup-go@v3
13+
with:
14+
go-version: 1.18
15+
- uses: actions/checkout@v3
16+
- name: golangci-lint
17+
uses: golangci/golangci-lint-action@v3
18+
with:
19+
version: latest
20+
only-new-issues: true

.pipelines/TestSql2017.yml

+53-53
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
1-
variables:
2-
# AZURE_CLIENT_SECRET and SQLPASSWORD must be defined as secret variables in the pipeline.
3-
# AZURE_TENANT_ID and AZURE_CLIENT_ID are not expected to be secret variables, just regular variables
4-
AZURECLIENTSECRET: $(AZURE_CLIENT_SECRET)
5-
PASSWORD: $(SQLPASSWORD)
6-
pool:
7-
vmImage: 'ubuntu-latest'
8-
9-
steps:
10-
- template: include-install-go-tools.yml
11-
12-
- task: Docker@2
13-
displayName: 'Run SQL 2017 docker image'
14-
inputs:
15-
command: run
16-
arguments: '-m 2GB -e ACCEPT_EULA=1 -d --name sql2017 -p:1433:1433 -e SA_PASSWORD=$(PASSWORD) mcr.microsoft.com/mssql/server:2017-latest'
17-
18-
- template: include-runtests-linux.yml
19-
parameters:
20-
RunName: 'SQL2017'
21-
SQLCMDUSER: sa
22-
SQLPASSWORD: $(PASSWORD)
23-
24-
- template: include-runtests-linux.yml
25-
parameters:
26-
RunName: 'SQLDB'
27-
# AZURESERVER must be defined as a variable in the pipeline
28-
SQLCMDSERVER: $(AZURESERVER)
29-
AZURECLIENTSECRET: $(AZURECLIENTSECRET)
30-
31-
- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@4
32-
displayName: Merge coverage data
33-
inputs:
34-
reports: '**/*.coverage.xml"' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
35-
targetdir: 'coverage' # REQUIRED # The directory where the generated report should be saved.
36-
reporttypes: 'HtmlInline_AzurePipelines;Cobertura' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MarkdownSummary, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary
37-
sourcedirs: '$(Build.SourcesDirectory)' # Optional directories which contain the corresponding source code (separated by semicolon). The source directories are used if coverage report contains classes without path information.
38-
verbosity: 'Info' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off
39-
tag: '$(build.buildnumber)_#$(build.buildid)_$(Build.SourceBranchName)' # Optional tag or build version.
40-
- task: PublishCodeCoverageResults@1
41-
inputs:
42-
codeCoverageTool: Cobertura
43-
pathToSources: '$(Build.SourcesDirectory)'
44-
summaryFileLocation: $(Build.SourcesDirectory)/coverage/*.xml
45-
reportDirectory: $(Build.SourcesDirectory)/coverage
46-
failIfCoverageEmpty: true
47-
condition: always()
48-
continueOnError: true
49-
env:
50-
disable.coverage.autogenerate: 'true'
51-
52-
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
53-
displayName: ‘Component Detection’
1+
variables:
2+
# AZURE_CLIENT_SECRET and SQLPASSWORD must be defined as secret variables in the pipeline.
3+
# AZURE_TENANT_ID and AZURE_CLIENT_ID are not expected to be secret variables, just regular variables
4+
AZURECLIENTSECRET: $(AZURE_CLIENT_SECRET)
5+
PASSWORD: $(SQLPASSWORD)
6+
pool:
7+
vmImage: 'ubuntu-latest'
8+
9+
steps:
10+
- template: include-install-go-tools.yml
11+
12+
- task: Docker@2
13+
displayName: 'Run SQL 2017 docker image'
14+
inputs:
15+
command: run
16+
arguments: '-m 2GB -e ACCEPT_EULA=1 -d --name sql2017 -p:1433:1433 -e SA_PASSWORD=$(PASSWORD) mcr.microsoft.com/mssql/server:2017-latest'
17+
18+
- template: include-runtests-linux.yml
19+
parameters:
20+
RunName: 'SQL2017'
21+
SQLCMDUSER: sa
22+
SQLPASSWORD: $(PASSWORD)
23+
24+
- template: include-runtests-linux.yml
25+
parameters:
26+
RunName: 'SQLDB'
27+
# AZURESERVER must be defined as a variable in the pipeline
28+
SQLCMDSERVER: $(AZURESERVER)
29+
AZURECLIENTSECRET: $(AZURECLIENTSECRET)
30+
31+
- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@4
32+
displayName: Merge coverage data
33+
inputs:
34+
reports: '**/*.coverage.xml"' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
35+
targetdir: 'coverage' # REQUIRED # The directory where the generated report should be saved.
36+
reporttypes: 'HtmlInline_AzurePipelines;Cobertura' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MarkdownSummary, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary
37+
sourcedirs: '$(Build.SourcesDirectory)' # Optional directories which contain the corresponding source code (separated by semicolon). The source directories are used if coverage report contains classes without path information.
38+
verbosity: 'Info' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off
39+
tag: '$(build.buildnumber)_#$(build.buildid)_$(Build.SourceBranchName)' # Optional tag or build version.
40+
- task: PublishCodeCoverageResults@1
41+
inputs:
42+
codeCoverageTool: Cobertura
43+
pathToSources: '$(Build.SourcesDirectory)'
44+
summaryFileLocation: $(Build.SourcesDirectory)/coverage/*.xml
45+
reportDirectory: $(Build.SourcesDirectory)/coverage
46+
failIfCoverageEmpty: true
47+
condition: always()
48+
continueOnError: true
49+
env:
50+
disable.coverage.autogenerate: 'true'
51+
52+
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
53+
displayName: ‘Component Detection’
+35-35
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
steps:
2-
- task: GoTool@0
3-
inputs:
4-
version: '1.18'
5-
- task: Go@0
6-
displayName: 'Go: get dependencies'
7-
inputs:
8-
command: 'get'
9-
arguments: '-d'
10-
workingDirectory: '$(Build.SourcesDirectory)/cmd/sqlcmd'
11-
12-
13-
- task: Go@0
14-
displayName: 'Go: install gotest.tools/gotestsum'
15-
inputs:
16-
command: 'custom'
17-
customCommand: 'install'
18-
arguments: 'gotest.tools/gotestsum@latest'
19-
workingDirectory: '$(System.DefaultWorkingDirectory)'
20-
21-
- task: Go@0
22-
displayName: 'Go: install github.com/axw/gocov/gocov'
23-
inputs:
24-
command: 'custom'
25-
customCommand: 'install'
26-
arguments: 'github.com/axw/gocov/gocov@latest'
27-
workingDirectory: '$(System.DefaultWorkingDirectory)'
28-
29-
- task: Go@0
30-
displayName: 'Go: install github.com/axw/gocov/gocov'
31-
inputs:
32-
command: 'custom'
33-
customCommand: 'install'
34-
arguments: 'github.com/AlekSi/gocov-xml@latest'
35-
workingDirectory: '$(System.DefaultWorkingDirectory)'
1+
steps:
2+
- task: GoTool@0
3+
inputs:
4+
version: '1.18'
5+
- task: Go@0
6+
displayName: 'Go: get dependencies'
7+
inputs:
8+
command: 'get'
9+
arguments: '-d'
10+
workingDirectory: '$(Build.SourcesDirectory)/cmd/sqlcmd'
11+
12+
13+
- task: Go@0
14+
displayName: 'Go: install gotest.tools/gotestsum'
15+
inputs:
16+
command: 'custom'
17+
customCommand: 'install'
18+
arguments: 'gotest.tools/gotestsum@latest'
19+
workingDirectory: '$(System.DefaultWorkingDirectory)'
20+
21+
- task: Go@0
22+
displayName: 'Go: install github.com/axw/gocov/gocov'
23+
inputs:
24+
command: 'custom'
25+
customCommand: 'install'
26+
arguments: 'github.com/axw/gocov/gocov@latest'
27+
workingDirectory: '$(System.DefaultWorkingDirectory)'
28+
29+
- task: Go@0
30+
displayName: 'Go: install github.com/axw/gocov/gocov'
31+
inputs:
32+
command: 'custom'
33+
customCommand: 'install'
34+
arguments: 'github.com/AlekSi/gocov-xml@latest'
35+
workingDirectory: '$(System.DefaultWorkingDirectory)'
3636

.pipelines/include-runtests-linux.yml

+46-46
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
1-
parameters:
2-
- name: RunName
3-
type: string
4-
- name: SQLCMDUSER
5-
type: string
6-
default: ''
7-
- name: SQLPASSWORD
8-
type: string
9-
default: ''
10-
- name: AZURECLIENTSECRET
11-
type: string
12-
default: ''
13-
- name: SQLCMDSERVER
14-
type: string
15-
default: .
16-
- name: SQLCMDDBNAME
17-
type: string
18-
default: ''
19-
steps:
20-
- script: |
21-
~/go/bin/gotestsum --junitfile "${{ parameters.RunName }}.testresults.xml" -- ./... -coverprofile="${{ parameters.RunName }}.coverage.txt" -covermode count
22-
~/go/bin/gocov convert "${{ parameters.RunName }}.coverage.txt" > "${{ parameters.RunName }}.coverage.json"
23-
~/go/bin/gocov-xml < "${{ parameters.RunName }}.coverage.json" > ${{ parameters.RunName }}.coverage.xml
24-
mkdir -p coverage
25-
workingDirectory: '$(Build.SourcesDirectory)'
26-
displayName: 'run tests'
27-
env:
28-
SQLPASSWORD: ${{ parameters.SQLPASSWORD }}
29-
SQLCMDUSER: ${{ parameters.SQLCMDUSER }}
30-
SQLCMDPASSWORD: ${{ parameters.SQLPASSWORD }}
31-
AZURE_TENANT_ID: $(AZURE_TENANT_ID)
32-
AZURE_CLIENT_ID: $(AZURE_CLIENT_ID)
33-
AZURE_CLIENT_SECRET: ${{ parameters.AZURECLIENTSECRET }}
34-
SQLCMDSERVER: ${{ parameters.SQLCMDSERVER }}
35-
SQLCMDDBNAME: ${{ parameters.SQLCMDDBNAME }}
36-
continueOnError: true
37-
38-
- task: PublishTestResults@2
39-
displayName: "Publish junit-style results"
40-
inputs:
41-
testResultsFiles: '${{ parameters.RunName }}.testresults.xml'
42-
testResultsFormat: JUnit
43-
searchFolder: '$(Build.SourcesDirectory)'
44-
testRunTitle: '${{ parameters.RunName }} - $(Build.SourceBranchName)'
45-
failTaskOnFailedTests: true
46-
condition: always()
1+
parameters:
2+
- name: RunName
3+
type: string
4+
- name: SQLCMDUSER
5+
type: string
6+
default: ''
7+
- name: SQLPASSWORD
8+
type: string
9+
default: ''
10+
- name: AZURECLIENTSECRET
11+
type: string
12+
default: ''
13+
- name: SQLCMDSERVER
14+
type: string
15+
default: .
16+
- name: SQLCMDDBNAME
17+
type: string
18+
default: ''
19+
steps:
20+
- script: |
21+
~/go/bin/gotestsum --junitfile "${{ parameters.RunName }}.testresults.xml" -- ./... -coverprofile="${{ parameters.RunName }}.coverage.txt" -covermode count
22+
~/go/bin/gocov convert "${{ parameters.RunName }}.coverage.txt" > "${{ parameters.RunName }}.coverage.json"
23+
~/go/bin/gocov-xml < "${{ parameters.RunName }}.coverage.json" > ${{ parameters.RunName }}.coverage.xml
24+
mkdir -p coverage
25+
workingDirectory: '$(Build.SourcesDirectory)'
26+
displayName: 'run tests'
27+
env:
28+
SQLPASSWORD: ${{ parameters.SQLPASSWORD }}
29+
SQLCMDUSER: ${{ parameters.SQLCMDUSER }}
30+
SQLCMDPASSWORD: ${{ parameters.SQLPASSWORD }}
31+
AZURE_TENANT_ID: $(AZURE_TENANT_ID)
32+
AZURE_CLIENT_ID: $(AZURE_CLIENT_ID)
33+
AZURE_CLIENT_SECRET: ${{ parameters.AZURECLIENTSECRET }}
34+
SQLCMDSERVER: ${{ parameters.SQLCMDSERVER }}
35+
SQLCMDDBNAME: ${{ parameters.SQLCMDDBNAME }}
36+
continueOnError: true
37+
38+
- task: PublishTestResults@2
39+
displayName: "Publish junit-style results"
40+
inputs:
41+
testResultsFiles: '${{ parameters.RunName }}.testresults.xml'
42+
testResultsFormat: JUnit
43+
searchFolder: '$(Build.SourcesDirectory)'
44+
testRunTitle: '${{ parameters.RunName }} - $(Build.SourceBranchName)'
45+
failTaskOnFailedTests: true
46+
condition: always()

SUPPORT.md

+25-25
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# TODO: The maintainer of this repo has not yet edited this file
2-
3-
**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project?
4-
5-
- **No CSS support:** Fill out this template with information about how to file issues and get help.
6-
- **Yes CSS support:** Fill out an intake form at [aka.ms/spot](https://aka.ms/spot). CSS will work with/help you to determine next steps. More details also available at [aka.ms/onboardsupport](https://aka.ms/onboardsupport).
7-
- **Not sure?** Fill out a SPOT intake as though the answer were "Yes". CSS will help you decide.
8-
9-
*Then remove this first heading from this SUPPORT.MD file before publishing your repo.*
10-
11-
# Support
12-
13-
## How to file issues and get help
14-
15-
This project uses GitHub Issues to track bugs and feature requests. Please search the existing
16-
issues before filing new issues to avoid duplicates. For new issues, file your bug or
17-
feature request as a new Issue.
18-
19-
For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE
20-
FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER
21-
CHANNEL. WHERE WILL YOU HELP PEOPLE?**.
22-
23-
## Microsoft Support Policy
24-
25-
Support for this **PROJECT or PRODUCT** is limited to the resources listed above.
1+
# TODO: The maintainer of this repo has not yet edited this file
2+
3+
**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project?
4+
5+
- **No CSS support:** Fill out this template with information about how to file issues and get help.
6+
- **Yes CSS support:** Fill out an intake form at [aka.ms/spot](https://aka.ms/spot). CSS will work with/help you to determine next steps. More details also available at [aka.ms/onboardsupport](https://aka.ms/onboardsupport).
7+
- **Not sure?** Fill out a SPOT intake as though the answer were "Yes". CSS will help you decide.
8+
9+
*Then remove this first heading from this SUPPORT.MD file before publishing your repo.*
10+
11+
# Support
12+
13+
## How to file issues and get help
14+
15+
This project uses GitHub Issues to track bugs and feature requests. Please search the existing
16+
issues before filing new issues to avoid duplicates. For new issues, file your bug or
17+
feature request as a new Issue.
18+
19+
For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE
20+
FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER
21+
CHANNEL. WHERE WILL YOU HELP PEOPLE?**.
22+
23+
## Microsoft Support Policy
24+
25+
Support for this **PROJECT or PRODUCT** is limited to the resources listed above.

0 commit comments

Comments
 (0)