Skip to content

Commit 69e9773

Browse files
authored
Merge branch 'master' into compress_rdb
2 parents 1f68e6a + 13e1fd9 commit 69e9773

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

TESTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,16 @@ Running a single test:
6262
```sh
6363
TF_UPDATE_CASSETTES=true TF_LOG=DEBUG SCW_DEBUG=1 TF_ACC=1 go test ./scaleway -v -run=TestAccScalewayDataSourceRDBInstance_Basic -timeout=120m -parallel=10
6464
```
65+
66+
## Compressing the cassettes
67+
68+
We record interactions with the Scaleway API in cassettes, which are stored in the `testdata` directory of each service.
69+
Each wait function used in the resources will perform several requests to the API for pulling a resource state, which can lead to large cassettes.
70+
We use a compressor to reduce the size of these cassettes once they are recorded.
71+
By doing so, tests can run faster and the cassettes are easier to read.
72+
73+
To use the compressor on a given cassette, run the following command:
74+
75+
```sh
76+
go run -v ./cmd/vcr-compressor internal/services/rdb/testdata/acl-basic.cassette
77+
```

cmd/vcr-compressor/main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ func main() {
9292
if _, ok := transientStates[status]; ok {
9393
if transitioning {
9494
log.Printf("Interaction %d is in a transient state while we are already in transitient state. No need to record it: %s\n", i, status)
95-
96-
continue
9795
} else {
9896
log.Printf("Interaction %d is in a transient state: %s, Recording it\n", i, status)
9997

0 commit comments

Comments
 (0)