Skip to content

Commit 53439a0

Browse files
committed
Adding circle ci config
1 parent 8cec66b commit 53439a0

File tree

4 files changed

+98
-2
lines changed

4 files changed

+98
-2
lines changed

.circleci/config.yml

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
11
version: 2.1
22

3+
executors:
4+
python-container:
5+
docker:
6+
- image: cimg/python:3.12
7+
python-vm:
8+
machine:
9+
- image: ubuntu-2204:current
10+
311
workflows:
412
ci:
513
jobs:
614
- lint
15+
- test:
16+
name: Python (<< matrix.python_version >>) - ArangoDB (<< matrix.arangodb_license >>, << matrix.arangodb_version >> << matrix.arangodb_config >>)
17+
matrix:
18+
parameters:
19+
python_version: ["3.10"]
20+
arangodb_config: ["single"]
21+
arangodb_license: ["community"]
22+
arangodb_version: ["3.12"]
723

824
jobs:
925
lint:
10-
docker:
11-
- image: python:latest
26+
executor: python-container
27+
resource_class: small
1228
steps:
1329
- checkout
1430
- run:
@@ -26,3 +42,54 @@ jobs:
2642
- run:
2743
name: Run mypy
2844
command: mypy ./arangoasync
45+
test:
46+
parameters:
47+
python_version:
48+
type: string
49+
arangodb_config:
50+
type: string
51+
arangodb_license:
52+
type: string
53+
arangodb_version:
54+
type: string
55+
executor: python-vm
56+
steps:
57+
- checkout
58+
- run:
59+
name: Setup ArangoDB
60+
command: |
61+
chmod +x starter.sh
62+
./starter.sh ${{ matrix.arangodb_config }} ${{ matrix.arangodb_license }} ${{ matrix.arangodb_version }}
63+
- restore_cache:
64+
key: pip-and-local-cache
65+
- run:
66+
name: Setup Python
67+
command: |
68+
pyenv --version
69+
pyenv install -f << parameters.python_version >>
70+
pyenv global << parameters.python_version >>
71+
- run:
72+
name: Install Dependencies
73+
command: pip install -e .[dev]
74+
- run: docker ps -a
75+
- run: docker logs arango
76+
- run:
77+
name: Run pytest
78+
command: |
79+
mkdir test-results
80+
81+
args=("--junitxml=test-results/junit.xml" "--log-cli-level=DEBUG" "--host" "localhost" "--port=8529")
82+
if [ << parameters.arangodb_config >> = "cluster" ]; then
83+
args+=("--cluster" "--port=8539" "--port=8549")
84+
fi
85+
86+
if [ << parameters.arangodb_license >> = "enterprise" ]; then
87+
args+=("--enterprise")
88+
fi
89+
90+
echo "Running pytest with args: ${args[@]}"
91+
pytest --cov=arango --cov-report=xml --cov-report term-missing --color=yes --code-highlight=yes "${args[@]}"
92+
- store_artifacts:
93+
path: test-results
94+
- store_test_results:
95+
path: test-results

tests/static/cluster-3.12.conf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[starter]
2+
mode = cluster
3+
local = true
4+
address = 0.0.0.0
5+
port = 8528
6+
7+
[auth]
8+
jwt-secret = /tests/static/keyfile
9+
10+
[args]
11+
all.database.password = passwd
12+
all.database.extended-names = true
13+
all.log.api-enabled = true
14+
all.javascript.allow-admin-execute = true
15+
all.server.options-api = admin

tests/static/keyfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
secret

tests/static/single-3.12.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[starter]
2+
mode = single
3+
address = 0.0.0.0
4+
port = 8528
5+
6+
[auth]
7+
jwt-secret = /tests/static/keyfile
8+
9+
[args]
10+
all.database.password = passwd
11+
all.database.extended-names = true
12+
all.javascript.allow-admin-execute = true
13+
all.server.options-api = admin

0 commit comments

Comments
 (0)