|
46 | 46 | new-item ${{ github.workspace }}/install -itemtype directory |
47 | 47 | new-item ${{ github.workspace }}/package -itemtype directory |
48 | 48 |
|
| 49 | + - name: Create Test Database |
| 50 | + run: | |
| 51 | + $timestamp = [math]::Round([double](Get-Date -UFormat %s) * 1000) |
| 52 | + $database = "test${timestamp}_odbc" |
| 53 | + "TEST_DATABASE=$database" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 |
| 54 | +
|
| 55 | + $creds = New-Object System.Management.Automation.PSCredential(` |
| 56 | + "default", (ConvertTo-SecureString "${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }}" ` |
| 57 | + -AsPlainText -Force)) |
| 58 | + Invoke-WebRequest -Uri "https://${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }}:8443/?query=" ` |
| 59 | + -Method POST ` |
| 60 | + -ContentType "text/plain" -Body "create database $database" ` |
| 61 | + -Credential $creds |
| 62 | +
|
| 63 | + - name: Print Test Database Name |
| 64 | + run: | |
| 65 | + Write-Host "The test database name is: $env:TEST_DATABASE" |
| 66 | +
|
49 | 67 | - name: Clone the repo |
50 | 68 | uses: actions/checkout@v4 |
51 | 69 | with: |
@@ -171,14 +189,14 @@ jobs: |
171 | 189 | -DriverName "ClickHouse ODBC Driver (ANSI)" ` |
172 | 190 | -DsnType "System" ` |
173 | 191 | -Platform "$platform" ` |
174 | | - -SetPropertyValue @("Url=${{ secrets.CLOUD_AWS_URL }}", "Compression=1") |
| 192 | + -SetPropertyValue @("Url=https://${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }}:8443/?database=$env:TEST_DATABASE", "Username=default", "Password=${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }}", "Compression=1") |
175 | 193 |
|
176 | 194 | Add-OdbcDsn ` |
177 | 195 | -Name "ClickHouse AWS Unicode ZSTD" ` |
178 | 196 | -DriverName "ClickHouse ODBC Driver (Unicode)" ` |
179 | 197 | -DsnType "System" ` |
180 | 198 | -Platform "$platform" ` |
181 | | - -SetPropertyValue @("Url=${{ secrets.CLOUD_AWS_URL }}", "Compression=1") |
| 199 | + -SetPropertyValue @("Url=https://${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }}:8443/?database=$env:TEST_DATABASE", "Username=default", "Password=${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }}", "Compression=1") |
182 | 200 |
|
183 | 201 | Write-Host "List of enabled DSNs:" |
184 | 202 | Get-OdbcDsn -DsnType "System" |
@@ -262,3 +280,18 @@ jobs: |
262 | 280 | tag: ${{ github.ref }} |
263 | 281 | file_glob: true |
264 | 282 |
|
| 283 | + - name: Drop Test Database |
| 284 | + if: ${{ github.event_name == 'release' && matrix.build_type == 'Release' }} |
| 285 | + run: | |
| 286 | + $creds = New-Object System.Management.Automation.PSCredential(` |
| 287 | + "default", (ConvertTo-SecureString "${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }}" ` |
| 288 | + -AsPlainText -Force)) |
| 289 | + $response = Invoke-WebRequest -Uri "https://${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }}:8443/?query=" ` |
| 290 | + -Method POST ` |
| 291 | + -ContentType "text/plain" -Body "select name from system.tables where database = '$env:TEST_DATABASE'" ` |
| 292 | + -Credential $creds |
| 293 | + $response.Content |
| 294 | + Invoke-WebRequest -Uri "https://${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }}:8443/?query=" ` |
| 295 | + -Method POST ` |
| 296 | + -ContentType "text/plain" -Body "drop database if exists $env:TEST_DATABASE" ` |
| 297 | + -Credential $creds |
0 commit comments