Skip to content

Commit bb34b27

Browse files
authored
Test setup and documentation fixes (#584)
* Fix `make json schema` for macOS Use gtar instead of tar * Add psutil to requirement-base Had a unit test failure without it installed: test_send_remote_failover_sync_non_transport_exception_error * Add some testing artifacts to .gitignore * Fix a couple of testing documentation issues * Fix psutil test properly test_send_remote_failover_sync_non_transport_exception_error isn't concerned with metrics, so just disable the metrics sets.
1 parent 8c0f752 commit bb34b27

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ coverage
2525
/testdb.sql
2626
venv
2727
benchmarks/result*
28+
coverage.xml
29+
tests/python-agent-junit.xml

docs/run-tests-locally.asciidoc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,18 @@ We run the test suite on different combinations of Python versions and web frame
5555
----
5656
$ ./tests/scripts/docker/run_tests.sh python-version framework-version <pip-cache-dir>
5757
----
58-
NOTE: The `python-version` must be of format `python:version`, e.g. `python:3.6` or `pypy:2`.
58+
NOTE: The `python-version` must be of format `python-version`, e.g. `python-3.6` or `pypy-2`.
5959
The `framework` must be of format `framework-version`, e.g. `django-1.10` or `flask-0.12`.
60+
61+
==== Integration testing
62+
63+
Check out https://github.com/elastic/apm-integration-testing for resources for
64+
setting up full end-to-end testing environments. For example, to spin up
65+
an environment with the https://github.com/basepi/opbeans-python[opbeans Django app],
66+
with version 7.3 of the elastic stack and the apm-python-agent from your local
67+
checkout, you might do something like this:
68+
69+
[source,bash]
70+
----
71+
$ ./scripts/compose.py start 7.3 --with-agent-python-django --with-opbeans-python --opbeans-python-agent-local-repo=~/elastic/apm-agent-python

72+
----

tests/client/client_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ def test_send_remote_failover_sync_non_transport_exception_error(should_try, htt
250250
secret_token="secret",
251251
transport_class="elasticapm.transport.http.Transport",
252252
metrics_interval="0ms",
253+
metrics_sets=[],
253254
)
254255
# test error
255256
http_send.side_effect = ValueError("oopsie")

tests/scripts/download_json_schema.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ download_schema()
77
rm -rf ${1} && mkdir -p ${1}
88
for run in 1 2 3 4 5
99
do
10-
curl --silent --fail https://codeload.github.com/elastic/apm-server/tar.gz/${2} | tar xzvf - --wildcards --directory=${1} --strip-components=1 "*/docs/spec/*"
10+
if [ -x "$(command -v gtar)" ]; then
11+
curl --silent --fail https://codeload.github.com/elastic/apm-server/tar.gz/${2} | gtar xzvf - --wildcards --directory=${1} --strip-components=1 "*/docs/spec/*"
12+
else
13+
curl --silent --fail https://codeload.github.com/elastic/apm-server/tar.gz/${2} | tar xzvf - --wildcards --directory=${1} --strip-components=1 "*/docs/spec/*"
14+
fi
1115
result=$?
1216
if [ $result -eq 0 ]; then break; fi
1317
sleep 1

0 commit comments

Comments
 (0)