Skip to content

Commit 9aa3884

Browse files
msrathore-dbclaude
andcommitted
feat(csharp): add E2E tests CI workflow
Add GitHub Actions workflow for E2E testing with Databricks: - New workflow file for running E2E tests on push/PR - Uses direct token authentication (no OIDC) - Only runs on PRs from the repo itself (not forks) - Test script filters for E2E tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6608390 commit 9aa3884

File tree

2 files changed

+112
-0
lines changed

2 files changed

+112
-0
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: E2E Tests
19+
20+
on:
21+
push:
22+
branches:
23+
- main
24+
paths:
25+
- '.github/workflows/e2e-tests.yml'
26+
- 'csharp/src/**'
27+
- 'csharp/test/**'
28+
pull_request:
29+
# Only runs on PRs from the repo itself, not forks
30+
paths:
31+
- '.github/workflows/e2e-tests.yml'
32+
- 'csharp/src/**'
33+
- 'csharp/test/**'
34+
35+
concurrency:
36+
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
37+
cancel-in-progress: true
38+
39+
jobs:
40+
run-e2e-tests:
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 15
43+
env:
44+
DATABRICKS_SERVER_HOSTNAME: ${{ secrets.DATABRICKS_HOST }}
45+
DATABRICKS_HTTP_PATH: ${{ secrets.TEST_PECO_WAREHOUSE_HTTP_PATH }}
46+
DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }}
47+
DATABRICKS_CATALOG: peco
48+
DATABRICKS_USER: ${{ secrets.TEST_PECO_SP_ID }}
49+
steps:
50+
- name: Checkout repository
51+
uses: actions/checkout@v4
52+
with:
53+
submodules: recursive
54+
55+
- name: Set up .NET
56+
uses: actions/setup-dotnet@v4
57+
with:
58+
dotnet-version: '8.0.x'
59+
60+
- name: Create Databricks config file
61+
run: |
62+
mkdir -p ~/.databricks
63+
cat > ~/.databricks/connection.json << EOF
64+
{
65+
"uri": "https://${{ env.DATABRICKS_SERVER_HOSTNAME }}${{ env.DATABRICKS_HTTP_PATH }}",
66+
"adbc.spark.auth_type": "token",
67+
"adbc.spark.access_token": "${{ env.DATABRICKS_TOKEN }}",
68+
"adbc.connection.catalog": "${{ env.DATABRICKS_CATALOG }}",
69+
"adbc.connection.db_schema": "default",
70+
"adbc.drivers.databricks.enable_multiple_catalog_support": "true",
71+
"adbc.drivers.databricks.enable_direct_results": "true"
72+
}
73+
EOF
74+
echo "DATABRICKS_TEST_CONFIG_FILE=$HOME/.databricks/connection.json" >> $GITHUB_ENV
75+
76+
- name: Build
77+
shell: bash
78+
run: |
79+
./ci/scripts/csharp_build.sh "${{ github.workspace }}"
80+
81+
- name: Test Databricks E2E
82+
shell: bash
83+
run: |
84+
./ci/scripts/csharp_test_databricks_e2e.sh "${{ github.workspace }}"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
set -ex
21+
22+
# Run Databricks driver E2E tests
23+
source_dir=${1}/csharp/test
24+
25+
pushd ${source_dir}
26+
# Run all E2E tests (matches E2E in class name or namespace)
27+
dotnet test --filter "FullyQualifiedName~E2ETest"
28+
popd

0 commit comments

Comments
 (0)