Skip to content

Commit

Permalink
PBM-1448. Fix tests, use perconalab to have the latest PSMDB images, …
Browse files Browse the repository at this point in the history
…update default to 6.0 (#1050)
  • Loading branch information
sandraromanchenko authored Nov 18, 2024
1 parent 319eeac commit e7ce3dd
Show file tree
Hide file tree
Showing 19 changed files with 107 additions and 95 deletions.
8 changes: 4 additions & 4 deletions e2e-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
## Run tests
Run all tests
```
$ MONGODB_VERSION=5.0 ./run-all
$ MONGODB_VERSION=6.0 ./run-all
```
`MONGODB_VERSION` is a PSMDB version (e.g. 5.0/6.0/7.0). Default is `5.0`
`MONGODB_VERSION` is a PSMDB version (e.g. 6.0/7.0/8.0). Default is `6.0`

`./run-all` would run all tests both on a sharded cluster and a non-sharded replica set.

Expand All @@ -20,9 +20,9 @@ $ MONGODB_VERSION=5.0 ./run-all
## Start test cluster
To start tests with a running pbm-agent and minio storage:
```
$ MONGODB_VERSION=5.0 ./start-cluster
$ MONGODB_VERSION=6.0 ./start-cluster
```
`MONGODB_VERSION` is a PSMDB version (e.g. 5.0/6.0/7.0). Default is `5.0`
`MONGODB_VERSION` is a PSMDB version (e.g. 6.0/7.0/8.0). Default is `6.0`

`./start-replset` - to start a non-sharded replica set.

Expand Down
8 changes: 5 additions & 3 deletions e2e-tests/cmd/pbm-test/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ func run(t *sharded.Cluster, typ testTyp) {
runTest("Check the Cannot Run Delete During Backup",
t.CannotRunDeleteDuringBackup)

runTest("Check Backup Cancellation",
func() { t.BackupCancellation(storage) })

// Skip test for sharded envs until PBM-1446 is fixed
if typ != testsSharded {
runTest("Check Backup Cancellation",
func() { t.BackupCancellation(storage) })
}
runTest("Leader lag during backup start",
t.LeaderLag)

Expand Down
9 changes: 7 additions & 2 deletions e2e-tests/cmd/pbm-test/run_physical.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"context"
"math/rand"

"golang.org/x/mod/semver"

"github.com/percona/percona-backup-mongodb/e2e-tests/pkg/tests/sharded"
"github.com/percona/percona-backup-mongodb/pbm/defs"
)
Expand Down Expand Up @@ -58,8 +60,11 @@ func runPhysical(t *sharded.Cluster, typ testTyp) {
t.DistributedTrxPhysical)
}

runTest("Clock Skew Tests",
func() { t.ClockSkew(defs.PhysicalBackup, cVersion) })
// Skip test for 8.0 until PBM-1447 is fixed
if semver.Compare(cVersion, "v8.0") < 0 {
runTest("Clock Skew Tests",
func() { t.ClockSkew(defs.PhysicalBackup, cVersion) })
}

flushStore(t)
}
16 changes: 8 additions & 8 deletions e2e-tests/docker/docker-compose-remapping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ services:
dockerfile: ./e2e-tests/docker/mongodb.dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-5.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
- MONGODB_VERSION=${MONGODB_VERSION:-6.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-perconalab/percona-server-mongodb}
hostname: rs101
labels:
- "com.percona.pbm.app=mongod"
Expand Down Expand Up @@ -54,8 +54,8 @@ services:
dockerfile: ./e2e-tests/docker/pbm.dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-5.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
- MONGODB_VERSION=${MONGODB_VERSION:-6.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-perconalab/percona-server-mongodb}
volumes:
- ./conf:/etc/pbm
- ./backups:/opt/backups
Expand All @@ -69,8 +69,8 @@ services:
dockerfile: ./e2e-tests/docker/mongodb.dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-5.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
- MONGODB_VERSION=${MONGODB_VERSION:-6.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-perconalab/percona-server-mongodb}
hostname: rs201
labels:
- "com.percona.pbm.app=mongod"
Expand Down Expand Up @@ -99,8 +99,8 @@ services:
dockerfile: ./e2e-tests/docker/pbm.dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-5.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
- MONGODB_VERSION=${MONGODB_VERSION:-6.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-perconalab/percona-server-mongodb}
volumes:
- ./conf:/etc/pbm
- ./backups:/opt/backups
Expand Down
30 changes: 15 additions & 15 deletions e2e-tests/docker/docker-compose-rs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ services:
dockerfile: ./e2e-tests/docker/pbm.dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-5.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
- MONGODB_VERSION=${MONGODB_VERSION:-6.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-perconalab/percona-server-mongodb}
volumes:
- ./conf:/etc/pbm
- ./backups:/opt/backups
Expand All @@ -41,8 +41,8 @@ services:
dockerfile: ./e2e-tests/docker/mongodb.dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-5.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
- MONGODB_VERSION=${MONGODB_VERSION:-6.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-perconalab/percona-server-mongodb}
hostname: rs101
labels:
- "com.percona.pbm.app=mongod"
Expand All @@ -51,7 +51,7 @@ services:
- MONGO_USER=dba
- BACKUP_USER=bcp
- MONGO_PASS=test1234
- MONGODB_VERSION=${MONGODB_VERSION:-5.0}
- MONGODB_VERSION=${MONGODB_VERSION:-6.0}
command: mongod --replSet rs1 --directoryperdb --port 27017 --dbpath=/data/db/ --storageEngine wiredTiger --keyFile /opt/keyFile --wiredTigerCacheSizeGB 1
volumes:
- data-rs101:/data/db
Expand All @@ -61,8 +61,8 @@ services:
dockerfile: ./e2e-tests/docker/mongodb.dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-5.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
- MONGODB_VERSION=${MONGODB_VERSION:-6.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-perconalab/percona-server-mongodb}
hostname: rs102
labels:
- "com.percona.pbm.app=mongod"
Expand All @@ -74,8 +74,8 @@ services:
dockerfile: ./e2e-tests/docker/mongodb.dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-5.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
- MONGODB_VERSION=${MONGODB_VERSION:-6.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-perconalab/percona-server-mongodb}
hostname: rs103
labels:
- "com.percona.pbm.app=mongod"
Expand All @@ -98,8 +98,8 @@ services:
dockerfile: ./e2e-tests/docker/pbm.dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-5.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
- MONGODB_VERSION=${MONGODB_VERSION:-6.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-perconalab/percona-server-mongodb}
volumes:
- ./conf:/etc/pbm
- ./backups:/opt/backups
Expand All @@ -123,8 +123,8 @@ services:
dockerfile: ./e2e-tests/docker/pbm.dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-5.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
- MONGODB_VERSION=${MONGODB_VERSION:-6.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-perconalab/percona-server-mongodb}
command: pbm-agent
cap_add:
- NET_ADMIN
Expand All @@ -147,8 +147,8 @@ services:
dockerfile: ./e2e-tests/docker/pbm.dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-5.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
- MONGODB_VERSION=${MONGODB_VERSION:-6.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-perconalab/percona-server-mongodb}
command: pbm-agent
cap_add:
- NET_ADMIN
Expand Down
10 changes: 5 additions & 5 deletions e2e-tests/docker/docker-compose-single.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ services:
dockerfile: ./e2e-tests/docker/mongodb.dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-5.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
- MONGODB_VERSION=${MONGODB_VERSION:-6.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-perconalab/percona-server-mongodb}
hostname: rs101
labels:
- "com.percona.pbm.app=mongod"
Expand All @@ -35,7 +35,7 @@ services:
- BACKUP_USER=bcp
- MONGO_PASS=test1234
- SINGLE_NODE=true
- MONGODB_VERSION=${MONGODB_VERSION:-5.0}
- MONGODB_VERSION=${MONGODB_VERSION:-6.0}
command: mongod --replSet rs1 --port 27017 --storageEngine wiredTiger --keyFile /opt/keyFile --wiredTigerCacheSizeGB 1
volumes:
- data-rs101:/data/db
Expand All @@ -55,8 +55,8 @@ services:
dockerfile: ./e2e-tests/docker/pbm.dockerfile
context: ../..
args:
- MONGODB_VERSION=${MONGODB_VERSION:-5.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-percona/percona-server-mongodb}
- MONGODB_VERSION=${MONGODB_VERSION:-6.0}
- MONGODB_IMAGE=${MONGODB_IMAGE:-perconalab/percona-server-mongodb}
volumes:
- ./conf:/etc/pbm
- ./backups:/opt/backups
Expand Down
Loading

0 comments on commit e7ce3dd

Please sign in to comment.