Skip to content

Commit

Permalink
Add doctests to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmlarson committed Apr 2, 2020
1 parent 9c338e9 commit 2e8e1ea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 28 deletions.
20 changes: 3 additions & 17 deletions .ci/run-elasticsearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,9 @@ if [[ "$ELASTICSEARCH_VERSION" != *oss* ]]; then
environment+=($(cat <<-END
--env ELASTIC_PASSWORD=$ELASTIC_PASSWORD
--env xpack.license.self_generated.type=trial
--env xpack.security.enabled=true
--env xpack.security.http.ssl.enabled=true
--env xpack.security.http.ssl.verification_mode=certificate
--env xpack.security.http.ssl.key=certs/testnode_san.key
--env xpack.security.http.ssl.certificate=certs/testnode_san.crt
--env xpack.security.http.ssl.certificate_authorities=certs/ca.crt
--env xpack.security.transport.ssl.enabled=true
--env xpack.security.transport.ssl.key=certs/testnode_san.key
--env xpack.security.transport.ssl.certificate=certs/testnode_san.crt
--env xpack.security.transport.ssl.certificate_authorities=certs/ca.crt
END
))
volumes+=($(cat <<-END
--volume $SSL_CERT:/usr/share/elasticsearch/config/certs/testnode_san.crt
--volume $SSL_KEY:/usr/share/elasticsearch/config/certs/testnode_san.key
--volume $SSL_CA:/usr/share/elasticsearch/config/certs/ca.crt
--volume $SSL_CA_PEM:/usr/share/elasticsearch/config/certs/ca.pem
--env xpack.security.enabled=false
--env xpack.security.http.ssl.enabled=false
--env xpack.security.transport.ssl.enabled=false
END
))
fi
Expand Down
11 changes: 1 addition & 10 deletions eland/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,8 @@
# Define client to use in tests
TEST_SUITE = os.environ.get("TEST_SUITE", "xpack")
if TEST_SUITE == "xpack":
print("Running xpack tests requires SSL. Setting up SSL enabled client")
certpath = os.path.abspath(
os.path.join(os.path.dirname(__file__), "../../.ci/certs/ca.crt")
)
print(certpath)
ES_TEST_CLIENT = Elasticsearch(
ELASTICSEARCH_HOST,
http_auth=("elastic", "changeme"),
use_ssl=True,
verify_certs=True,
ca_certs=certpath,
ELASTICSEARCH_HOST, http_auth=("elastic", "changeme"),
)
else:
ES_TEST_CLIENT = Elasticsearch(ELASTICSEARCH_HOST)
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ def lint(session):
def test(session):
session.install("-r", "requirements-dev.txt")
session.run("python", "-m", "eland.tests.setup_tests")
session.run("pytest", *(session.posargs or ("eland/tests/",)))
session.run("pytest", "--doctest-modules", *(session.posargs or ("eland/",)))

0 comments on commit 2e8e1ea

Please sign in to comment.