Repository navigation
100 lines (96 loc) · 3.37 KB
/
Copy pathpython-integ-unity.yml
File metadata and controls
100 lines (96 loc) · 3.37 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
# 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: Python Unity Integration
on:
push:
branches:
- main
paths:
- python/src/lance_namespace_impls/unity.py
- python/src/lance_namespace_impls/rest_client.py
- python/tests/test_unity.py
- python/tests/test_unity_integration.py
- docker/unity/**
- .github/workflows/python-integ-unity.yml
pull_request:
types:
- opened
- synchronize
- ready_for_review
- reopened
paths:
- python/src/lance_namespace_impls/unity.py
- python/src/lance_namespace_impls/rest_client.py
- python/tests/test_unity.py
- python/tests/test_unity_integration.py
- docker/unity/**
- .github/workflows/python-integ-unity.yml
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
integration-test:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Start Unity Catalog
run: make docker-up-unity
- name: Wait for Unity Catalog to be ready
run: |
echo "Waiting for Unity Catalog to be ready..."
timeout 120 bash -c '
until curl -sf http://localhost:8080/api/2.1/unity-catalog/catalogs > /dev/null 2>&1; do
echo "Waiting for Unity Catalog API..."
sleep 5
done
' || {
echo "Timeout waiting for Unity Catalog"
docker compose -f docker/unity/docker-compose.yml logs
exit 1
}
echo "Unity Catalog is ready"
- name: Create test catalog
run: |
curl -s -X POST http://localhost:8080/api/2.1/unity-catalog/catalogs \
-H 'Content-Type: application/json' \
-d '{"name": "lance_test", "comment": "Test catalog for Lance integration tests"}' \
|| echo "Catalog may already exist"
curl -sf http://localhost:8080/api/2.1/unity-catalog/catalogs/lance_test || {
echo "Failed to create/verify test catalog"
exit 1
}
echo "Test catalog created/verified"
- name: Install dependencies
working-directory: python
run: make install-unity
- name: Run integration tests
run: make python-integ-test-unity
- name: Collect logs on failure
if: failure()
run: |
echo "=== Docker Compose Status ==="
docker compose -f docker/unity/docker-compose.yml ps
echo ""
echo "=== Unity Catalog Logs ==="
docker compose -f docker/unity/docker-compose.yml logs unity-catalog
- name: Cleanup
if: always()
run: make docker-down-unity