Skip to content

Commit e5d2ae9

Browse files
committed
Fix build after a substantial period. To achieve this a number of concessions were made:
* remove RethinkDB support since the mirror (and the project) is dead * remove coveralls (for now) since the link and API key need a total reset A number of other updates were made to the testing suite, e.g. Chrome, Jenkins, MongoDB.
1 parent 5f9b88a commit e5d2ae9

File tree

12 files changed

+41
-343
lines changed

12 files changed

+41
-343
lines changed

.circleci/config.yml

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test-tmpl: &test-tmpl
99
1010
job-tmpl: &job-tmpl
1111
machine:
12-
image: ubuntu-2004:202010-01
12+
image: ubuntu-2004:edge
1313

1414
working_directory: ~/src
1515

@@ -20,40 +20,37 @@ job-tmpl: &job-tmpl
2020
name: Install Python
2121
command: |
2222
set -x
23-
sudo bash -c ". install.sh && install_python_ppa && install_python $PYTHON"
24-
rm -rf /opt/circleci/.pyenv
23+
sudo bash -c "source ./install.sh && install_python_ppa && install_python $PYTHON"
24+
sudo rm -rf /opt/circleci/.pyenv
2525
2626
- run:
2727
name: Create venv and install extras
28-
command: bash -c ". install.sh && init_venv $PYTHON"
28+
command: bash -c "source ./install.sh && init_venv $PYTHON"
2929

3030
- run:
3131
name: Update Apt-Sources
32-
command: sudo bash -c ". install.sh && update_apt_sources"
32+
command: sudo bash -c "source ./install.sh && update_apt_sources"
3333
- run:
3434
name: Install System Dependencies
35-
command: sudo bash -c ". install.sh && install_system_deps"
35+
command: sudo bash -c "source ./install.sh && install_system_deps"
3636
- run:
3737
name: Install Postgresql
38-
command: sudo bash -c ". install.sh && install_postgresql"
38+
command: sudo bash -c "source ./install.sh && install_postgresql"
3939
- run:
4040
name: Install Redis
41-
command: sudo bash -c ". install.sh && install_redis"
42-
- run:
43-
name: Install Rethinkdb
44-
command: sudo bash -c ". install.sh && install_rethinkdb"
41+
command: sudo bash -c "source ./install.sh && install_redis"
4542
- run:
4643
name: Install Mongodb
47-
command: sudo bash -c ". install.sh && install_mongodb"
44+
command: sudo bash -c "source ./install.sh && install_mongodb"
4845
- run:
4946
name: Install Apache
50-
command: sudo bash -c ". install.sh && install_apache"
47+
command: sudo bash -c "source ./install.sh && install_apache"
5148
- run:
5249
name: Install Minio
53-
command: sudo bash -c ". install.sh && install_minio"
50+
command: sudo bash -c "source ./install.sh && install_minio"
5451
- run:
5552
name: Install Chrome Headless
56-
command: sudo bash -c ". install.sh && install_chrome_headless"
53+
command: sudo bash -c "source ./install.sh && install_chrome_headless"
5754

5855
- run:
5956
name: Build and install dists
@@ -118,12 +115,6 @@ job-tmpl: &job-tmpl
118115
coverage combine
119116
coverage report
120117
pip install urllib3[secure]
121-
pip install coveralls
122-
if [[ "$COVERALLS_REPO_TOKEN" != "" ]]; then
123-
CIRCLE_BUILD_NUM=$CIRCLE_WORKFLOW_ID coveralls
124-
else
125-
echo "Skipping Coveralls"
126-
fi
127118
128119
- store_test_results:
129120
path: junit
@@ -143,26 +134,9 @@ jobs:
143134
environment:
144135
PYTHON: "python3.7"
145136

146-
coveralls:
147-
docker:
148-
- image: buildpack-deps:trusty
149-
steps:
150-
- run:
151-
name: Complete Coveralls
152-
command: |
153-
if [[ "$COVERALLS_REPO_TOKEN" != "" ]]; then
154-
curl --fail https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_WORKFLOW_ID&payload[status]=done"
155-
else
156-
echo "Skipping Coveralls"
157-
fi
158-
159137
workflows:
160138
version: 2
161139
pytest-plugins:
162140
jobs:
163141
- py36
164142
- py37
165-
- coveralls:
166-
requires:
167-
- py36
168-
- py37

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11

22
## Changelog
3+
### 1.8.0
4+
* pytest-server-fixtures: Removed RethinkDB support.
35

46
### 1.7.0
57
* All: Support pytest >= 4.0.0

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ EXTRA_DEPS = setuptools-git \
1010
pymongo \
1111
psycopg2-binary\
1212
boto3 \
13-
rethinkdb \
1413
docker \
1514
kubernetes
1615

common_setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def common_setup(src_dir):
5151
# Convert Markdown to RST for PyPI
5252
try:
5353
import pypandoc
54-
long_description = pypandoc.convert(readme_file, 'rst')
55-
changelog = pypandoc.convert(changelog_file, 'rst')
54+
long_description = pypandoc.convert_file(readme_file, 'rst')
55+
changelog = pypandoc.convert_file(changelog_file, 'rst')
5656
except (IOError, ImportError, OSError):
5757
long_description = open(readme_file).read()
5858
changelog = open(changelog_file).read()

install.sh

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
22
set -eo pipefail
3+
# Debug for now
4+
set -x
5+
36

47
# Suppress the "dpkg-preconfigure: unable to re-open stdin: No such file or directory" error
58
export DEBIAN_FRONTEND=noninteractive
@@ -12,6 +15,7 @@ function install_base_tools {
1215
curl \
1316
wget \
1417
git \
18+
git-lfs \
1519
unzip
1620
}
1721

@@ -31,11 +35,17 @@ function install_python_packaging {
3135

3236
function install_python {
3337
local py=$1
34-
apt-get install -y $py $py-dev
38+
sudo apt-get install -y $py $py-dev
3539
if [ "$py" = "python3.6" ]; then
36-
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/pip/3.6/get-pip.py | $py
40+
sudo apt-get install python3.6-distutils || {
41+
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/pip/3.6/get-pip.py | sudo $py
42+
sudo $py -m pip install setuptools
43+
}
3744
else
38-
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | $py
45+
sudo apt-get install python3.7-distutils || {
46+
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/pip/3.7/get-pip.py | sudo $py
47+
sudo $py -m pip install setuptools
48+
}
3949
fi
4050
install_python_packaging $py
4151
}
@@ -99,14 +109,15 @@ function init_venv {
99109

100110

101111
function update_apt_sources {
102-
wget -qO- https://download.rethinkdb.com/repository/raw/pubkey.gpg | apt-key add -
103-
. /etc/lsb-release && echo "deb https://download.rethinkdb.com/repository/ubuntu-$DISTRIB_CODENAME $DISTRIB_CODENAME main" | tee /etc/apt/sources.list.d/rethinkdb.list
104-
105-
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | apt-key add -
106-
sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
112+
# Add Jenkins GPG key and repository
113+
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | gpg --dearmor -o /usr/share/keyrings/jenkins-archive-keyring.gpg
114+
echo "deb [signed-by=/usr/share/keyrings/jenkins-archive-keyring.gpg] https://pkg.jenkins.io/debian-stable binary/" | tee /etc/apt/sources.list.d/jenkins.list > /dev/null
107115

108-
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
109-
echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.4.list
116+
# Add MongoDB GPG key and repository
117+
curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | \
118+
sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg \
119+
--dearmor
120+
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
110121

111122
apt install ca-certificates
112123
apt-get update
@@ -131,11 +142,6 @@ function install_redis {
131142
apt-get install -y redis-server
132143
}
133144

134-
function install_rethinkdb {
135-
apt-get install -y rethinkdb
136-
service rethinkdb stop; update-rc.d rethinkdb disable;
137-
}
138-
139145
function install_jenkins {
140146
apt-get install -y jenkins
141147
service jenkins stop; update-rc.d jenkins disable;
@@ -159,9 +165,9 @@ function install_minio {
159165
function install_chrome_headless {
160166
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /tmp/google-chrome-stable_current_amd64.deb
161167
dpkg -i --force-depends /tmp/google-chrome-stable_current_amd64.deb || apt-get install -f -y
162-
wget -q https://chromedriver.storage.googleapis.com/2.43/chromedriver_linux64.zip -O /tmp/chromedriver_linux64.zip
168+
wget -q https://storage.googleapis.com/chrome-for-testing-public/128.0.6613.86/linux64/chromedriver-linux64.zip -O /tmp/chromedriver_linux64.zip
163169
unzip /tmp/chromedriver_linux64.zip
164-
mv chromedriver /usr/local/bin/
170+
mv chromedriver-linux64/chromedriver /usr/local/bin/
165171
chmod a+x /usr/local/bin/chromedriver
166172
}
167173

@@ -216,7 +222,6 @@ function install_all {
216222
install_system_deps
217223
install_postgresql
218224
install_redis
219-
install_rethinkdb
220225
install_jenkins
221226
install_mongodb
222227
install_apache

pytest-server-fixtures/README.md

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ and databases.
1212
* [MongoDB](#mongodb)
1313
* [Postgres](#postgres)
1414
* [Redis](#redis)
15-
* [RethinkDB](#rethinkdb)
1615
* [S3 Minio](#s3-minio)
1716
* [Apache httpd](#apache-httpd)
1817
* [Simple HTTP Server](#simple-http-server)
@@ -30,7 +29,6 @@ and databases.
3029
| MongoDB | mongodb
3130
| Postgres | postgres
3231
| Redis | redis
33-
| RethinkDB | rethinkdb
3432
| S3 Minio | s3
3533
| Apache Httpd | <none>
3634
| Simple HTTP Server | <none>
@@ -74,7 +72,6 @@ entry points):
7472
'pytest_server_fixtures.mongo',
7573
'pytest_server_fixtures.postgres',
7674
'pytest_server_fixtures.redis',
77-
'pytest_server_fixtures.rethink',
7875
'pytest_server_fixtures.xvfb',
7976
]
8077
```
@@ -95,8 +92,6 @@ The fixtures are configured using the following evironment variables:
9592
| `SERVER_FIXTURES_PG_CONFIG` | Postgres pg_config executable | `pg_config`
9693
| `SERVER_FIXTURES_REDIS` | Redis server executable | `redis-server`
9794
| `SERVER_FIXTURES_REDIS_IMAGE` | (Docker only) Docker image for redis | `redis:5.0.2-alpine`
98-
| `SERVER_FIXTURES_RETHINK` | RethinkDB server executable | `rethinkdb`
99-
| `SERVER_FIXTURES_RETHINK_IMAGE` | (Docker only) Docker image for rethinkdb | `rethink:2.3.6`
10095
| `SERVER_FIXTURES_HTTPD` | Httpd server executable | `apache2`
10196
| `SERVER_FIXTURES_HTTPD_MODULES` | Httpd modules directory | `/usr/lib/apache2/modules`
10297
| `SERVER_FIXTURES_JAVA` | Java executable used for running Jenkins server | `java`
@@ -226,72 +221,6 @@ def test_connection(s3_bucket):
226221
assert bucket is not None
227222
```
228223

229-
## RethinkDB
230-
231-
232-
The `rethink` module contains the following fixtures:
233-
234-
| Fixture Name | Description
235-
| ------------ | -----------
236-
| `rethink_server` | Function-scoped Redis server
237-
| `rethink_server_sess` | Session-scoped Redis server
238-
| `rethink_unique_db` | Session-scoped unique db
239-
| `rethink_module_db` | Module-scoped unique db
240-
| `rethink_make_tables` | Module-scoped fixture to create named tables
241-
| `rethink_empty_db` | Function-scoped fixture to empty tables created in `rethink_make_tables`
242-
243-
The server fixtures have the following properties
244-
245-
| Property | Description
246-
| -------- | -----------
247-
| `conn` | `rethinkdb.Connection` to the `test` database on the running server
248-
249-
250-
Here's an example on how to run up one of these servers:
251-
252-
```python
253-
def test_rethink(rethink_server):
254-
conn = rethink_server.conn
255-
conn.table_create('my_table').run(conn)
256-
inserted = conn.table('my_table').insert({'foo': 'bar'}).run(conn)
257-
assert conn.get(inserted.generated_keys[0])['foo'] == 'bar
258-
```
259-
260-
### Creating Tables
261-
262-
You can create tables for every test in your module like so:
263-
264-
```python
265-
FIXTURE_TABLES = ['accounts','transactions']
266-
267-
def test_table_creation(rethink_module_db, rethink_make_tables):
268-
conn = rethink_module_db
269-
assert conn.table_list().run(conn) == ['accounts', 'transactions']
270-
```
271-
272-
### Emptying Databases
273-
274-
RehinkDb is annecdotally slower to create tables that it is to empty them
275-
(at least at time of writing), so we have a fixture that will empty out
276-
tables between tests for us that were created with the `rethink_make_tables`
277-
fixture above:
278-
279-
280-
```python
281-
FIXTURE_TABLES = ['accounts','transactions']
282-
283-
def test_put_things_in_db(rethink_module_db, rethink_make_tables):
284-
conn = rethink_module_db
285-
conn.table('accounts').insert({'foo': 'bar'}).run(conn)
286-
conn.table('transactions').insert({'baz': 'qux'}).run(conn)
287-
288-
289-
def test_empty_db(rethink_empty_db):
290-
conn = rethink_empty_db
291-
assert not conn.table('accounts').run(conn)
292-
assert not conn.table('transactions').run(conn)
293-
```
294-
295224
# Apache httpd
296225

297226
The `httpd` module contains the following fixtures:
@@ -444,7 +373,6 @@ pytest_shutil.workspace.Workspace
444373
|
445374
*--mongo.MongoTestServer
446375
*--redis.RedisTestServer
447-
*--rethink.RethinkDBServer
448376
*--base.TestServer
449377
|
450378
*--http.HTTPTestServer

pytest-server-fixtures/pytest_server_fixtures/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ class FixtureConfig(Config):
2020
'pg_config_executable',
2121
'redis_executable',
2222
'redis_image',
23-
'rethink_executable',
24-
'rethink_image',
2523
'httpd_executable',
2624
'httpd_image',
2725
'httpd_modules',
@@ -55,8 +53,6 @@ class FixtureConfig(Config):
5553
DEFAULT_SERVER_FIXTURES_PG_CONFIG = 'pg_config'
5654
DEFAULT_SERVER_FIXTURES_REDIS = 'redis-server'
5755
DEFAULT_SERVER_FIXTURES_REDIS_IMAGE = 'redis:5.0.2-alpine'
58-
DEFAULT_SERVER_FIXTURES_RETHINK = 'rethinkdb'
59-
DEFAULT_SERVER_FIXTURES_RETHINK_IMAGE = 'rethinkdb:2.3.6'
6056
DEFAULT_SERVER_FIXTURES_HTTPD = 'apache2'
6157
DEFAULT_SERVER_FIXTURES_HTTPD_IMAGE = 'httpd:2.4.37'
6258
DEFAULT_SERVER_FIXTURES_HTTPD_MODULES = '/usr/lib/apache2/modules'
@@ -82,8 +78,6 @@ class FixtureConfig(Config):
8278
pg_config_executable=os.getenv('SERVER_FIXTURES_PG_CONFIG', DEFAULT_SERVER_FIXTURES_PG_CONFIG),
8379
redis_executable=os.getenv('SERVER_FIXTURES_REDIS', DEFAULT_SERVER_FIXTURES_REDIS),
8480
redis_image=os.getenv('SERVER_FIXTURES_REDIS_IMAGE', DEFAULT_SERVER_FIXTURES_REDIS_IMAGE),
85-
rethink_executable=os.getenv('SERVER_FIXTURES_RETHINK', DEFAULT_SERVER_FIXTURES_RETHINK),
86-
rethink_image=os.getenv('SERVER_FIXTURES_RETHINK_IMAGE', DEFAULT_SERVER_FIXTURES_RETHINK_IMAGE),
8781
httpd_executable=os.getenv('SERVER_FIXTURES_HTTPD', DEFAULT_SERVER_FIXTURES_HTTPD),
8882
httpd_modules=os.getenv('SERVER_FIXTURES_HTTPD_MODULES', DEFAULT_SERVER_FIXTURES_HTTPD_MODULES),
8983
httpd_image=os.getenv('SERVER_FIXTURES_HTTPD_IMAGE', DEFAULT_SERVER_FIXTURES_HTTPD_IMAGE),

0 commit comments

Comments
 (0)