Skip to content

Commit c9e43bd

Browse files
committed
doc: running integration tests locally
1 parent de97d70 commit c9e43bd

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

CONTRIBUTING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,23 @@ The following is a check list of requirements that need to be satisfied in order
2121
* The merge commit passes the regression test suite on GitHub Actions
2222
* `go fmt` has been applied to the submitted code
2323
* Notable changes (i.e. new features or changed behavior, bugfixes) are appropriately documented in CHANGELOG.md, functional changes also in godoc
24+
* Before a Pull Request or a new commit, ensure that all tests pass successfully. You can run all tests locally using the following command (this process takes approximately 15 minutes):
25+
```
26+
go test -v -tags "integration cassandra tc gocql_debug" -timeout=20m -race -gocql.timeout=60s -runssl -proto=4 -rf=3 -clusterSize=3 -autowait=2000ms -compressor=snappy -gocql.cversion=4.0.8 ./...
27+
```
28+
and
29+
```
30+
go test -v -run=TestAuthentication -tags ""integration" gocql_debug" -timeout=2m -runauth -gocql.timeout=60s -runssl -proto=4 -rf=3 -clusterSize=1 -autowait=2000ms -runauth -compressor=snappy -gocql.cversion=4.0.8
31+
```
32+
### ℹ️ **Note:**
33+
34+
> The main_test.go file serves as the entry point for integration tests. It sets up an actual Cassandra cluster, sharing resources before tests are run and cleaning them up afterward, ensuring a consistent and efficient testing environment. The cluster is created locally, so you will need Docker installed.
35+
>
36+
>
37+
> The setup supports both single-node (quick setup in seconds) and multi-node Cassandra clusters (approx. 5 minutes, configurable via the `-clusterSize` flag). If you're curious to try integration tests, feel free to run them yourself. Just ensure that your tests are tagged correctly (e.g., `integration`), since `main_test.go` skips unit tests for performance reasons (no need to start a cluster for unit tests)
38+
>
39+
> You can find examples of running integration tests in the "Before a Pull Request" section.
40+
>
2441
* A correctly formatted commit message, see below
2542

2643
If there are any requirements that can't be reasonably satisfied, please state this either on the pull request or as part of discussion on the mailing list. Where appropriate, the core team may apply discretion and make an exception to these requirements.

0 commit comments

Comments
 (0)