|
1 |
| -# Use the latest 2.1 version of CircleCI pipeline process engine. |
2 |
| -# See: https://circleci.com/docs/configuration-reference |
3 | 1 | version: 2.1
|
4 | 2 |
|
5 |
| -# Define a job to be invoked later in a workflow. |
6 |
| -# See: https://circleci.com/docs/configuration-reference/#jobs |
| 3 | +parameters: |
| 4 | + preview: |
| 5 | + type: boolean |
| 6 | + default: true |
| 7 | + 3-10: |
| 8 | + type: boolean |
| 9 | + default: true |
| 10 | + 3-11: |
| 11 | + type: boolean |
| 12 | + default: true |
| 13 | + |
7 | 14 | jobs:
|
8 |
| - say-hello: |
9 |
| - # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. |
10 |
| - # See: https://circleci.com/docs/configuration-reference/#executor-job |
| 15 | + run-tests: |
| 16 | + resource_class: small |
| 17 | + parameters: |
| 18 | + python-version: |
| 19 | + type: string |
| 20 | + default: "latest" |
| 21 | + arangodb-version: |
| 22 | + type: string |
| 23 | + default: "arangodb:latest" |
| 24 | + arangodb-config: |
| 25 | + type: string |
| 26 | + default: "single.conf" |
| 27 | + cluster: |
| 28 | + type: boolean |
| 29 | + default: false |
| 30 | + enterprise: |
| 31 | + type: boolean |
| 32 | + default: false |
11 | 33 | docker:
|
12 |
| - - image: cimg/base:stable |
13 |
| - # Add steps to the job |
14 |
| - # See: https://circleci.com/docs/configuration-reference/#steps |
| 34 | + - image: python:<< parameters.python-version >> |
| 35 | + command: ["/bin/sh", "-c", "python -m http.server"] |
| 36 | + - image: arangodb/<< parameters.arangodb-version >> |
| 37 | + environment: |
| 38 | + ARANGODB_CONF: << parameters.arangodb-config >> |
| 39 | + PROJECT: /root/project |
| 40 | + command: |
| 41 | + - "/bin/sh" |
| 42 | + - "-c" |
| 43 | + - > |
| 44 | + while ! wget -q -O /dev/null http://localhost:8000/$PROJECT/tests/static/setup.sh; do sleep 1; done && |
| 45 | + wget -O - http://localhost:8000/$PROJECT/tests/static/setup.sh | |
| 46 | + /bin/sh |
15 | 47 | steps:
|
16 | 48 | - checkout
|
17 | 49 | - run:
|
18 |
| - name: "Say hello" |
19 |
| - command: "echo Hello, World!" |
| 50 | + name: "Install Dependencies" |
| 51 | + command: | |
| 52 | + pip install -e .[dev] |
| 53 | + - run: |
| 54 | + name: "Wait for ArangoDB starter" |
| 55 | + command: | |
| 56 | + wget --quiet --waitretry=1 --tries=120 -O - http://localhost:8528/version |
| 57 | + if [ $? -eq 0 ]; then |
| 58 | + echo "starter ready" |
| 59 | + exit 0 |
| 60 | + else |
| 61 | + echo "starter not ready, giving up" |
| 62 | + exit 1 |
| 63 | + fi |
| 64 | + - run: |
| 65 | + name: "Run pytest" |
| 66 | + command: | |
| 67 | + mkdir test-results |
| 68 | + args=("--log-cli-level=DEBUG" "--host" "localhost" "--junitxml=./test-results/junit.xml") |
| 69 | + if [ << parameters.cluster >> = true ]; then |
| 70 | + args+=("--cluster" "--port=8529" "--port=8539" "--port=8549") |
| 71 | + else |
| 72 | + args+=("--port=8529") |
| 73 | + fi |
| 74 | + if [ << parameters.enterprise >> = true ]; then |
| 75 | + args+=("--enterprise") |
| 76 | + fi |
| 77 | + echo "Running py.test with args: ${args[@]}" |
| 78 | + py.test "${args[@]}" |
| 79 | + - store_test_results: |
| 80 | + path: ./test-results/junit.xml |
| 81 | + - store_artifacts: |
| 82 | + path: ./test-results |
20 | 83 |
|
21 |
| -# Orchestrate jobs using workflows |
22 |
| -# See: https://circleci.com/docs/configuration-reference/#workflows |
23 | 84 | workflows:
|
24 |
| - say-hello-workflow: |
| 85 | + python-3.8-community-single-3.10: |
| 86 | + when: << pipeline.parameters.3-10 >> |
| 87 | + jobs: |
| 88 | + - run-tests: |
| 89 | + name: python-3.8-community-single-3.10 |
| 90 | + python-version: "3.8.2" |
| 91 | + arangodb-version: "arangodb:3.10.10" |
| 92 | + arangodb-config: "single-3.10.conf" |
| 93 | + cluster: false |
| 94 | + enterprise: false |
| 95 | + python-3.8-enterprise-cluster-3.10: |
| 96 | + when: << pipeline.parameters.3-10 >> |
| 97 | + jobs: |
| 98 | + - run-tests: |
| 99 | + name: python-3.8-enterprise-cluster-3.10 |
| 100 | + python-version: "3.8.2" |
| 101 | + arangodb-version: "enterprise:3.10.10" |
| 102 | + arangodb-config: "cluster-3.10.conf" |
| 103 | + cluster: true |
| 104 | + enterprise: true |
| 105 | + python-3.10-community-single-3.11: |
| 106 | + when: << pipeline.parameters.3-11 >> |
| 107 | + jobs: |
| 108 | + - run-tests: |
| 109 | + name: python-3.10-community-single-3.11 |
| 110 | + python-version: "3.10.6" |
| 111 | + arangodb-version: "arangodb:3.11.4" |
| 112 | + arangodb-config: "single.conf" |
| 113 | + cluster: false |
| 114 | + enterprise: false |
| 115 | + python-3.10-community-cluster-3.11: |
| 116 | + when: << pipeline.parameters.3-11 >> |
| 117 | + jobs: |
| 118 | + - run-tests: |
| 119 | + name: python-3.10-community-cluster-3.11 |
| 120 | + python-version: "3.10.6" |
| 121 | + arangodb-version: "arangodb:3.11.4" |
| 122 | + arangodb-config: "cluster.conf" |
| 123 | + cluster: true |
| 124 | + enterprise: false |
| 125 | + python-3.10-enterprise-single-3.11: |
| 126 | + when: << pipeline.parameters.3-11 >> |
| 127 | + jobs: |
| 128 | + - run-tests: |
| 129 | + name: python-3.10-enterprise-single-3.11 |
| 130 | + python-version: "3.10.6" |
| 131 | + arangodb-version: "enterprise:3.11.4" |
| 132 | + arangodb-config: "single.conf" |
| 133 | + cluster: false |
| 134 | + enterprise: true |
| 135 | + python-3.10-enterprise-cluster-3.11: |
| 136 | + when: << pipeline.parameters.3-11 >> |
| 137 | + jobs: |
| 138 | + - run-tests: |
| 139 | + name: python-3.10-enterprise-cluster-3.11 |
| 140 | + python-version: "3.10.6" |
| 141 | + arangodb-version: "enterprise:3.11.4" |
| 142 | + arangodb-config: "cluster.conf" |
| 143 | + cluster: true |
| 144 | + enterprise: true |
| 145 | + python-latest-enterprise-single-preview: |
| 146 | + when: << pipeline.parameters.preview >> |
| 147 | + jobs: |
| 148 | + - run-tests: |
| 149 | + name: python-latest-enterprise-single-preview |
| 150 | + python-version: "latest" |
| 151 | + arangodb-version: "enterprise-preview:latest" |
| 152 | + arangodb-config: "single.conf" |
| 153 | + cluster: false |
| 154 | + enterprise: true |
| 155 | + python-latest-enterprise-cluster-preview: |
| 156 | + when: << pipeline.parameters.preview >> |
25 | 157 | jobs:
|
26 |
| - - say-hello |
| 158 | + - run-tests: |
| 159 | + name: python-latest-enterprise-cluster-preview |
| 160 | + python-version: "latest" |
| 161 | + arangodb-version: "enterprise-preview:latest" |
| 162 | + arangodb-config: "cluster.conf" |
| 163 | + cluster: true |
| 164 | + enterprise: true |
0 commit comments