forked from DamengDB/dmPython
-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (120 loc) · 5.17 KB
/
Copy pathintegration-tests.yml
File metadata and controls
139 lines (120 loc) · 5.17 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Integration Tests
on:
pull_request:
branches: [main]
workflow_dispatch:
schedule:
- cron: "0 18 * * *"
jobs:
pr-lightweight:
if: github.event_name == 'pull_request'
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"
cache-dependency-path: dpi_bridge/go.sum
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Check DM secrets availability
id: dm_ready
run: |
if [ -n "${{ secrets.DM_TEST_HOST }}" ] && [ -n "${{ secrets.DM_TEST_PORT }}" ] && [ -n "${{ secrets.DM_TEST_USER }}" ] && [ -n "${{ secrets.DM_TEST_PASSWORD }}" ]; then
echo "available=true" >> "$GITHUB_OUTPUT"
else
echo "available=false" >> "$GITHUB_OUTPUT"
fi
- name: Decode DPI headers
if: steps.dm_ready.outputs.available == 'true'
env:
DPI_HEADERS_TAR_B64: ${{ secrets.DPI_HEADERS_TAR_B64 }}
run: |
mkdir -p dpi_include
echo "$DPI_HEADERS_TAR_B64" | base64 -d | tar xzf - -C dpi_include/
- name: Build Go bridge library
if: steps.dm_ready.outputs.available == 'true'
run: |
cd dpi_bridge && go build -buildmode=c-shared -o libdmdpi.dylib .
install_name_tool -id @rpath/libdmdpi.dylib libdmdpi.dylib
- name: Build extension and run P0/P1
if: steps.dm_ready.outputs.available == 'true'
env:
DYLD_LIBRARY_PATH: ${{ github.workspace }}/dpi_bridge
DM_TEST_HOST: ${{ secrets.DM_TEST_HOST }}
DM_TEST_PORT: ${{ secrets.DM_TEST_PORT }}
DM_TEST_USER: ${{ secrets.DM_TEST_USER }}
DM_TEST_PASSWORD: ${{ secrets.DM_TEST_PASSWORD }}
DM_TEST_BOUNDARY_SIZES: ${{ secrets.DM_TEST_BOUNDARY_SIZES }}
run: |
python -m pip install pytest pytest-timeout pytest-cov
python setup.py build_ext --inplace
python -m pytest -q tests/integration -m "p0_stability or p1_contract" --cov=. --cov-report=term-missing --cov-report=xml:coverage.xml
- name: Upload coverage report (PR)
if: steps.dm_ready.outputs.available == 'true'
uses: actions/upload-artifact@v4
with:
name: coverage-pr
path: coverage.xml
- name: Skip lightweight integration tests
if: steps.dm_ready.outputs.available != 'true'
run: echo "Skipping PR integration tests: DM secrets are not configured."
full-regression:
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"
cache-dependency-path: dpi_bridge/go.sum
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Check DM secrets availability
id: dm_ready
run: |
if [ -n "${{ secrets.DM_TEST_HOST }}" ] && [ -n "${{ secrets.DM_TEST_PORT }}" ] && [ -n "${{ secrets.DM_TEST_USER }}" ] && [ -n "${{ secrets.DM_TEST_PASSWORD }}" ]; then
echo "available=true" >> "$GITHUB_OUTPUT"
else
echo "available=false" >> "$GITHUB_OUTPUT"
fi
- name: Decode DPI headers
if: steps.dm_ready.outputs.available == 'true'
env:
DPI_HEADERS_TAR_B64: ${{ secrets.DPI_HEADERS_TAR_B64 }}
run: |
mkdir -p dpi_include
echo "$DPI_HEADERS_TAR_B64" | base64 -d | tar xzf - -C dpi_include/
- name: Build Go bridge library
if: steps.dm_ready.outputs.available == 'true'
run: |
cd dpi_bridge && go build -buildmode=c-shared -o libdmdpi.dylib .
install_name_tool -id @rpath/libdmdpi.dylib libdmdpi.dylib
- name: Build extension and run P0/P1/P2
if: steps.dm_ready.outputs.available == 'true'
env:
DYLD_LIBRARY_PATH: ${{ github.workspace }}/dpi_bridge
DM_TEST_HOST: ${{ secrets.DM_TEST_HOST }}
DM_TEST_PORT: ${{ secrets.DM_TEST_PORT }}
DM_TEST_USER: ${{ secrets.DM_TEST_USER }}
DM_TEST_PASSWORD: ${{ secrets.DM_TEST_PASSWORD }}
DM_TEST_BOUNDARY_SIZES: ${{ secrets.DM_TEST_BOUNDARY_SIZES }}
DM_TEST_STRESS_ROWS: ${{ secrets.DM_TEST_STRESS_ROWS }}
DM_TEST_STRESS_WORKERS: ${{ secrets.DM_TEST_STRESS_WORKERS }}
DM_TEST_CHURN_LOOPS: ${{ secrets.DM_TEST_CHURN_LOOPS }}
DM_TEST_GC_LOOPS: ${{ secrets.DM_TEST_GC_LOOPS }}
run: |
python -m pip install pytest pytest-timeout pytest-cov
python setup.py build_ext --inplace
python -m pytest -q tests/integration -m "p0_stability or p1_contract or p2_scale" --cov=. --cov-report=term-missing --cov-report=xml:coverage.xml
- name: Upload coverage report (full)
if: steps.dm_ready.outputs.available == 'true'
uses: actions/upload-artifact@v4
with:
name: coverage-full
path: coverage.xml
- name: Skip full integration tests
if: steps.dm_ready.outputs.available != 'true'
run: echo "Skipping full integration tests: DM secrets are not configured."