[7.x] Move junit XML out of Docker

This commit is contained in:
Seth Michael Larson
2020-05-19 12:53:24 -05:00
committed by GitHub
parent 9cc48b3e66
commit 2f8c0843a6
11 changed files with 42 additions and 24 deletions
+3 -5
View File
@@ -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 . .
+1 -1
View File
@@ -72,5 +72,5 @@
- email:
recipients: [email protected]
- junit:
results: "*-junit.xml"
results: "junit/*-junit.xml"
allow-empty-results: true
+12
View File
@@ -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.)
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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:
+2
View File
@@ -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
+2 -1
View File
@@ -1,5 +1,6 @@
requests>=2, <3
nose
pytest
pytest-cov
coverage
mock
nosexcover
+3
View File
@@ -11,3 +11,6 @@ requires = python python-urllib3
[flake8]
ignore = E203, E266, E501, W503
[tool:pytest]
junit_family=legacy
+16 -12
View File
@@ -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__":
-2
View File
@@ -2,8 +2,6 @@
envlist = pypy,py27,py34,py35,py36,py37,py38,lint,docs
[testenv]
whitelist_externals = git
setenv =
NOSE_XUNIT_FILE = junit-{envname}.xml
commands =
python setup.py test