From 787164044dd00c95875ded4f4724baebaf7ba0b7 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Tue, 10 Nov 2015 16:59:52 -0800 Subject: [PATCH] Enable Open tests for Exec/Java --- client/driver/exec_test.go | 12 ------------ client/driver/java_test.go | 17 ++++++++--------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/client/driver/exec_test.go b/client/driver/exec_test.go index bc8323889..06c710745 100644 --- a/client/driver/exec_test.go +++ b/client/driver/exec_test.go @@ -33,11 +33,6 @@ func TestExecDriver_Fingerprint(t *testing.T) { } } -/* -TODO: This test is disabled til a follow-up api changes the restore state interface. -The driver/executor interface will be changed from Open to Cleanup, in which -clean-up tears down previous allocs. - func TestExecDriver_StartOpen_Wait(t *testing.T) { ctestutils.ExecCompatible(t) task := &structs.Task{ @@ -54,12 +49,6 @@ func TestExecDriver_StartOpen_Wait(t *testing.T) { defer ctx.AllocDir.Destroy() d := NewExecDriver(driverCtx) - if task.Resources == nil { - task.Resources = &structs.Resources{} - } - task.Resources.CPU = 0.5 - task.Resources.MemoryMB = 2 - handle, err := d.Start(ctx, task) if err != nil { t.Fatalf("err: %v", err) @@ -77,7 +66,6 @@ func TestExecDriver_StartOpen_Wait(t *testing.T) { t.Fatalf("missing handle") } } -*/ func TestExecDriver_Start_Wait(t *testing.T) { ctestutils.ExecCompatible(t) diff --git a/client/driver/java_test.go b/client/driver/java_test.go index 206cc1c78..0c3490d0e 100644 --- a/client/driver/java_test.go +++ b/client/driver/java_test.go @@ -41,18 +41,18 @@ func TestJavaDriver_Fingerprint(t *testing.T) { } } -/* -TODO: This test is disabled til a follow-up api changes the restore state interface. -The driver/executor interface will be changed from Open to Cleanup, in which -clean-up tears down previous allocs. func TestJavaDriver_StartOpen_Wait(t *testing.T) { - ctestutils.ExecCompatible(t) + if !javaLocated() { + t.Skip("Java not found; skipping") + } + + ctestutils.JavaCompatible(t) task := &structs.Task{ Name: "demo-app", Config: map[string]string{ - "jar_source": "https://dl.dropboxusercontent.com/u/47675/jar_thing/demoapp.jar", - // "jar_source": "https://s3-us-west-2.amazonaws.com/java-jar-thing/demoapp.jar", - // "args": "-d64", + "artifact_source": "https://dl.dropboxusercontent.com/u/47675/jar_thing/demoapp.jar", + "jvm_options": "-Xmx2048m -Xms256m", + "checksum": "sha256:58d6e8130308d32e197c5108edd4f56ddf1417408f743097c2e662df0f0b17c8", }, Resources: basicResources, } @@ -86,7 +86,6 @@ func TestJavaDriver_StartOpen_Wait(t *testing.T) { t.Fatalf("Error: %s", err) } } -*/ func TestJavaDriver_Start_Wait(t *testing.T) { if !javaLocated() {