github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/ais/test/README.md (about)

     1  ## AIStore testing
     2  
     3  AIStore provides both unit tests and integration tests that can be run individually or in batches. Some tests require AIStore cluster, others do not, and some of the tests require the cluster (under test) to be deployed with more than one storage target and more than one proxy/gateway.
     4  
     5  To run all tests, make sure to deploy a AIStore cluster with at least 3 proxies/gateways and at least 3 targets.
     6  Then, cd to $GOPATH/src/github.com/NVIDIA/aistore and execute:
     7  
     8  ```console
     9  $ BUCKET=<provider>://<bucket_name> go test -v -p 1 -count 1 -timeout 1h ./...
    10  ```
    11  
    12  - provider: Backend provider AWS (="aws"), GCP (="gcp") or AZURE(="az") (note that some of the tests require access to the Cloud; optional if included in bucket name).
    13  - bucket_name: Cloud-based bucket backed by AWS or GCP (note that some of the tests require access to the Cloud).
    14  - -timeout 1h: to make sure the test runs are not terminated by the Go default 10 minute timeout.
    15  - -p 1: run tests sequentially; since all tests share the same bucket, we sometimes can't allow them to run in parallel.
    16  - -count=1: to disable Go test cache.
    17  - -v: when used, Go test shows result (PASS/FAIL) for each of the named tests.
    18  
    19  For a quick run, execute the following from the `$GOPATH/src/github.com/NVIDIA/aistore`:
    20  
    21  ```console
    22  $ BUCKET=<bucket name> go test -v -p 1 -count 1 -short ./...
    23  ```
    24  
    25  This will skip some long-running tests and run instead all unit tests, plus some basic PUT/GET/DELETE operations.
    26  
    27  To run individual tests:
    28  
    29  ```console
    30  $ BUCKET=<bucket name> go test ./ais/test -v -p 1 -run=Regression
    31  $ BUCKET=<bucket name> go test ./ais/test -v -p 1 -run=GetAndRe
    32  $ BUCKET=<bucket name> go test ./ais/test -run=TestProxy/PrimaryCrash
    33  ```