forked from inspirehep/hepcrawl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds: logger to `InspireCeleryPushLine.close_spider` in order to be able to inspect outgoing celery tasks to Inspire. * Adds: disable passive ftp mode for WSP spider. * Adds: dockerized environment for functional tests (Dockerfile for hepcrawl, docker-compose files). * Adds: docker FTPServer with needed fixtures for the WSP's functional tests. * Adds: mocked celery tasks to catch outgoing tasks to Inspire. * Adds: WSP functional test. * Adds: WSP functional test to travis. * Adds: dockerized execution on travis for unit tests and docs. Signed-off-by: Spiros Delviniotis <[email protected]>
- Loading branch information
1 parent
1e268aa
commit 6d06078
Showing
24 changed files
with
618 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of hepcrawl. | ||
# Copyright (C) 2017 CERN. | ||
# | ||
# hepcrawl is a free software; you can redistribute it and/or modify it | ||
# under the terms of the Revised BSD License; see LICENSE file for | ||
# more details. | ||
|
||
[run] | ||
parallel = True | ||
omit = | ||
/hepcrawl_venv/lib/python2.7/site-packages/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of hepcrawl. | ||
# Copyright (C) 2015, 2016, 2017 CERN. | ||
# | ||
# hepcrawl is a free software; you can redistribute it and/or modify it | ||
# under the terms of the Revised BSD License; see LICENSE file for | ||
# more details. | ||
|
||
FROM centos | ||
|
||
RUN yum install -y epel-release && \ | ||
yum update -y && \ | ||
yum install -y \ | ||
file \ | ||
gcc \ | ||
libffi-devel \ | ||
libxml2-devel \ | ||
libxslt-devel \ | ||
libssl-devel \ | ||
make \ | ||
openssl-devel \ | ||
poppler-utils \ | ||
python-pip \ | ||
python-virtualenv && \ | ||
yum clean all | ||
|
||
RUN mkdir /code | ||
|
||
ADD /docker_entrypoint.sh /docker_entrypoint.sh | ||
ENTRYPOINT ["/docker_entrypoint.sh"] | ||
|
||
WORKDIR /code | ||
|
||
CMD true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of hepcrawl. | ||
# Copyright (C) 2015, 2016, 2017 CERN. | ||
# | ||
# hepcrawl is a free software; you can redistribute it and/or modify it | ||
# under the terms of the Revised BSD License; see LICENSE file for | ||
# more details. | ||
|
||
version: '2' | ||
|
||
services: | ||
pip: | ||
build: | ||
context: ${PWD} | ||
dockerfile: Dockerfile | ||
image: hepcrawl_base | ||
command: bash -c "pip install -e .[all] && pip freeze" | ||
volumes: | ||
- ${DOCKER_DATA}/tmp/hepcrawl_venv:/hepcrawl_venv/ | ||
- ${PWD}:/code/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of hepcrawl. | ||
# Copyright (C) 2017 CERN. | ||
# | ||
# hepcrawl is a free software; you can redistribute it and/or modify it | ||
# under the terms of the Revised BSD License; see LICENSE file for | ||
# more details. | ||
|
||
version: '2' | ||
|
||
services: | ||
functional_wsp: | ||
image: hepcrawl_base # hepcrawl_base image is build at pip service of docker-compose.deps.yml | ||
environment: &env_variables | ||
- APP_BROKER_URL=amqp://guest:guest@rabbitmq:5672// | ||
- APP_CELERY_RESULT_BACKEND=amqp://guest:guest@rabbitmq:5672// | ||
- APP_CRAWLER_HOST_URL=http://scrapyd:6800 | ||
- APP_API_PIPELINE_TASK_ENDPOINT_DEFAULT=tests.functional.tasks.submit_results | ||
- COVERAGE_PROCESS_START=/code/.coveragerc | ||
command: py.test -vv tests/functional/WSP/test_wsp.py | ||
volumes: &static_volume | ||
- ${DOCKER_DATA}/tmp/hepcrawl_venv:/hepcrawl_venv/ | ||
- ${PWD}:/code/ | ||
- ${PWD}/tests/functional/scrapyd_coverage_runner.conf:/etc/scrapyd/scrapyd.conf | ||
links: | ||
- rabbitmq | ||
- celery | ||
- scrapyd | ||
- ftp_server | ||
|
||
unit: | ||
image: hepcrawl_base | ||
environment: *env_variables | ||
command: bash -c "py.test tests/unit && sphinx-build -nNW docs docs/_build/html && python setup.py sdist && ls dist/*" | ||
volumes: *static_volume | ||
|
||
doc: | ||
image: hepcrawl_base | ||
environment: *env_variables | ||
command: bash -c "sphinx-build -qnNW docs docs/_build/html && exec python setup.py sdist && exec ls dist/*" | ||
volumes: *static_volume | ||
|
||
celery: | ||
image: hepcrawl_base | ||
environment: *env_variables | ||
command: celery worker --events --app tests.functional.tasks --loglevel=debug | ||
volumes: *static_volume | ||
links: | ||
- rabbitmq | ||
- ftp_server | ||
|
||
scrapyd: | ||
image: hepcrawl_base | ||
environment: *env_variables | ||
command: bash -c "rm -f twistd.pid && exec scrapyd" | ||
volumes: *static_volume | ||
links: | ||
- celery | ||
- ftp_server | ||
- rabbitmq | ||
depends_on: | ||
- scrapyd_deploy | ||
|
||
scrapyd_deploy: | ||
image: hepcrawl_base | ||
environment: *env_variables | ||
command: bash -c "sleep 10 && scrapyd-deploy" # make sure that the scrapyd is up | ||
volumes: *static_volume | ||
|
||
ftp_server: | ||
image: stilliard/pure-ftpd:hardened | ||
environment: | ||
- PUBLICHOST=localhost | ||
volumes: | ||
- ${PWD}/tests/functional/WSP/fixtures/ftp_server/WSP:/home/ftpusers/bob/WSP | ||
- ${PWD}/tests/functional/WSP/fixtures/ftp_server/pureftpd.passwd:/etc/pure-ftpd/passwd/pureftpd.passwd | ||
|
||
rabbitmq: | ||
image: rabbitmq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of hepcrawl. | ||
# Copyright (C) 2017 CERN. | ||
# | ||
# hepcrawl is a free software; you can redistribute it and/or modify it | ||
# under the terms of the Revised BSD License; see LICENSE file for | ||
# more details. | ||
|
||
set -e | ||
|
||
VENV_PATH=/hepcrawl_venv | ||
|
||
if [ ! -f "$VENV_PATH/bin/activate" ]; then | ||
virtualenv "$VENV_PATH" | ||
source "$VENV_PATH"/bin/activate | ||
pip install --upgrade pip | ||
pip install --upgrade setuptools wheel | ||
else | ||
source "$VENV_PATH"/bin/activate | ||
fi | ||
|
||
find \( -name __pycache__ -o -name '*.pyc' \) -delete | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.