Skip to content

Commit

Permalink
Prevent skipping some tests (#952)
Browse files Browse the repository at this point in the history
The reason why normal ci tests were oddly more stable than daily build
tests was because we were skipping a lot of them.
We rely on the vertica-version label in the image to skip some tests in
case the vertica version is lower than the min required version by the
test. The issue is that label is empty for `latest-test-master` which
leads to all the tests using that image to be skipped. We need to set
that label properly for that image too but in the meantime, we are
adding this work-around to not skip some tests.
  • Loading branch information
roypaulin authored Oct 9, 2024
1 parent f5b642a commit d3b72a1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
15 changes: 0 additions & 15 deletions api/v1/verticadb_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@ import (
"fmt"
"reflect"
"strings"
"time"

vutil "github.com/vertica/vcluster/vclusterops/util"
vmeta "github.com/vertica/vertica-kubernetes/pkg/meta"
"github.com/vertica/vertica-kubernetes/pkg/paths"
vversion "github.com/vertica/vertica-kubernetes/pkg/version"
v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/validation/field"
Expand Down Expand Up @@ -96,19 +94,6 @@ func (v *VerticaDB) Default() {
if v.Spec.TemporarySubclusterRouting != nil {
v.Spec.TemporarySubclusterRouting.Template.Type = SecondarySubcluster
}
// Set required status conditions fields if they are unset
for i := range v.Status.Conditions {
cond := &v.Status.Conditions[i]
if cond.LastTransitionTime.IsZero() {
cond.LastTransitionTime = metav1.NewTime(time.Now())
}
if cond.Reason == "" {
cond.Reason = DefaultReason
}
if cond.Message == "" {
cond.Message = DefaultMsg
}
}
v.setDefaultServiceName()
v.setDefaultSandboxImages()
}
Expand Down
8 changes: 8 additions & 0 deletions scripts/is-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ then
fi

logAndRunCommand docker pull $IMG
# Normally we would rely on the vertica-version label of the image but it is empty
# for the latest-test-master image. Until we figure out why, we are adding
# this work around to not skip some tests.
if [[ "$IMG" == "docker.io/opentext/vertica-k8s-private:latest-test-master" ]]
then
logInfo "$IMG is newer"
exit 1
fi
IMG_VER=$(determine_image_version $IMG)
logInfo "Image $IMG has version $IMG_VER"
logInfo "Checking if $IMG_VER is $COMPARE_TYPE than $COMPARE_VERSION"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ commands:
kubectl patch vdb v-restore-point --type='json' -p='[{
"op": "add",
"path": "/status/conditions/-",
"value": {"type": "SaveRestorePointNeeded", "status": "True"}
"value": {"type": "SaveRestorePointNeeded", "status": "True", "message": "test", "reason": "test", "lastTransitionTime": "2024-09-16T21:38:27Z"}
}]' --subresource='status'
namespaced: true
- command: kubectl wait --for=condition=SaveRestorePointNeeded=True vdb/v-restore-point --timeout=600s
Expand Down

0 comments on commit d3b72a1

Please sign in to comment.