Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve new dev experience in README #674

Merged
merged 4 commits into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CHANGELOG
* doc-fix: move overview content in main README into sphynx project
* bug-fix: pass accelerator_type in ``deploy`` for REST API TFS ``Model``
* doc-fix: move content from tf/README.rst into sphynx project
* doc-fix: Improve new developer experience in README

1.18.3.post1
============
Expand Down
31 changes: 22 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,16 @@ Running tests

SageMaker Python SDK has unit tests and integration tests.

You can install the libraries needed to run the tests by running :code:`pip install --upgrade .[test]` or, for Zsh users: :code:`pip install --upgrade .\[test\]`

**Unit tests**

tox is a prerequisite for running unit tests so you need to make sure you have it installed. To run the unit tests:

We run unit tests with tox, which is a program that lets you run unit tests for multiple Python versions, and also make sure the
code fits our style guidelines. We run tox with Python 2.7 and 3.6, so to run unit tests
with the same configuration we do, you'll need to have interpreters for Python 2.7 and Python 3.6 installed.

To run the unit tests with tox, run:
laurenyu marked this conversation as resolved.
Show resolved Hide resolved

::

Expand All @@ -109,23 +116,29 @@ tox is a prerequisite for running unit tests so you need to make sure you have i

To run the integration tests, the following prerequisites must be met

1. Access to an AWS account to run the tests on
2. AWS account credentials available to boto3 clients used in the tests
3. The AWS account has an IAM role named :code:`SageMakerRole`
4. The libraries listed in the ``extras_require`` object in ``setup.py`` for ``test`` are installed.
You can do this by running the following command: :code:`pip install --upgrade .[test]`
1. AWS account credentials are available in the environment for the boto3 client to use.
2. The AWS account has an IAM role named :code:`SageMakerRole` with the AmazonSageMakerFullAccess policy attached.

We recommend selectively running just those integration tests you'd like to run. You can filter by individual test function names with:

::

pytest -k 'test_i_care_about'


You can run integ tests by issuing the following command:
You can also run all of the integration tests by running the following command, which runs them in sequence, which may take a while:

::

pytest tests/integ

You can also filter by individual test function names (usable with any of the previous commands):

You can also run them in parallel:

::

pytest -k 'test_i_care_about'
pytest -n auto tests/integ


Building Sphinx docs
~~~~~~~~~~~~~~~~~~~~
Expand Down