Skip to content

Commit

Permalink
Merge branch 'master' into globalclient
Browse files Browse the repository at this point in the history
  • Loading branch information
basepi authored Mar 1, 2021
2 parents ebebeaa + c58b213 commit be9abfa
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 65 deletions.
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,10 @@ To run local unit tests, you can install the relevant
and then run `make test` from the project root:

pip install -r tests/requirements/reqs-flask-1.1.txt
make update-json-schema
make test

Pytest will automatically discover all the tests and skip the ones for which
dependencies are not met. Note that `make update-json-schema` should only need
to be run once.
dependencies are not met.

If you want to go above and beyond and run the full test suite,
you need to install several databases (Elasticsearch, PostgreSQL, MySQL, Cassandra, Redis).
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,4 @@ coverage: test
docs:
bash ./scripts/build_docs.sh apm-agent-python ./docs ${BUILD_DIR}

update-json-schema:
bash ./tests/scripts/download_json_schema.sh

.PHONY: isort flake8 test coverage docs update-json-schema
.PHONY: isort flake8 test coverage docs
3 changes: 0 additions & 3 deletions scripts/run-tests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
: - PYTHON: the python installation path.
@echo off

ECHO Download json schema dependencies
call .\tests\scripts\download_json_schema.bat

@echo on
set COVERAGE_FILE=.coverage.%VERSION%.%WEBFRAMEWORK%
set IGNORE_PYTHON3_WITH_PYTHON2=
Expand Down
12 changes: 4 additions & 8 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,10 @@

cur_dir = os.path.dirname(os.path.realpath(__file__))

ERRORS_SCHEMA = os.path.join(cur_dir, ".schemacache", "error.json")
TRANSACTIONS_SCHEMA = os.path.join(cur_dir, ".schemacache", "transaction.json")
SPAN_SCHEMA = os.path.join(cur_dir, ".schemacache", "span.json")
METADATA_SCHEMA = os.path.join(cur_dir, ".schemacache", "metadata.json")

assert os.path.exists(ERRORS_SCHEMA) and os.path.exists(
TRANSACTIONS_SCHEMA
), 'JSON Schema files not found. Run "make update-json-schema" to download'
ERRORS_SCHEMA = os.path.join(cur_dir, "upstream", "json-specs", "error.json")
TRANSACTIONS_SCHEMA = os.path.join(cur_dir, "upstream", "json-specs", "transaction.json")
SPAN_SCHEMA = os.path.join(cur_dir, "upstream", "json-specs", "span.json")
METADATA_SCHEMA = os.path.join(cur_dir, "upstream", "json-specs", "metadata.json")


with codecs.open(ERRORS_SCHEMA, encoding="utf8") as errors_json, codecs.open(
Expand Down
12 changes: 0 additions & 12 deletions tests/scripts/download_json_schema.bat

This file was deleted.

32 changes: 0 additions & 32 deletions tests/scripts/download_json_schema.sh

This file was deleted.

2 changes: 0 additions & 2 deletions tests/scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ else
fi
fi

make update-json-schema

if [[ -n $WAIT_FOR_HOST ]]
then
echo "Waiting for $WAIT_FOR_HOST:$WAIT_FOR_PORT"
Expand Down
1 change: 0 additions & 1 deletion travis/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ pip install -r "tests/requirements/reqs-${WEBFRAMEWORK}.txt" --cache-dir "${PIP_

export PYTHON_VERSION=$TRAVIS_PYTHON_VERSION

make update-json-schema
make test

0 comments on commit be9abfa

Please sign in to comment.