-
Notifications
You must be signed in to change notification settings - Fork 11
115 lines (106 loc) · 4.09 KB
/
e2e-tests.yml
File metadata and controls
115 lines (106 loc) · 4.09 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Copyright (c) 2025 ADBC Drivers Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Tests Workflow
on:
push:
branches:
- main
paths:
- '.github/workflows/e2e-tests.yml'
- 'ci/scripts/**'
- 'csharp/src/**'
- 'csharp/test/**'
pull_request:
# Only runs on PRs from the repo itself, not forks
paths:
- '.github/workflows/e2e-tests.yml'
- 'ci/scripts/**'
- 'csharp/src/**'
- 'csharp/test/**'
concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
run-all-tests:
runs-on: ubuntu-latest
environment: azure-prod
env:
DATABRICKS_SERVER_HOSTNAME: ${{ secrets.DATABRICKS_HOST }}
DATABRICKS_HTTP_PATH: ${{ secrets.TEST_PECO_WAREHOUSE_HTTP_PATH }}
DATABRICKS_TEST_CLIENT_ID: ${{ secrets.DATABRICKS_TEST_CLIENT_ID }}
DATABRICKS_TEST_CLIENT_SECRET: ${{ secrets.DATABRICKS_TEST_CLIENT_SECRET }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
- name: Generate OAuth access token
id: oauth
run: |
OAUTH_RESPONSE=$(curl -s -X POST "https://${{ env.DATABRICKS_SERVER_HOSTNAME }}/oidc/v1/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=${{ env.DATABRICKS_TEST_CLIENT_ID }}" \
-d "client_secret=${{ env.DATABRICKS_TEST_CLIENT_SECRET }}" \
-d "scope=sql")
OAUTH_TOKEN=$(echo "$OAUTH_RESPONSE" | python3 -c "import sys, json; print(json.load(sys.stdin)['access_token'])")
if [ -z "$OAUTH_TOKEN" ]; then
echo "ERROR: Failed to generate OAuth token"
exit 1
fi
echo "::add-mask::$OAUTH_TOKEN"
echo "OAUTH_TOKEN=$OAUTH_TOKEN" >> $GITHUB_OUTPUT
- name: Create Databricks config file
run: |
mkdir -p ~/.databricks
cat > ~/.databricks/connection.json << EOF
{
"uri": "https://${{ env.DATABRICKS_SERVER_HOSTNAME }}${{ env.DATABRICKS_HTTP_PATH }}",
"auth_type": "oauth",
"grant_type": "client_credentials",
"client_id": "${{ env.DATABRICKS_TEST_CLIENT_ID }}",
"client_secret": "${{ env.DATABRICKS_TEST_CLIENT_SECRET }}",
"scope": "sql",
"access_token": "${{ steps.oauth.outputs.OAUTH_TOKEN }}",
"type": "databricks",
"catalog": "main",
"db_schema": "adbc_testing",
"query": "SELECT * FROM main.adbc_testing.adbc_testing_table",
"expectedResults": 12,
"isCITesting": true,
"tracePropagationEnabled": "true",
"traceParentHeaderName": "traceparent",
"traceStateEnabled": "false",
"metadata": {
"catalog": "main",
"schema": "adbc_testing",
"table": "adbc_testing_table",
"expectedColumnCount": 19
}
}
EOF
echo "DATABRICKS_TEST_CONFIG_FILE=$HOME/.databricks/connection.json" >> $GITHUB_ENV
- name: Build
shell: bash
run: |
./ci/scripts/csharp_build.sh "${{ github.workspace }}"
- name: Run All Tests
shell: bash
run: |
export DATABRICKS_TEST_CONFIG_FILE="$HOME/.databricks/connection.json"
./ci/scripts/csharp_test_databricks_e2e.sh "${{ github.workspace }}"