Skip to content

Commit a09c5ff

Browse files
committed
Run tests against crate nightly in github actions.
1 parent 763c31d commit a09c5ff

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

.github/workflows/main.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,22 @@ on:
1212

1313
jobs:
1414
test:
15-
name: Test python-${{ matrix.python-version }} sqla ${{ matrix.sqla-version }} on ${{ matrix.os }}
15+
name: "Test python-${{ matrix.python-version }}
16+
sqla: ${{ matrix.sqla-version }}
17+
CrateDB: ${{ matrix.crate-version }}
18+
on ${{ matrix.os }}"
1619
runs-on: ${{ matrix.os }}
1720
strategy:
1821
matrix:
22+
crate-version: [nightly]
1923
os: [ubuntu-latest]
2024
sqla-version: ['1.1.15', '1.2.18', '1.3.17']
2125
python-version: [3.5, 3.6, 3.7, 3.8]
2226

2327
steps:
2428
- uses: actions/checkout@master
2529
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v1
30+
uses: actions/setup-python@v2
2731
with:
2832
python-version: ${{ matrix.python-version }}
2933

@@ -36,7 +40,19 @@ jobs:
3640
run: |
3741
python -m pip install --upgrade pip
3842
python bootstrap.py
43+
44+
# replace SQLAlchemy version
3945
sed -ir 's/SQLAlchemy.*/SQLAlchemy = ${{ matrix.sqla-version }}/g' versions.cfg
46+
47+
# replace CrateDB version
48+
if [ ${{ matrix.crate-version }} = "nightly" ]; then
49+
sed -ir 's/releases/releases\/nightly/g' base.cfg
50+
sed -ir 's/crate_server.*/crate_server = latest/g' versions.cfg
51+
else
52+
sed -ir 's/crate-/crate_/g' base.cfg
53+
sed -ir 's/crate_server.*/crate_server = ${{ matrix.crate-version }}/g' versions.cfg
54+
fi
55+
4056
bin/buildout -n -c base.cfg
4157
4258
- name: Test

src/crate/client/doctests/sqlalchemy.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ When retrieved, they are retrieved as the corresponding geojson objects::
227227
>>> refresh("cities")
228228
>>> query = session.query(City.name, City.coordinate, City.area)
229229
>>> query.all()
230-
[('Tokyo', (139.76, 35.68), {"coordinates": [[[139.806, 35.515], [139.919, 35.703], [139.768, 35.817], [139.575, 35.76], [139.584, 35.619], [139.806, 35.515]]], "type": "Polygon"})]
230+
[('Tokyo', (139.75999999791384, 35.67999996710569), {"coordinates": [[[139.806, 35.515], [139.919, 35.703], [139.768, 35.817], [139.575, 35.76], [139.584, 35.619], [139.806, 35.515]]], "type": "Polygon"})]
231231

232232
Count and Group By
233233
==================

src/crate/testing/doctests/layer.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ to ``True``::
149149
Environment variables
150150
---------------------
151151

152-
It is possible to provide enviromental variables for the ``Crate`` testing
152+
It is possible to provide environment variables for the ``Crate`` testing
153153
layer::
154154

155155
>>> layer = CrateLayer('crate',
@@ -165,7 +165,7 @@ layer::
165165
... body='{"stmt": "select heap[\'max\'] from sys.nodes"}')
166166
>>> json_response = json.loads(response.data.decode('utf-8'))
167167
>>> json_response["rows"][0][0]
168-
304087040
168+
314572800
169169

170170
>>> layer.stop()
171171

@@ -228,12 +228,11 @@ From Uri
228228
The CrateLayer can also be created by providing a URI that points to a Crate
229229
tarball::
230230

231-
>>> import configparser
232-
>>> config = configparser.ConfigParser()
233-
>>> config.read(project_root("versions.cfg"))
234-
['.../versions.cfg']
235-
236-
>>> version = config["versions"]["crate_server"]
231+
>>> import urllib.request
232+
>>> import json
233+
>>> with urllib.request.urlopen('http://crate.io/versions.json') as response:
234+
... versions = json.loads(response.read().decode())
235+
... version = versions['crate_testing']
237236

238237
>>> uri = 'https://cdn.crate.io/downloads/releases/crate-{}.tar.gz'.format(version)
239238
>>> tmpdir = tempfile.mkdtemp()

0 commit comments

Comments
 (0)