-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
146 lines (122 loc) · 5.51 KB
/
table-tests.yml
File metadata and controls
146 lines (122 loc) · 5.51 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
140
141
142
143
144
145
146
name: Table Tests
on:
push:
workflow_dispatch: # Allows manual triggering
jobs:
table-unit:
name: Table Node Tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9","3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install Node.js dependencies
run: npm ci
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install Python dependencies
run: pip install -e .[ci,dev,testing]
- name: Build
run: |
npm run build
- name: Lint
run: |
cd components/dash-table
npm ci
npm run lint
- name: Unit
run: |
cd components/dash-table
npm run test.unit
table-server:
name: Table Server Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12"] # Specify Python versions
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install Node.js dependencies
run: npm ci
- name: Install Google Chrome
run: |
sudo apt-get update
# Attempt to install a specific recent, stable version or just google-chrome-stable
# For more deterministic builds, you might consider a specific version if available via apt,
# or using a Docker image with Chrome pre-installed if extreme consistency is needed.
sudo apt-get install -y google-chrome-stable
- name: Install ChromeDriver
run: |
echo "Determining Chrome version..."
CHROME_BROWSER_VERSION=$(google-chrome --version)
echo "Installed Chrome Browser version: $CHROME_BROWSER_VERSION"
# Extract the major version number (e.g., 124 from "Google Chrome 124.0.6367.207")
CHROME_MAJOR_VERSION=$(echo "$CHROME_BROWSER_VERSION" | cut -f 3 -d ' ' | cut -f 1 -d '.')
echo "Detected Chrome Major version: $CHROME_MAJOR_VERSION"
# For Chrome 115 and later, use the new Chrome for Testing (CfT) JSON endpoints
if [ "$CHROME_MAJOR_VERSION" -ge 115 ]; then
echo "Fetching ChromeDriver version for Chrome $CHROME_MAJOR_VERSION using CfT endpoint..."
# Get the latest known good version of chromedriver for this major Chrome version
CHROMEDRIVER_VERSION_STRING=$(curl -sS "https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_${CHROME_MAJOR_VERSION}")
if [ -z "$CHROMEDRIVER_VERSION_STRING" ]; then
echo "Could not automatically find ChromeDriver version for Chrome $CHROME_MAJOR_VERSION via LATEST_RELEASE. Please check CfT endpoints."
# As a fallback, attempt to fetch the known good versions and pick the latest chromedriver.
# This is more complex and might require parsing JSON with jq.
# For simplicity, we'll rely on LATEST_RELEASE_ for now.
# If that fails consistently, you might need a more robust script or a fixed ChromeDriver version.
# Alternative: List all known good versions
# curl -sS "https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json"
exit 1
fi
CHROMEDRIVER_URL="https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/${CHROMEDRIVER_VERSION_STRING}/linux64/chromedriver-linux64.zip"
else
# For older Chrome versions (less common now)
echo "Fetching ChromeDriver version for Chrome $CHROME_MAJOR_VERSION using older method..."
CHROMEDRIVER_VERSION_STRING=$(curl -sS "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_MAJOR_VERSION}")
CHROMEDRIVER_URL="https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION_STRING}/chromedriver_linux64.zip"
fi
echo "Using ChromeDriver version string: $CHROMEDRIVER_VERSION_STRING"
echo "Downloading ChromeDriver from: $CHROMEDRIVER_URL"
wget -q -O chromedriver.zip "$CHROMEDRIVER_URL"
unzip -o chromedriver.zip -d /tmp/ # Unzip to /tmp
# The zip for CfT often contains a directory like chromedriver-linux64/
sudo mv /tmp/chromedriver-linux64/chromedriver /usr/local/bin/chromedriver || sudo mv /tmp/chromedriver /usr/local/bin/chromedriver
sudo chmod +x /usr/local/bin/chromedriver
# Add /usr/local/bin to GITHUB_PATH to ensure chromedriver is found
echo "/usr/local/bin" >> $GITHUB_PATH
shell: bash
- name: Verify ChromeDriver Installation
run: |
chromedriver --version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install Python dependencies
run: pip install -e .[ci,dev,testing]
- name: Build
run: |
npm run build
- name: Run Table Server Tests
run: |
cd components/dash-table
pytest --nopercyfinalize --headless