Skip to content

Commit a2c4ac6

Browse files
authored
Merge pull request #3024 from quadratichq/qa
QA Jun 2
2 parents b1ed4ed + 36695ef commit a2c4ac6

File tree

773 files changed

+876672
-6814
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

773 files changed

+876672
-6814
lines changed

.env.docker

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ QUADRATIC_CONNECTION_URL_INTERNAL=http://host.docker.internal:3003
9191
QUADRATIC_CONNECTION_MAX_RESPONSE_BYTES=15728640 # 15MB
9292
QUADRATIC_CONNECTION_STATIC_IPS=0.0.0.0,127.0.0.1
9393

94+
# connection db
95+
QUADRATIC_CONNECTION_DB_POSTGRES_IN_DOCKER_COMPOSE=true
96+
QUADRATIC_CONNECTION_DB_MYSQL_IN_DOCKER_COMPOSE=true
97+
QUADRATIC_CONNECTION_DB_MSSQL_IN_DOCKER_COMPOSE=false
98+
9499
# stripe
95100
STRIPE_SECRET_KEY=STRIPE_SECRET_KEY
96101
STRIPE_WEBHOOK_SECRET=STRIPE_WEBHOOK_SECRET
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Tests E2E
2+
description: "E2E tests"
3+
inputs:
4+
e2e_url:
5+
description: "Base url of deployment"
6+
required: true
7+
shard_index:
8+
description: "Index of the shard to run"
9+
required: true
10+
shard_total:
11+
description: "Total number of shards"
12+
required: true
13+
runs:
14+
using: "composite"
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 1
20+
sparse-checkout: |
21+
test/e2e
22+
sparse-checkout-cone-mode: false
23+
fetch-tags: false
24+
submodules: false
25+
lfs: false
26+
27+
- name: Setup Node
28+
uses: useblacksmith/setup-node@v5
29+
with:
30+
node-version: 24
31+
32+
- name: Install Dependencies
33+
run: cd test/e2e && npm install
34+
shell: bash
35+
36+
- name: Run Playwright tests
37+
run: export E2E_URL=${{ inputs.e2e_url }} && cd test/e2e && npm run test -- --shard ${{ inputs.shard_index }}/${{ inputs.shard_total }}
38+
shell: bash
39+
env:
40+
CI: true
41+
GITHUB_ACTIONS: false
42+
43+
- name: Upload blob report to GitHub Actions Artifacts
44+
uses: actions/upload-artifact@v4
45+
if: ${{ !cancelled() }}
46+
id: upload-playwright-report
47+
with:
48+
name: blob-report-${{ github.run_id }}-${{ inputs.shard_index }}
49+
path: test/e2e/blob-report
50+
retention-days: 1
51+
overwrite: true
52+
include-hidden-files: true
53+
if-no-files-found: warn
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Verify Version
2+
description: "Verify version of a deployed service"
3+
inputs:
4+
service_name:
5+
description: "Name of the service to verify version"
6+
required: true
7+
service_url:
8+
description: "URL of the service to verify version"
9+
required: true
10+
expected_version:
11+
description: "Expected version of the service"
12+
required: true
13+
max_attempts:
14+
description: "Maximum number of attempts to verify version"
15+
required: true
16+
runs:
17+
using: "composite"
18+
steps:
19+
- name: Verify version
20+
run: |
21+
ATTEMPTS=0
22+
echo "Checking ${{ inputs.service_name }} version..."
23+
echo "Expected version: ${{ inputs.expected_version }}"
24+
echo "Service URL: ${{ inputs.service_url }}"
25+
26+
while [ $ATTEMPTS -lt ${{ inputs.max_attempts }} ]; do
27+
ATTEMPTS=$((ATTEMPTS + 1))
28+
29+
set +e # Don't exit on error
30+
31+
curl -s -k \
32+
--connect-timeout 10 \
33+
--max-time 30 \
34+
-w "\n%{http_code}" \
35+
"${{ inputs.service_url }}" > response.txt 2>error.txt
36+
CURL_EXIT_CODE=$?
37+
38+
set -e # Resume normal error handling
39+
40+
# If curl failed, retry
41+
if [ $CURL_EXIT_CODE -ne 0 ]; then
42+
echo "$ATTEMPTS/${{ inputs.max_attempts }} - Curl failed with exit code $CURL_EXIT_CODE"
43+
[ $ATTEMPTS -lt ${{ inputs.max_attempts }} ] && sleep 30
44+
continue
45+
fi
46+
47+
# Process the response if curl succeeded
48+
RESPONSE=$(cat response.txt)
49+
50+
# Extract HTTP code and body
51+
HTTP_BODY=$RESPONSE
52+
HTTP_CODE=$(echo "$RESPONSE" | tail -n 1)
53+
54+
# Check for valid HTTP response
55+
if [ "$HTTP_CODE" != "200" ]; then
56+
echo "$ATTEMPTS/${{ inputs.max_attempts }} - Endpoint not ready (HTTP $HTTP_CODE)"
57+
[ $ATTEMPTS -lt ${{ inputs.max_attempts }} ] && sleep 30
58+
continue
59+
fi
60+
61+
# Try to parse version
62+
DEPLOYED_VERSION=$(echo "$HTTP_BODY" | jq -r .version 2>/dev/null || echo "")
63+
64+
# Check if version was successfully extracted
65+
if [ -z "$DEPLOYED_VERSION" ]; then
66+
echo "$ATTEMPTS/${{ inputs.max_attempts }} - Invalid version format in response"
67+
[ $ATTEMPTS -lt ${{ inputs.max_attempts }} ] && sleep 30
68+
continue
69+
fi
70+
71+
# Compare versions
72+
if [ "$DEPLOYED_VERSION" = "${{ inputs.expected_version }}" ]; then
73+
echo "::notice::${{ inputs.service_name }} version verified successfully"
74+
exit 0
75+
fi
76+
77+
echo "$ATTEMPTS/${{ inputs.max_attempts }} - Version mismatch, found $DEPLOYED_VERSION"
78+
[ $ATTEMPTS -lt ${{ inputs.max_attempts }} ] && sleep 30
79+
done
80+
81+
echo "::error::${{ inputs.service_name }} version check failed after ${{ inputs.max_attempts }} attempts"
82+
exit 1
83+
shell: bash

.github/workflows/ci.yml

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ jobs:
5757
- name: Install Protoc
5858
uses: arduino/setup-protoc@v3
5959

60-
- uses: useblacksmith/rust-cache@v3
60+
- name: Rust Cache
61+
uses: useblacksmith/rust-cache@v3
6162

6263
- name: Install grcov
6364
run: if ! which grcov; then cargo install grcov; fi
@@ -105,6 +106,39 @@ jobs:
105106
env:
106107
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
107108

109+
perf_core:
110+
runs-on: blacksmith-2vcpu-ubuntu-2204
111+
timeout-minutes: 10
112+
steps:
113+
- name: Checkout code
114+
uses: actions/checkout@v4
115+
116+
- name: Setup Node
117+
uses: useblacksmith/setup-node@v5
118+
with:
119+
node-version: 24
120+
121+
- name: Set up Rust
122+
uses: actions-rs/toolchain@v1
123+
with:
124+
toolchain: nightly
125+
components: clippy, llvm-tools-preview
126+
override: true
127+
128+
- name: Install Protoc
129+
uses: arduino/setup-protoc@v3
130+
131+
- name: Rust Cache
132+
uses: useblacksmith/rust-cache@v3
133+
134+
- name: Install llvm-tools-preview
135+
run: if ! which llvm-tools-preview; then rustup component add llvm-tools-preview; fi
136+
137+
- name: Bench quadratic-core
138+
run: |
139+
cd quadratic-core
140+
npm run bench:run import_excel
141+
108142
test_client:
109143
runs-on: blacksmith-4vcpu-ubuntu-2204
110144
timeout-minutes: 30
@@ -147,7 +181,8 @@ jobs:
147181
- name: Install Protoc
148182
uses: arduino/setup-protoc@v3
149183

150-
- uses: useblacksmith/rust-cache@v3
184+
- name: Rust Cache
185+
uses: useblacksmith/rust-cache@v3
151186

152187
- uses: jetli/wasm-pack-action@v0.4.0
153188
with:
@@ -180,7 +215,8 @@ jobs:
180215
with:
181216
node-version: 24
182217

183-
- uses: useblacksmith/setup-python@v6
218+
- name: Set up Python
219+
uses: useblacksmith/setup-python@v6
184220
with:
185221
python-version: "3.11.3"
186222
cache: "pip"
@@ -225,7 +261,8 @@ jobs:
225261
- name: Install Protoc
226262
uses: arduino/setup-protoc@v3
227263

228-
- uses: useblacksmith/rust-cache@v3
264+
- name: Rust Cache
265+
uses: useblacksmith/rust-cache@v3
229266

230267
- name: Run cargo clippy in quadratic-core
231268
run: |
@@ -260,9 +297,11 @@ jobs:
260297
- name: Install Protoc
261298
uses: arduino/setup-protoc@v3
262299

263-
- uses: useblacksmith/rust-cache@v3
300+
- name: Rust Cache
301+
uses: useblacksmith/rust-cache@v3
264302

265-
- uses: jetli/wasm-pack-action@v0.4.0
303+
- name: Set up wasm-pack
304+
uses: jetli/wasm-pack-action@v0.4.0
266305
with:
267306
version: "latest"
268307

0 commit comments

Comments
 (0)