Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump operator prev version in upgrade e2e test to 1.3.2. #4123

Merged
merged 6 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/e2e-tests-ondemand.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ jobs:
- name: Notify failure in Slack
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
payload: |
message: ":x: E2E ondemand tests failed on ${{ env.branch }} branch (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})",
run_id: "${{ github.run_id }}"
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: webhook-trigger
payload-templated: true
payload: |
"message": ":red_circle: E2E ondemand tests failed on ${{ env.branch }} branch (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
"run_id": "${{ github.run_id }}"
4 changes: 2 additions & 2 deletions test/features/cloudnative/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package upgrade
import (
"testing"

dynakubev1beta1 "github.com/Dynatrace/dynatrace-operator/pkg/api/v1beta1/dynakube" //nolint:staticcheck
dynakubev1beta2 "github.com/Dynatrace/dynatrace-operator/pkg/api/v1beta2/dynakube" //nolint:staticcheck
"github.com/Dynatrace/dynatrace-operator/test/features/cloudnative"
"github.com/Dynatrace/dynatrace-operator/test/helpers"
"github.com/Dynatrace/dynatrace-operator/test/helpers/components/dynakube"
Expand All @@ -31,7 +31,7 @@ func Feature(t *testing.T) features.Feature {
)
builder.Assess("create sample namespace", sampleApp.InstallNamespace())

previousVersionDynakube := &dynakubev1beta1.DynaKube{}
previousVersionDynakube := &dynakubev1beta2.DynaKube{}
previousVersionDynakube.ConvertFrom(&testDynakube)
dynakube.InstallPreviousVersion(builder, helpers.LevelAssess, &secretConfig, *previousVersionDynakube)

Expand Down
8 changes: 4 additions & 4 deletions test/helpers/components/dynakube/dynakube.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"

"github.com/Dynatrace/dynatrace-operator/pkg/api/status"
prevDynakube "github.com/Dynatrace/dynatrace-operator/pkg/api/v1beta1/dynakube" //nolint:staticcheck
prevDynakube "github.com/Dynatrace/dynatrace-operator/pkg/api/v1beta2/dynakube" //nolint:staticcheck
"github.com/Dynatrace/dynatrace-operator/pkg/api/v1beta3/dynakube"
"github.com/Dynatrace/dynatrace-operator/test/helpers/components/oneagent"
"github.com/Dynatrace/dynatrace-operator/test/helpers/tenant"
Expand Down Expand Up @@ -63,7 +63,7 @@ func CreatePreviousVersion(builder *features.FeatureBuilder, level features.Leve

func VerifyStartupPreviousVersion(builder *features.FeatureBuilder, level features.Level, prevDk prevDynakube.DynaKube) {
if prevDk.NeedsOneAgent() {
builder.WithStep("oneagent started", level, oneagent.WaitFromDaemonSetPrevDk(prevDk))
builder.WithStep("oneagent started", level, oneagent.WaitForDaemonset(prevDk.OneAgentDaemonsetName(), prevDk.Namespace))
}
builder.WithStep(
fmt.Sprintf("'%s' dynakube phase changes to 'Running'", prevDk.Name),
Expand All @@ -74,7 +74,7 @@ func VerifyStartupPreviousVersion(builder *features.FeatureBuilder, level featur
func Delete(builder *features.FeatureBuilder, level features.Level, dk dynakube.DynaKube) {
builder.WithStep("dynakube deleted", level, remove(dk))
if dk.NeedsOneAgent() {
builder.WithStep("oneagent pods stopped", level, oneagent.WaitForDaemonSetPodsDeletion(dk))
builder.WithStep("oneagent pods stopped", level, oneagent.WaitForDaemonSetPodsDeletion(dk.OneAgentDaemonsetName(), dk.Namespace))
}
if dk.ClassicFullStackMode() {
oneagent.RunClassicUninstall(builder, level, dk)
Expand All @@ -83,7 +83,7 @@ func Delete(builder *features.FeatureBuilder, level features.Level, dk dynakube.

func VerifyStartup(builder *features.FeatureBuilder, level features.Level, dk dynakube.DynaKube) {
if dk.NeedsOneAgent() {
builder.WithStep("oneagent started", level, oneagent.WaitForDaemonset(dk))
builder.WithStep("oneagent started", level, oneagent.WaitForDaemonset(dk.OneAgentDaemonsetName(), dk.Namespace))
}
builder.WithStep(
fmt.Sprintf("'%s' dynakube phase changes to 'Running'", dk.Name),
Expand Down
13 changes: 4 additions & 9 deletions test/helpers/components/oneagent/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package oneagent
import (
"context"

dynakubev1beta1 "github.com/Dynatrace/dynatrace-operator/pkg/api/v1beta1/dynakube" //nolint
dynakubev1beta3 "github.com/Dynatrace/dynatrace-operator/pkg/api/v1beta3/dynakube"
"github.com/Dynatrace/dynatrace-operator/test/helpers"
"github.com/Dynatrace/dynatrace-operator/test/helpers/kubeobjects/daemonset"
Expand All @@ -16,16 +15,12 @@ import (
"sigs.k8s.io/e2e-framework/pkg/features"
)

func WaitForDaemonset(dk dynakubev1beta3.DynaKube) features.Func {
return helpers.ToFeatureFunc(daemonset.WaitFor(dk.OneAgentDaemonsetName(), dk.Namespace), true)
func WaitForDaemonset(dsName, namespace string) features.Func {
return helpers.ToFeatureFunc(daemonset.WaitFor(dsName, namespace), true)
}

func WaitFromDaemonSetPrevDk(prevDk dynakubev1beta1.DynaKube) features.Func {
return helpers.ToFeatureFunc(daemonset.WaitFor(prevDk.OneAgentDaemonsetName(), prevDk.Namespace), true)
}

func WaitForDaemonSetPodsDeletion(dk dynakubev1beta3.DynaKube) features.Func {
return pod.WaitForPodsDeletionWithOwner(dk.OneAgentDaemonsetName(), dk.Namespace)
func WaitForDaemonSetPodsDeletion(dsName, namespace string) features.Func {
return pod.WaitForPodsDeletionWithOwner(dsName, namespace)
}

func Get(ctx context.Context, resource *resources.Resources, dk dynakubev1beta3.DynaKube) (appsv1.DaemonSet, error) {
Expand Down
2 changes: 1 addition & 1 deletion test/scenarios/release/release_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var (
cfg *envconf.Config
)

const releaseTag = "1.2.2"
const releaseTag = "1.3.2"

func TestMain(m *testing.M) {
cfg = environment.GetStandardKubeClusterEnvConfig()
Expand Down
Loading