[7.x] Move junit XML out of Docker
This commit is contained in:
+3
-5
@@ -1,9 +1,7 @@
|
||||
ARG PYTHON_VERSION=3.8
|
||||
FROM python:${PYTHON_VERSION}
|
||||
|
||||
COPY dev-requirements.txt /tmp
|
||||
RUN python -m pip install -r /tmp/dev-requirements.txt
|
||||
|
||||
WORKDIR /code/elasticsearch-py
|
||||
|
||||
COPY dev-requirements.txt .
|
||||
RUN python -m pip install -r dev-requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
@@ -72,5 +72,5 @@
|
||||
- email:
|
||||
recipients: [email protected]
|
||||
- junit:
|
||||
results: "*-junit.xml"
|
||||
results: "junit/*-junit.xml"
|
||||
allow-empty-results: true
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- job:
|
||||
name: elastic+elasticsearch-py+6.x
|
||||
display-name: 'elastic / elasticsearch-py # 6.x'
|
||||
description: Testing the elasticsearch-py 6.x branch.
|
||||
junit_results: "junit/*-junit.xml"
|
||||
parameters:
|
||||
- string:
|
||||
name: branch_specifier
|
||||
default: refs/heads/6.x
|
||||
description: the Git branch specifier to build (<branchName>, <tagName>,
|
||||
<commitId>, etc.)
|
||||
@@ -3,7 +3,7 @@
|
||||
name: elastic+elasticsearch-py+7.x
|
||||
display-name: 'elastic / elasticsearch-py # 7.x'
|
||||
description: Testing the elasticsearch-py 7.x branch.
|
||||
junit_results: "*-junit.xml"
|
||||
junit_results: "junit/*-junit.xml"
|
||||
parameters:
|
||||
- string:
|
||||
name: branch_specifier
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
name: elastic+elasticsearch-py+master
|
||||
display-name: 'elastic / elasticsearch-py # master'
|
||||
description: Testing the elasticsearch-py master branch.
|
||||
junit_results: "*-junit.xml"
|
||||
junit_results: "junit/*-junit.xml"
|
||||
parameters:
|
||||
- string:
|
||||
name: branch_specifier
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
name: elastic+elasticsearch-py+pull-request
|
||||
display-name: 'elastic / elasticsearch-py # pull-request'
|
||||
description: Testing of elasticsearch-py pull requests.
|
||||
junit_results: "*-junit.xml"
|
||||
junit_results: "junit/*-junit.xml"
|
||||
scm:
|
||||
- git:
|
||||
branches:
|
||||
|
||||
@@ -31,6 +31,7 @@ docker build \
|
||||
|
||||
echo -e "\033[1m>>>>> Run [elastic/elasticsearch-py container] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
|
||||
|
||||
mkdir -p junit
|
||||
docker run \
|
||||
--network=${NETWORK_NAME} \
|
||||
--env "ELASTICSEARCH_HOST=${ELASTICSEARCH_URL}" \
|
||||
@@ -38,5 +39,6 @@ docker run \
|
||||
--env "PYTHON_CONNECTION_CLASS=${PYTHON_CONNECTION_CLASS}" \
|
||||
--name elasticsearch-py \
|
||||
--rm \
|
||||
--volume `pwd`:/code/elasticsearch-py \
|
||||
elastic/elasticsearch-py \
|
||||
python setup.py test
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
requests>=2, <3
|
||||
nose
|
||||
pytest
|
||||
pytest-cov
|
||||
coverage
|
||||
mock
|
||||
nosexcover
|
||||
|
||||
@@ -11,3 +11,6 @@ requires = python python-urllib3
|
||||
|
||||
[flake8]
|
||||
ignore = E203, E266, E501, W503
|
||||
|
||||
[tool:pytest]
|
||||
junit_family=legacy
|
||||
|
||||
@@ -10,8 +10,6 @@ from os import environ
|
||||
from os.path import dirname, join, pardir, abspath, exists
|
||||
import subprocess
|
||||
|
||||
import nose
|
||||
|
||||
|
||||
def fetch_es_repo():
|
||||
# user is manually setting YAML dir, don't tamper with it
|
||||
@@ -70,19 +68,25 @@ def run_all(argv=None):
|
||||
|
||||
# always insert coverage when running tests
|
||||
if argv is None:
|
||||
junit_xml = join(
|
||||
abspath(dirname(dirname(__file__))), "junit", "elasticsearch-py-junit.xml"
|
||||
)
|
||||
argv = [
|
||||
"nosetests",
|
||||
"--with-xunit",
|
||||
"--with-xcoverage",
|
||||
"--cover-package=elasticsearch",
|
||||
"--cover-erase",
|
||||
"--logging-filter=elasticsearch",
|
||||
"--logging-level=DEBUG",
|
||||
"--verbose",
|
||||
"--with-id",
|
||||
"pytest",
|
||||
"--cov=elasticsearch",
|
||||
"--junitxml=%s" % junit_xml,
|
||||
"--log-level=DEBUG",
|
||||
"--cache-clear",
|
||||
"-vv",
|
||||
join(abspath(dirname(__file__)), "test_exceptions.py"),
|
||||
]
|
||||
|
||||
nose.run_exit(argv=argv, defaultTest=abspath(dirname(__file__)))
|
||||
exit_code = 0
|
||||
try:
|
||||
subprocess.check_call(argv, stdout=sys.stdout, stderr=sys.stderr)
|
||||
except subprocess.CalledProcessError as e:
|
||||
exit_code = e.returncode
|
||||
sys.exit(exit_code)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user