Skip to content

Commit

Permalink
Update container base images from Fedora 28 to Fedora 30
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah256 authored and mprahl committed Jun 3, 2019
1 parent 76bf975 commit e1398a0
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ $ sudo scripts/run-tests.sh
To run just a single test, you can run:

```bash
sudo scripts/run-tests.sh pytest -vvv tests/test_file::test_name
sudo scripts/run-tests.sh pytest-3 -vvv tests/test_file::test_name
```

## Code Styling
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile-api
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fedora:28
FROM fedora:30
LABEL maintainer="Factory 2.0"

WORKDIR /src
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile-scrapers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fedora:28
FROM fedora:30
LABEL maintainer="Factory 2.0"

ENV SCRAPER=all \
Expand Down
14 changes: 3 additions & 11 deletions docker/Dockerfile-tests
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
FROM fedora:28
FROM fedora:30

# TODO: Replace the Koji URL once the following is stable https://bodhi.fedoraproject.org/updates/FEDORA-2018-c929a49b1b
RUN dnf -y install \
--setopt=deltarpm=0 \
--setopt=install_weak_deps=false \
--setopt=tsflags=nodocs \
nmap-ncat \
python2-devel \
python3-devel \
python3-flake8 \
python2-flask \
python3-flask \
python2-flask-oidc \
python3-flask-oidc \
python2-mock \
python3-mock \
python2-neomodel \
python3-neomodel \
python3-prometheus_client \
python2-pytest \
python3-pytest \
python2-pytest-cov \
python3-pytest-cov \
python3-flake8-docstrings \
&& dnf clean all
# We must install prometheus_client for Python 2 since it is no longer packaged for Fedora
RUN pip install flake8-docstrings prometheus_client

VOLUME /src
WORKDIR /src
# Inspired from https://github.com/neo4j-contrib/neomodel/blob/master/tests-with-docker-compose.sh
CMD ["sh", "-c", "while ! nc -z -w 2 neo4j 7687; do sleep 1; done; pytest-2 -vvv --cov-report term-missing --cov=estuary tests/ && pytest-3 -vvv --cov-report term-missing --cov=estuary tests/ && flake8"]
CMD ["sh", "-c", "while ! nc -z -w 2 neo4j 7687; do sleep 1; done; pytest-3 -vvv --cov-report term-missing --cov=estuary tests/ && flake8"]
3 changes: 2 additions & 1 deletion tests/api/test_story.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from datetime import datetime

import pytest
from six.moves import urllib

from estuary.models.koji import KojiBuild, ContainerKojiBuild, ModuleKojiBuild
from estuary.models.bugzilla import BugzillaBug
Expand Down Expand Up @@ -1211,7 +1212,7 @@ def test_get_stories(client, resource, uids, expected):
containeradvisory.attached_builds.connect(cb)

for uid in uids:
url = '/api/v1/story/{0}/{1}'.format(resource, uid)
url = '/api/v1/story/{0}/{1}'.format(resource, urllib.parse.quote(uid))
rv = client.get(url)
assert rv.status_code == 200
assert json.loads(rv.data.decode('utf-8')) == expected
Expand Down
7 changes: 4 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

from estuary.app import create_app

neomodel_config.DATABASE_URL = os.environ.get('NEO4J_BOLT_URL', 'bolt://neo4j:neo4j@localhost:7687')
neomodel_config.AUTO_INSTALL_LABELS = True


@pytest.fixture(scope='session')
def client():
Expand All @@ -23,4 +20,8 @@ def client():
def run_before_tests():
"""Pytest fixture that prepares the environment before each test."""
# Code that runs before each test
neomodel_config.DATABASE_URL = os.environ.get(
'NEO4J_BOLT_URL', 'bolt://neo4j:neo4j@localhost:7687'
)
neomodel_config.AUTO_INSTALL_LABELS = True
neo4j_db.cypher_query('MATCH (a) DETACH DELETE a')

0 comments on commit e1398a0

Please sign in to comment.