Skip to content

Commit 259056f

Browse files
committed
Run Windows integration tests on Azure Pipelines.
1 parent a542ca0 commit 259056f

File tree

3 files changed

+74
-1
lines changed

3 files changed

+74
-1
lines changed

.ci/build-steps.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ steps:
3434
artifactName: 'MySqlConnector.Tests-2.1-$(Agent.OS)'
3535
targetPath: 'tests/MySqlConnector.Tests/bin/Release/netcoreapp2.1/publish'
3636

37+
- task: DotNetCoreCLI@2
38+
displayName: 'Publish Conformance.Tests'
39+
inputs:
40+
command: 'publish'
41+
arguments: '-c Release -f netcoreapp3.0 tests/Conformance.Tests/Conformance.Tests.csproj'
42+
publishWebProjects: false
43+
zipAfterPublish: false
44+
- task: PublishPipelineArtifact@0
45+
inputs:
46+
artifactName: 'Conformance.Tests-3.0-$(Agent.OS)'
47+
targetPath: 'tests/Conformance.Tests/bin/Release/netcoreapp3.0/publish'
48+
3749
- task: DotNetCoreCLI@2
3850
displayName: 'Publish SideBySide (2.0)'
3951
inputs:

azure-pipelines.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,67 @@ jobs:
125125
steps:
126126
- template: '.ci/mysqlconnector-tests-steps.yml'
127127

128+
- job: windows_integration_tests
129+
dependsOn: windows_build
130+
displayName: 'Windows Integration Tests'
131+
pool:
132+
vmimage: 'windows-latest'
133+
steps:
134+
- script: |
135+
mkdir C:\mysql
136+
CD /D C:\mysql
137+
curl -fsS --retry 3 --retry-connrefused -o mysql.msi https://cdn.mysql.com/archives/mysql-installer/mysql-installer-community-8.0.15.0.msi
138+
msiexec /q /log install.txt /i mysql.msi datadir=C:\mysql installdir=C:\mysql
139+
call "C:\Program Files (x86)\MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe" community install server;8.0.15;x64:*:port=3306;rootpasswd=test;servicename=MySQL -silent
140+
netsh advfirewall firewall add rule name="Allow mysql" dir=in action=allow edge=yes remoteip=any protocol=TCP localport=3306
141+
displayName: Install MySQL Server
142+
- script: |
143+
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -uroot -ptest -e "SET GLOBAL local_infile=1; SET GLOBAL log_bin_trust_function_creators=1;"
144+
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -uroot -ptest -e "CREATE SCHEMA conformance COLLATE utf8mb4_bin;"
145+
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -uroot -ptest < $(Build.Repository.LocalPath)\.ci\server\init.sql
146+
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -uroot -ptest < $(Build.Repository.LocalPath)\.ci\server\init_sha256.sql
147+
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -uroot -ptest < $(Build.Repository.LocalPath)\.ci\server\init_caching_sha2.sql
148+
displayName: Configure MySQL Server
149+
- task: UseDotNet@2
150+
displayName: 'Install .NET Core'
151+
inputs:
152+
version: $(DotNetCoreSdkVersion)
153+
- task: DownloadPipelineArtifact@0
154+
condition: always()
155+
inputs:
156+
artifactName: 'Conformance.Tests-3.0-$(Agent.OS)'
157+
targetPath: '$(Build.BinariesDirectory)/3.0'
158+
- task: DotNetCoreCLI@2
159+
displayName: 'Windows Conformance Tests'
160+
inputs:
161+
command: 'custom'
162+
custom: 'vstest'
163+
arguments: '$(Build.BinariesDirectory)/3.0/Conformance.Tests.dll /logger:trx'
164+
env:
165+
CONNECTION_STRING: 'server=localhost;port=3306;user id=mysqltest;password=test;database=conformance;ssl mode=none;DefaultCommandTimeout=3600;AllowPublicKeyRetrieval=True'
166+
TF_BUILD: $(TF_BUILD)
167+
- task: PublishTestResults@2
168+
condition: always()
169+
inputs:
170+
testResultsFormat: VSTest
171+
testResultsFiles: '**/*.trx'
172+
testRunTitle: 'Windows Conformance Tests'
173+
failTaskOnFailedTests: true
174+
- template: '.ci/sidebyside-test-steps.yml'
175+
parameters:
176+
image: 'mysql-8.0.15'
177+
unsupportedFeatures: 'Ed25519,Tls11,UnixDomainSocket'
178+
connectionString: 'server=localhost;port=3306;user id=mysqltest;password=test;database=mysqltest;ssl mode=none;DefaultCommandTimeout=3600;AllowPublicKeyRetrieval=True'
179+
platform: 'netcoreapp3.0'
180+
description: 'No SSL'
181+
- template: '.ci/sidebyside-test-steps.yml'
182+
parameters:
183+
image: 'mysql-8.0.15'
184+
unsupportedFeatures: 'Ed25519,Tls11,UnixDomainSocket'
185+
connectionString: 'server=localhost;port=3306;user id=mysqltest;password=test;database=mysqltest;ssl mode=none;UseCompression=True;DefaultCommandTimeout=3600;AllowPublicKeyRetrieval=True'
186+
platform: 'netcoreapp3.0'
187+
description: 'Compression, No SSL'
188+
128189
- job: linux_integration_tests
129190
dependsOn: linux_build
130191
displayName: 'Linux Tests'

tests/Conformance.Tests/Conformance.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp3.0</TargetFrameworks>
55
<VersionPrefix>0.1.0</VersionPrefix>
66
<SignAssembly>true</SignAssembly>
77
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>

0 commit comments

Comments
 (0)