Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ sections:
EXTRACT_ALL = YES
INLINE_SOURCES = NO
ALIASES = cassandra{1}="<b>Requires Cassandra:</b> \1"
checks:
external_links:
exclude:
- 'https://ci.appveyor.com/api/projects/status/ec0x0vuk59as28r6/branch/master'
rewrites:
- http://datastax.github.io/cpp-driver/: /
- https://datastax.github.io/cpp-driver/: /
Expand Down
11 changes: 9 additions & 2 deletions topics/testing/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Testing
Before proceeding ensure the tests were built using the [build procedures].

Both unit and integration tests use [Boost.Test](http://www.boost.org/doc/libs/1_62_0/libs/test/doc/html/index.html).

Integration tests rely on [Cassandra Cluster Manager (CCM)](ccm) to be installed and a [configuration file](configuration)
in the working directory where tests are executed.

Details for running unit and integration tests can be found [here](running).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • There is also a configuration file (that is being deprecated) in favor of command line driven options, we might also want to include information about the config.txt file until it is fully removed and that it should be located in the working directory (integration tests only as the unit tests do not require any additional configuration elements to run). I don't think we should document the defaults as we update them during release to use the latest Cassandra version at the time.
  • CCM information is also missing as a dependency (this is required for the integration tests to run properly)

Each test performs a [setup](#setup-cassandra), [execute](#execute-test), and
[teardown](#teardown-cassandra). This ensures that each test has a clean and
consistent run against the Apache Cassandra instance during the execution
Expand Down Expand Up @@ -41,7 +48,7 @@ cluster may be as large as nine nodes depending on the test being performed.

```

### Execute Test
#### Execute Test
```ditaa
/-----------\ /------------\
| Unit Test | Perform Test | C++ Driver |
Expand Down Expand Up @@ -80,7 +87,7 @@ cluster may be as large as nine nodes depending on the test being performed.
\--------------------/
```

### Teardown Cassandra
#### Teardown Cassandra
```ditaa
/------------------\ /------------\ /-------------\ /----------\
| Integration Test | | CCM Bridge | | CCM Machine | | CCM Tool |
Expand Down
53 changes: 39 additions & 14 deletions topics/testing/running/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@

## Unit Testing
The unit tests do not require any additional setup or configuration. Simply run
the `cassandra_unit_tests` executable. Unit tests are used to ensure the
functionality of internal components and don't require an instance of Cassandra
the `cassandra_unit_tests` executable.

This executable can be found in the
`test/unit_tests` directory under the `build` directory on Unix platforms. The `build`
directory is typically the current working directory when you run unit tests since that
is the directory where the build was launched from.

The `cassandra_unit_tests` executable is located in the `driver\test\unit_tests\<build flavor>` directory on
Windows. `<build flavor>` is either `Release` or `Debug`.

Unit tests are used to ensure the functionality of internal components and don't require an instance of Cassandra
to be running.

## Integration Testing
Expand All @@ -12,32 +21,48 @@ The integration tests require a machine (local or remote) with Secure Shell
tests rely on [Cassandra Cluster Manager (CCM)] and
cannot run successfully if this dependency is not met. Once the [configuration]
has been completed the integration tests can be run by executing the
`cassandra_integration_tests` executable. Integration tests are used to ensure
the functionality of the driver's API and/or the interaction of multiple
`cassandra_integration_tests` executable.

This executable can be found in the `test/integration_tests` directory under the `build`
directory on Unix platforms. The `build` directory is typically the current working directory
when you run unit tests since that is the directory where the build was launched from.

The `cassandra_integration_tests` executable is located in the
`driver\test\integration_tests\<build flavor>` directory on Windows. `<build flavor>` is
either `Release` or `Debug`.

Integration tests are used to ensure the functionality of the driver's API and/or the interaction of multiple
internal components.

### Running Tests Individually
Running the integration test executable without any arguments will start all
of the integration tests in sequence (one after another). The Boost Test
## Running Tests Individually
Running the unit or integration test executable without any arguments will start all
of the tests in sequence (one after another). The Boost Test
framework with which the integration and unit tests are compiled come with a
filter argument that allow for individual test execution. Using the
`--run_test` argument supplying the test suite and case will execute a single
filter argument that allows for individual test execution. Using the
`--run_test` (or `-t` short option) argument, supplying the test suite and case will execute a single
test.

#### Example
### Example
The example below shows how to execute the `simple` test case in the `async`
test suite.
test suite of the integration tests.

```bash
cassandra_integration_tests --run_test=async/simple
./test/integration_tests/cassandra_integration_tests --run_test=async/simple
````

To run all of the test cases in the `async` suite wildcards can be used in
To run all of the test cases in the `async` suite, wildcards can be used in
conjunction with the `run_test` argument

```bash
cassandra_integration_tests --run_test=async/*
./test/integration_tests/cassandra_integration_tests -t async/*
```

Equivalently, without wildcards all test cases within the suite run:

```bash
./test/integration_tests/cassandra_integration_tests -t async
```


[Cassandra Cluster Manager (CCM)]: http://datastax.github.io/cpp-driver/topics/testing/ccm/
[configuration]: http://datastax.github.io/cpp-driver/topics/testing/configuration/