Skip to content

Commit 8d8dd5a

Browse files
authored
Merge pull request #375 from arangodb/bug-fix/fix-pdb-test
Give default image for test.
2 parents ad32e9b + 01214d3 commit 8d8dd5a

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

MAINTAINERS.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,42 @@
22

33
## Running tests
44

5-
To run the entire test set, run:
5+
To run the entire test set, first set the following environment variables:
6+
7+
- `DOCKERNAMESPACE` to your docker hub account
8+
- `VERBOSE` to `1` (default is empty)
9+
- `LONG` to `1` (default is empty, which skips lots of tests)
10+
- `ARANGODB` to the name of a community image you want to test,
11+
default is `arangodb/arangodb:latest`
12+
- `ENTERPRISEIMAGE` to the name of an enterprise image, you want to
13+
test, if not set, some tests are skipped
14+
- `ARANGO_LICENSE_KEY` to the enterpise license key
15+
- `KUBECONFIG` to the path to some k8s configuration with
16+
credentials, this indicates which cluster to use
617

718
```bash
8-
export DOCKERNAMESPACE=<your docker hub account>
919
make clean
1020
make build
1121
make run-tests
1222
```
1323

24+
To run only a single test, set `TESTOPTIONS` to something like
25+
`-test.run=TestRocksDBEncryptionSingle` where
26+
`TestRocksDBEncryptionSingle` is the name of the test.
27+
1428
## Preparing a release
1529

1630
To prepare for a release, do the following:
1731

1832
- Make sure all tests are OK.
33+
- To run a complete set of tests, do the following:
34+
35+
Then do
36+
37+
~~~
38+
make run-tests
39+
~~~
40+
1941
- Update the CHANGELOG manually, since the automatic CHANGELOG
2042
generation is switched off (did not work in many cases).
2143

tests/pdb_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/arangodb/kube-arangodb/pkg/util"
1212
"github.com/arangodb/kube-arangodb/pkg/util/retry"
1313
"github.com/dchest/uniuri"
14+
"github.com/stretchr/testify/assert"
1415
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1516
"k8s.io/client-go/kubernetes"
1617
)
@@ -80,6 +81,12 @@ func TestPDBCreate(t *testing.T) {
8081
depl.Spec.SetDefaults(depl.GetName()) // this must be last
8182
defer deferedCleanupDeployment(c, depl.GetName(), ns)
8283

84+
// This test failes to validate the spec if no image is set explicitly because this is required in production mode
85+
if depl.Spec.Image == nil {
86+
depl.Spec.Image = util.NewString("arangodb/arangodb:latest")
87+
}
88+
assert.NoError(t, depl.Spec.Validate())
89+
8390
// Create deployment
8491
_, err := c.DatabaseV1alpha().ArangoDeployments(ns).Create(depl)
8592
if err != nil {

0 commit comments

Comments
 (0)