Files
kubevela/test/e2e-addon-test/suite_test.go
Chaitanyareddy0702 af1ce628d1 Chore: Add workflow addon testing (#6911)
* Chore: Add workflow addon testing

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat(tests): Update addon tests to use correct command and deployment name

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>

* Feat(tests): Enhance addon tests with debugging information for deployment not found

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>

* Feat(tests): Add debugging output for listing WorkflowRuns in addon tests

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>

* Feat(tests): Improve debugging output for WorkflowRuns in addon tests

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>

* Feat(tests): Update addon test command path for enabling Workflow

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>

* Refactor: Clean up unused imports and commented-out code in addon tests

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat(tests): Add debugging steps for addon registry in e2e tests

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Feat: Update vela-workflow version to v0.6.2 in mock server and tests

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Refactor: Remove debug commands from e2e tests and clean up addon test assertions

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Fix: run make reviewable

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Fix: Update assertions in addon tests to check for successful WorkflowRun phase

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

---------

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Co-authored-by: Vishal Kumar <vishal210893@gmail.com>
2025-09-24 09:25:38 -07:00

77 lines
2.3 KiB
Go

/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package controllers_test
import (
"math/rand"
"testing"
"time"
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
terraformv1beta1 "github.com/oam-dev/terraform-controller/api/v1beta1"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
crdv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/config"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
core "github.com/oam-dev/kubevela/apis/core.oam.dev"
// +kubebuilder:scaffold:imports
)
var k8sClient client.Client
var scheme = runtime.NewScheme()
func TestAPIs(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Addons Controller Suite")
}
var _ = BeforeSuite(func() {
By("Bootstrapping test environment")
rand.Seed(time.Now().UnixNano())
logf.SetLogger(zap.New(zap.UseDevMode(true), zap.WriteTo(GinkgoWriter)))
err := clientgoscheme.AddToScheme(scheme)
Expect(err).Should(BeNil())
err = core.AddToScheme(scheme)
Expect(err).Should(BeNil())
err = crdv1.AddToScheme(scheme)
Expect(err).Should(BeNil())
err = terraformv1beta1.AddToScheme(scheme)
Expect(err).Should(BeNil())
err = workflowv1alpha1.AddToScheme(scheme)
Expect(err).Should(BeNil())
By("Setting up kubernetes client")
k8sClient, err = client.New(config.GetConfigOrDie(), client.Options{Scheme: scheme})
if err != nil {
logf.Log.Error(err, "failed to create k8sClient")
Fail("setup failed")
}
By("Finished setting up test environment")
})
var _ = AfterSuite(func() {
By("Tearing down test environment")
// TearDownSuite()
By("Finished tearing down test environment")
})