-
Notifications
You must be signed in to change notification settings - Fork 119
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
Updated README with better instructions for running tests. #1018
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,32 +101,58 @@ directory to one of those two and follow the instructions. | |
Initialization | ||
############## | ||
|
||
The `config` integration tests use static config files. To run these tests | ||
make sure you set owner only permissions on these files: | ||
Before you can run the DC/OS CLI integration tests, you need to modify your | ||
environment appropriately. | ||
|
||
:code:`chmod 600 cli/tests/data/dcos.toml` | ||
#. Create a temporary directory to hold your DC/OS configuration files for the | ||
duration of the tests:: | ||
|
||
The :code:`node` integration tests use :code:`CLI_TEST_SSH_KEY_PATH` for ssh | ||
credentials to your cluster. | ||
$ mktemp -d | ||
<dcos-config-folder> | ||
|
||
The :code:`ssl` integration tests resolve :code:`dcos.snakeoil.mesosphere.com` | ||
to test SSL certs. To run this test suite be sure to add this resolution to your | ||
:code:`/etc/hosts` file: | ||
*NOTE:* You don't have to create a new directory every time you run the tests, | ||
but make sure you clear out whatever folder you use each time to avoid | ||
conflicts with previous runs. | ||
|
||
:code:`echo "your/dcos/cluster/url dcos.snakeoil.mesosphere.com" >> /etc/hosts` | ||
|
||
#. Copy a static :code:`dcos.toml` configuration file from the source repo into this | ||
folder:: | ||
|
||
$ cp cli/tests/data/dcos.toml <dcos-config-folder> | ||
|
||
|
||
#. Set the proper permissions on this file so that it can be used by the CLI:: | ||
|
||
$ chmod 600 <dcos-config-folder>/dcos.toml | ||
|
||
|
||
#. Export the proper environment variables so that the CLI knows to use this | ||
file and this directory for storing DC/OS configs:: | ||
|
||
$ export DCOS_DIR=<dcos-config-folder> | ||
$ export DCOS_CONFIG=<dcos-config-folder>/dcos.toml | ||
|
||
|
||
#. Set the :code:`CLI_TEST_SSH_KEY_PATH` to point at appropriate ssh credentials to | ||
your cluster. This is used by the :code:`node` integration tests:: | ||
|
||
$ export CLI_TEST_SSH_KEY_PATH=<path-to-ssh-key> | ||
|
||
|
||
#. Add the following resolution to your :code:`/etc/hosts` file. The :code:`ssl` | ||
integration tests resolve :code:`dcos.snakeoil.mesosphere.com` to test SSL certs:: | ||
|
||
$ echo "<cluster-ip-or-url> dcos.snakeoil.mesosphere.com" >> /etc/hosts | ||
|
||
Running | ||
####### | ||
|
||
Tox will run unit and integration tests in Python 3.5 using a temporarily | ||
created virtualenv. | ||
#. Finally, once all of this is set up, you need to launch a DC/OS cluster with | ||
the appropriate capabilities (see below in the section on :code:`Running`) and | ||
manually log into it:: | ||
|
||
Note that in order for all the integration tests to pass, your DC/OS cluster | ||
must have the experimental packaging features enabled. In order to enable | ||
these features the :code:`staged_package_storage_uri` and :code:`package_storage_uri` | ||
confiuguration paramenters must be set at cluster setup. | ||
See `dcos configuration parameters`_ for more information. | ||
$ dcos cluster setup <cluster-ip-or-url> | ||
|
||
Running | ||
####### | ||
|
||
There are two ways to run tests, you can either use the virtualenv created by | ||
:code:`make env` above:: | ||
|
@@ -137,6 +163,50 @@ Or, assuming you have tox installed (via :code:`sudo pip install tox`):: | |
|
||
tox | ||
|
||
Either way, tox will run unit and integration tests in Python 3.5 using a | ||
temporarily created virtualenv. | ||
|
||
*NOTE:* In order for all the integration tests to pass, your DC/OS cluster must | ||
have the experimental packaging features enabled. In order to enable these | ||
features the :code:`staged_package_storage_uri` and :code:`package_storage_uri` | ||
configuration paramenters must be set at cluster setup. See `dcos | ||
configuration parameters`_ for more information. | ||
|
||
The easiest way to launch a cluster with these capabilities is to use | ||
`dcos-launch`_ with the configuration listed below:: | ||
|
||
launch_config_version: 1 | ||
deployment_name: ${DEPLOYMENT_NAME} | ||
template_url: ${TEMPLATE_URL} | ||
provider: aws | ||
aws_region: us-west-2 | ||
template_parameters: | ||
KeyName: default | ||
AdminLocation: 0.0.0.0/0 | ||
PublicSlaveInstanceCount: 1 | ||
SlaveInstanceCount: 1 | ||
|
||
|
||
Where :code:`DEPLOYMENT_NAME` is a custom name set by the user, and | ||
:code:`TEMPLATE_URL` is the URL of an appropriate EC2 cloud formation template | ||
for running the integration tests. Unfortunately, the full integration test | ||
suite can only be run against an Enterprise DC/OS cluster (which you need | ||
special permissions to launch). | ||
|
||
For Mesosphere employees the URL of this cloud formation template can be found | ||
here:: | ||
|
||
https://mesosphere.onelogin.com/notes/45791 | ||
|
||
For everyone else, you can still run the integration test suite against a non | ||
EE cluster, but please be aware that some of the tests may fail. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem with this statement.. that non-ee cluster can be tested just be aware there may be failures...
|
||
|
||
Assuming you have :code:`tox` installed, you can avoid running the full test | ||
suite by running a specific test (or any tests matching a specific pattern) by | ||
executing:: | ||
|
||
tox -e py35-integration /<test-file>.py -- -k <test-pattern> | ||
|
||
Other Useful Commands | ||
##################### | ||
|
||
|
@@ -181,6 +251,7 @@ These packages are available to be installed by the DC/OS CLI installation scrip | |
.. _dcos: https://pypi.python.org/pypi/dcos | ||
.. _dcos configuration parameters: https://dcos.io/docs/1.9/administration/installing/custom/configuration-parameters/ | ||
.. _dcoscli: https://pypi.python.org/pypi/dcoscli | ||
.. _dcos-launch: https://github.com/mesosphere/dcos-launch | ||
.. _jq: http://stedolan.github.io/jq/ | ||
.. _git: http://git-scm.com | ||
.. _installation instructions: https://dcos.io/docs/usage/cli/install/ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did all the things... and I get a failure on
tests/integrations/test_config.py::test_dcos_url_env_var FAILED
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
output from stderr:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like there is a call to mesos for state... however the json decoder is failing instead of the expected unreachable url