Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



test - Run gsutil tests

test - Run gsutil tests

Synopsis

gsutil test [-l] [-u] [-f] [command command...]

Description

The gsutil test command runs the gsutil unit tests and integration tests. The unit tests use an in-memory mock storage service implementation, while the integration tests send requests to the production service using the preferred API set in the boto configuration file (see gsutil help apis for details).

To run both the unit tests and integration tests, run the command with no arguments:

gsutil test

To run the unit tests only (which run quickly):

gsutil test -u

To run integration tests in parallel (CPU-intensive but much faster):

gsutil -m test

To limit the number of tests run in parallel to 10 at a time:

gsutil -m test -p 10

To see additional details for test failures:

gsutil -d test

To have the tests stop running immediately when an error occurs:

gsutil test -f

To run tests for one or more individual commands add those commands as arguments. For example, the following command will run the cp and mv command tests:

gsutil test cp mv

To list available tests, run the test command with the -l argument:

gsutil test -l

The tests are defined in the code under the gslib/tests module. Each test file is of the format test_[name].py where [name] is the test name you can pass to this command. For example, running “gsutil test ls” would run the tests in “gslib/tests/test_ls.py”.

You can also run an individual test class or function name by passing the test module followed by the class name and optionally a test name. For example, to run the an entire test class by name:

gsutil test naming.GsutilNamingTests

or an individual test function:

gsutil test cp.TestCp.test_streaming

You can list the available tests under a module or class by passing arguments with the -l option. For example, to list all available test functions in the cp module:

gsutil test -l cp

Options

-f Exit on first test failure.
-l List available tests.
-p Run at most N tests in parallel. The default value is 15.
-s Run tests against S3 instead of GS.
-u Only run unit tests.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.