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

feat: run e2e test in parallel #667

Merged
merged 6 commits into from
Nov 4, 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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ inference-api-e2e:
# Ginkgo configurations
GINKGO_FOCUS ?=
GINKGO_SKIP ?=
GINKGO_NODES ?= 1
GINKGO_NODES ?= 2
GINKGO_NO_COLOR ?= false
GINKGO_TIMEOUT ?= 180m
GINKGO_ARGS ?= -focus="$(GINKGO_FOCUS)" -skip="$(GINKGO_SKIP)" -nodes=$(GINKGO_NODES) -no-color=$(GINKGO_NO_COLOR) -timeout=$(GINKGO_TIMEOUT)
Expand Down
8 changes: 4 additions & 4 deletions pkg/controllers/workspace_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ func (c *WorkspaceReconciler) Reconcile(ctx context.Context, req reconcile.Reque

klog.InfoS("Reconciling", "workspace", req.NamespacedName)

if err := c.syncControllerRevision(ctx, workspaceObj); err != nil {
return reconcile.Result{}, err
}

if err := c.ensureFinalizer(ctx, workspaceObj); err != nil {
return reconcile.Result{}, err
}
Expand All @@ -99,6 +95,10 @@ func (c *WorkspaceReconciler) Reconcile(ctx context.Context, req reconcile.Reque
return c.deleteWorkspace(ctx, workspaceObj)
}

if err := c.syncControllerRevision(ctx, workspaceObj); err != nil {
return reconcile.Result{}, err
}

if workspaceObj.Inference != nil && workspaceObj.Inference.Preset != nil {
if !plugin.KaitoModelRegister.Has(string(workspaceObj.Inference.Preset.Name)) {
return reconcile.Result{}, fmt.Errorf("the preset model name %s is not registered for workspace %s/%s",
Expand Down
14 changes: 8 additions & 6 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ var (
nodeProvisionerName = os.Getenv("TEST_SUITE")
)

var _ = SynchronizedBeforeSuite(func() []byte {
var _ = BeforeSuite(func() {
utils.GetClusterClient(utils.TestingCluster)

namespaceName = fmt.Sprintf("%s-%d", namespaceName, GinkgoParallelProcess())
GinkgoWriter.Printf("Namespace %q for e2e tests\n", namespaceName)

kaitoNamespace := os.Getenv("KAITO_NAMESPACE")

if nodeProvisionerName == "azkarpenter" {
Expand Down Expand Up @@ -89,11 +93,9 @@ var _ = SynchronizedBeforeSuite(func() []byte {
},
})
Expect(err).NotTo(HaveOccurred())
})

return nil
}, func(data []byte) {})

var _ = SynchronizedAfterSuite(func() {
var _ = AfterSuite(func() {
// delete testing namespace
Eventually(func() error {
return utils.TestingCluster.KubeClient.Delete(ctx, &corev1.Namespace{
Expand All @@ -103,7 +105,7 @@ var _ = SynchronizedAfterSuite(func() {
}, &client.DeleteOptions{})
}, utils.PollTimeout, utils.PollInterval).Should(Succeed(), "Failed to delete namespace for e2e")

}, func() {})
})

func RunE2ETests(t *testing.T) {
RegisterFailHandler(Fail)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/preset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func createCustomWorkspaceWithAdapter(numOfNode int, validAdapters []kaitov1alph
uniqueID := fmt.Sprint("preset-", rand.Intn(1000))
workspaceObj = utils.GenerateInferenceWorkspaceManifest(uniqueID, namespaceName, "", numOfNode, "Standard_NC12s_v3",
&metav1.LabelSelector{
MatchLabels: map[string]string{"kaito-workspace": "public-preset-e2e-test-falcon"},
MatchLabels: map[string]string{"kaito-workspace": "custom-preset-e2e-test-falcon"},
}, nil, PresetFalcon7BModel, kaitov1alpha1.ModelImageAccessModePublic, nil, nil, validAdapters)

createAndValidateWorkspace(workspaceObj)
Expand Down
Loading