Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions .circleci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ CircleCI validates **arangojs** using one parameterized job, `**node-test`**, wi
**Node.js:** `package.json` `engines.node` requires **>=20**; CircleCI executors exercise the **current LTS pair** (**22.x** and **24.x**).


| Pipeline parameter `docker-img` | Workflows | DB / coverage |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- |
| **Empty** (default) | `**integration-single-topology`**, `**integration-cluster-topology**`, `**integration-http-proto-smoke**`, `**browser-smoke**` | **36** jobs total. |
| **Non-empty** | **`integration-tests-given-db-image`**, **`integration-http-proto-smoke-given-db-image`**, **`browser-smoke-given-db-image`** | **19** jobs total (16 + 2 + 1); same split as the default pipeline |
| Pipeline parameter | Workflows | Coverage |
| --- | --- | --- |
| **`docker-img` empty**, **`browser-tests` false** (default) | `integration-single-topology`, `integration-cluster-topology`, `integration-http-proto-smoke`, `browser-smoke` | **36** jobs |
| **`docker-img` set**, **`browser-tests` false** | `integration-tests-given-db-image`, `integration-http-proto-smoke-given-db-image`, `browser-smoke-given-db-image` | **19** jobs (16 + 2 + 1) |
| **`browser-tests` true** and **`docker-img` set** | `browser-tests` only | **2** jobs (single + cluster) |

Set **`browser-tests`** to skip every other workflow, including smoke.

### Secrets and context

Expand All @@ -26,7 +29,7 @@ All integration and browser jobs attach **`context: docker-hub`**.
| Job | Executor | Resource class |
| --- | -------- | -------------- |
| **`node-test`** | `n22` / `n24` | `arangodb/medium-arm64-privileged` |
| **`browser-smoke`** | `n24-browser` (`cimg/node:24.4`) | `arangodb/medium-amd64-privileged` |
| **`browser-smoke`** / **`browser-test`** | `n24-browser` (`cimg/node:24.16`) | `arangodb/medium-amd64-privileged` |

- **`setup-docker`** — install Docker CLI, start in-container `dockerd` (DinD).
- **`login-docker-hub`** — before **`start-db`** (avoids anonymous pull rate limits).
Expand Down Expand Up @@ -153,7 +156,7 @@ Same fixed stack as default workflow (C), with **`docker-img`** as the pipeline

---

## 4) Shared jobs: `node-test` and `browser-smoke`
## 4) Shared jobs: `node-test`, `browser-smoke`, and `browser-test`

### `node-test`

Expand All @@ -176,6 +179,19 @@ Same Docker setup and **`login-docker-hub`** → **`start-db`** (single, HTTP) a
2. `npm install`, `npm run build` (`PUPPETEER_SKIP_DOWNLOAD=true`)
3. `node smoke-test.mjs` with `PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable`, `ARANGO_PROXY_TARGET=172.28.0.1:8529`

### `browser-test`

Manual-only. Same Docker setup and Chrome install as smoke, then `npm run test:browser`.

| Topology | `start-db` | Proxy targets | Load balancing |
| --- | --- | --- | --- |
| **single** | `STARTER_MODE=single` | `172.28.0.1:8529` | driver default |
| **cluster** | `STARTER_MODE=cluster` | `8529,8539,8549` | `TEST_ARANGO_LOAD_BALANCING_STRATEGY=ROUND_ROBIN` |

The runner serves the Mocha page on `127.0.0.1:8559` and extra coordinator proxies on `8560` / `8561` (CORS allowed from the page origin). `ARANGO_RELEASE` comes from `docker-img`. `CI=true`.

The job has a 60-minute ceiling (cluster suite is slower). Node-only tests are excluded in `browser-test.mjs`.

---

## 5) Operational usage
Expand All @@ -187,6 +203,13 @@ Same Docker setup and **`login-docker-hub`** → **`start-db`** (single, HTTP) a

### Custom DB image

1. **Trigger Pipeline** → set **`docker-img`** to the full image reference.
1. **Trigger Pipeline** → set **`docker-img`** to the full image reference. Leave **`browser-tests`** false.
2. Runs **three workflows** in parallel (**19** jobs): **`integration-tests-given-db-image`** (16), **`integration-http-proto-smoke-given-db-image`** (2), **`browser-smoke-given-db-image`** (1).

### Browser integration suite only

1. **Trigger Pipeline**.
2. Set **`browser-tests`** to **true**.
3. Set **`docker-img`** to the ArangoDB image (same parameter as the rest of CI).
4. Only the **`browser-tests`** workflow runs (**2** jobs: `browser-tests-single` and `browser-tests-cluster`). Smoke and Node jobs do not run.

124 changes: 115 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ parameters:
docker-img:
type: string
default: ''
browser-tests:
description: >
Run only the browser integration suite against docker-img. Every other
workflow is skipped while this is true.
type: boolean
default: false

commands:
timeout:
Expand Down Expand Up @@ -215,11 +221,73 @@ jobs:
PUPPETEER_EXECUTABLE_PATH: /usr/bin/google-chrome-stable
ARANGO_PROXY_TARGET: 172.28.0.1:8529

browser-test:
parameters:
docker-img:
type: string
topology:
type: enum
enum: ['single', 'cluster']
default: 'single'
executor: n24-browser
steps:
- timeout:
duration: '60m'
- checkout
- setup-docker
- login-docker-hub
- start-db:
docker-img: <<parameters.docker-img>>
topology: <<parameters.topology>>
ssl: 'false'
- run:
name: Install Google Chrome (AMD64)
command: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y --no-install-recommends curl ca-certificates \
fonts-liberation \
libasound2t64 libatk-bridge2.0-0t64 libatk1.0-0t64 libcairo2 libcups2t64 \
libdbus-1-3 libdrm2 libexpat1 libfontconfig1 libgbm1 libglib2.0-0t64 \
libgtk-3-0t64 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 \
libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxdamage1 libxext6 \
libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6
curl -fsSL -o /tmp/google-chrome.deb \
https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt-get install -y /tmp/google-chrome.deb
rm /tmp/google-chrome.deb
google-chrome-stable --version
- run:
name: Install dependencies and build
command: |
sudo apt-get install -y --no-install-recommends jq
npm install
environment:
PUPPETEER_SKIP_DOWNLOAD: 'true'
- run:
name: Run browser integration tests
command: |
set -euo pipefail
if [ "<<parameters.topology>>" = "cluster" ]; then
export ARANGO_PROXY_TARGET="172.28.0.1:8529,172.28.0.1:8539,172.28.0.1:8549"
export TEST_ARANGO_LOAD_BALANCING_STRATEGY=ROUND_ROBIN
export BROWSER_TEST_TIMEOUT_MS=2400000
else
export ARANGO_PROXY_TARGET=172.28.0.1:8529
fi
export PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable
export ARANGO_RELEASE="<<parameters.docker-img>>"
export CI=true
npm run test:browser
no_output_timeout: 40m

workflows:
# 16 jobs: single-server only. HTTP/1.1 (default http_proto). 2 DB × 2 Node × 2 SSL × 2 module systems.
integration-single-topology:
when:
not: <<pipeline.parameters.docker-img>>
and:
- not: <<pipeline.parameters.docker-img>>
- not: <<pipeline.parameters.browser-tests>>
jobs:
- node-test:
name: single-<<matrix.node>>-ssl<<matrix.ssl>>-<<matrix.module-system>>-312
Expand Down Expand Up @@ -265,7 +333,9 @@ workflows:
# 16 jobs: cluster only. HTTP/1.1 (default http_proto). Same matrix as single.
integration-cluster-topology:
when:
not: <<pipeline.parameters.docker-img>>
and:
- not: <<pipeline.parameters.docker-img>>
- not: <<pipeline.parameters.browser-tests>>
jobs:
- node-test:
name: cluster-<<matrix.node>>-ssl<<matrix.ssl>>-<<matrix.module-system>>-312
Expand Down Expand Up @@ -311,7 +381,9 @@ workflows:
# 4 jobs: Enterprise 3.12.9, Node 22, SSL, single and cluster, CJS and ESM.
integration-3129:
when:
not: <<pipeline.parameters.docker-img>>
and:
- not: <<pipeline.parameters.docker-img>>
- not: <<pipeline.parameters.browser-tests>>
jobs:
- node-test:
name: <<matrix.topology>>-n22-ssltrue-<<matrix.module-system>>-3.12.9
Expand All @@ -334,7 +406,9 @@ workflows:
# 2 jobs: HTTP/1.1 vs HTTP/2 on a fixed "best" stack (Enterprise 3.12, Node 24, ESM, TLS, single).
integration-http-proto-smoke:
when:
not: <<pipeline.parameters.docker-img>>
and:
- not: <<pipeline.parameters.docker-img>>
- not: <<pipeline.parameters.browser-tests>>
jobs:
- node-test:
name: http-proto-h1-smoke
Expand Down Expand Up @@ -364,7 +438,9 @@ workflows:
# 2 jobs: browser bundling smoke (Puppeteer) on pinned DB images.
browser-smoke:
when:
not: <<pipeline.parameters.docker-img>>
and:
- not: <<pipeline.parameters.docker-img>>
- not: <<pipeline.parameters.browser-tests>>
jobs:
- browser-smoke:
name: browser-smoke-312
Expand All @@ -383,7 +459,10 @@ workflows:

# Manual pipeline (docker-img set): driver matrix on your image (16 jobs).
integration-tests-given-db-image:
when: <<pipeline.parameters.docker-img>>
when:
and:
- <<pipeline.parameters.docker-img>>
- not: <<pipeline.parameters.browser-tests>>
jobs:
- node-test:
name: <<matrix.node>>-<<matrix.topology>>-ssl<<matrix.ssl>>-<<matrix.module-system>>
Expand All @@ -410,7 +489,10 @@ workflows:

# Manual pipeline (docker-img set): HTTP/1.1 vs HTTP/2 smoke (2 jobs).
integration-http-proto-smoke-given-db-image:
when: <<pipeline.parameters.docker-img>>
when:
and:
- <<pipeline.parameters.docker-img>>
- not: <<pipeline.parameters.browser-tests>>
jobs:
- node-test:
name: http-proto-h1-smoke
Expand Down Expand Up @@ -439,12 +521,36 @@ workflows:

# Manual pipeline (docker-img set): browser bundling smoke (1 job).
browser-smoke-given-db-image:
when: <<pipeline.parameters.docker-img>>
when:
and:
- <<pipeline.parameters.docker-img>>
- not: <<pipeline.parameters.browser-tests>>
jobs:
- browser-smoke:
name: browser-smoke
context: docker-hub
filters:
branches:
ignore: stable
docker-img: <<pipeline.parameters.docker-img>>
docker-img: <<pipeline.parameters.docker-img>>

# Manual pipeline: browser integration suite only (2 jobs: single + cluster).
# Trigger Pipeline → browser-tests=true and docker-img=<image>.
browser-tests:
when:
and:
- <<pipeline.parameters.browser-tests>>
- <<pipeline.parameters.docker-img>>
jobs:
- browser-test:
name: browser-tests-<<matrix.topology>>
context: docker-hub
filters:
branches:
ignore: stable
docker-img: <<pipeline.parameters.docker-img>>
matrix:
parameters:
topology:
- 'single'
- 'cluster'
Loading