[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 ARG PYTHON_VERSION=3.8
FROM python:${PYTHON_VERSION} FROM python:${PYTHON_VERSION}
COPY dev-requirements.txt /tmp
RUN python -m pip install -r /tmp/dev-requirements.txt
WORKDIR /code/elasticsearch-py 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: - email:
recipients: [email protected] recipients: [email protected]
- junit: - junit:
results: "*-junit.xml" results: "junit/*-junit.xml"
allow-empty-results: true 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 name: elastic+elasticsearch-py+7.x
display-name: 'elastic / elasticsearch-py # 7.x' display-name: 'elastic / elasticsearch-py # 7.x'
description: Testing the elasticsearch-py 7.x branch. description: Testing the elasticsearch-py 7.x branch.
junit_results: "*-junit.xml" junit_results: "junit/*-junit.xml"
parameters: parameters:
- string: - string:
name: branch_specifier name: branch_specifier
+1 -1
View File
@@ -3,7 +3,7 @@
name: elastic+elasticsearch-py+master name: elastic+elasticsearch-py+master
display-name: 'elastic / elasticsearch-py # master' display-name: 'elastic / elasticsearch-py # master'
description: Testing the elasticsearch-py master branch. description: Testing the elasticsearch-py master branch.
junit_results: "*-junit.xml" junit_results: "junit/*-junit.xml"
parameters: parameters:
- string: - string:
name: branch_specifier name: branch_specifier
@@ -3,7 +3,7 @@
name: elastic+elasticsearch-py+pull-request name: elastic+elasticsearch-py+pull-request
display-name: 'elastic / elasticsearch-py # pull-request' display-name: 'elastic / elasticsearch-py # pull-request'
description: Testing of elasticsearch-py pull requests. description: Testing of elasticsearch-py pull requests.
junit_results: "*-junit.xml" junit_results: "junit/*-junit.xml"
scm: scm:
- git: - git:
branches: branches:
+2
View File
@@ -31,6 +31,7 @@ docker build \
echo -e "\033[1m>>>>> Run [elastic/elasticsearch-py container] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" echo -e "\033[1m>>>>> Run [elastic/elasticsearch-py container] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
mkdir -p junit
docker run \ docker run \
--network=${NETWORK_NAME} \ --network=${NETWORK_NAME} \
--env "ELASTICSEARCH_HOST=${ELASTICSEARCH_URL}" \ --env "ELASTICSEARCH_HOST=${ELASTICSEARCH_URL}" \
@@ -38,5 +39,6 @@ docker run \
--env "PYTHON_CONNECTION_CLASS=${PYTHON_CONNECTION_CLASS}" \ --env "PYTHON_CONNECTION_CLASS=${PYTHON_CONNECTION_CLASS}" \
--name elasticsearch-py \ --name elasticsearch-py \
--rm \ --rm \
--volume `pwd`:/code/elasticsearch-py \
elastic/elasticsearch-py \ elastic/elasticsearch-py \
python setup.py test python setup.py test
+2 -1
View File
@@ -1,5 +1,6 @@
requests>=2, <3 requests>=2, <3
nose pytest
pytest-cov
coverage coverage
mock mock
nosexcover nosexcover
+3
View File
@@ -11,3 +11,6 @@ requires = python python-urllib3
[flake8] [flake8]
ignore = E203, E266, E501, W503 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 from os.path import dirname, join, pardir, abspath, exists
import subprocess import subprocess
import nose
def fetch_es_repo(): def fetch_es_repo():
# user is manually setting YAML dir, don't tamper with it # 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 # always insert coverage when running tests
if argv is None: if argv is None:
junit_xml = join(
abspath(dirname(dirname(__file__))), "junit", "elasticsearch-py-junit.xml"
)
argv = [ argv = [
"nosetests", "pytest",
"--with-xunit", "--cov=elasticsearch",
"--with-xcoverage", "--junitxml=%s" % junit_xml,
"--cover-package=elasticsearch", "--log-level=DEBUG",
"--cover-erase", "--cache-clear",
"--logging-filter=elasticsearch", "-vv",
"--logging-level=DEBUG", join(abspath(dirname(__file__)), "test_exceptions.py"),
"--verbose",
"--with-id",
] ]
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__": if __name__ == "__main__":
-2
View File
@@ -2,8 +2,6 @@
envlist = pypy,py27,py34,py35,py36,py37,py38,lint,docs envlist = pypy,py27,py34,py35,py36,py37,py38,lint,docs
[testenv] [testenv]
whitelist_externals = git whitelist_externals = git
setenv =
NOSE_XUNIT_FILE = junit-{envname}.xml
commands = commands =
python setup.py test python setup.py test