diff --git a/.codegen/service.go.tmpl b/.codegen/service.go.tmpl index ef7977e1b..ee2c7b0fd 100644 --- a/.codegen/service.go.tmpl +++ b/.codegen/service.go.tmpl @@ -411,5 +411,5 @@ func new{{.PascalName}}() *cobra.Command { {{- define "request-body-obj" -}} {{- $method := .Method -}} {{- $field := .Field -}} - {{$method.CamelName}}Req{{ if (and $method.RequestBodyField (not $field.IsPath)) }}.{{$method.RequestBodyField.PascalName}}{{end}}.{{$field.PascalName}} + {{$method.CamelName}}Req{{ if (and $method.RequestBodyField (and (not $field.IsPath) (not $field.IsQuery))) }}.{{$method.RequestBodyField.PascalName}}{{end}}.{{$field.PascalName}} {{- end -}} diff --git a/Makefile b/Makefile index e339d33dc..f8e7834a5 100644 --- a/Makefile +++ b/Makefile @@ -29,12 +29,17 @@ snapshot: vendor: @echo "✓ Filling vendor folder with library code ..." @go mod vendor - -integration: - gotestsum --format github-actions --rerun-fails --jsonfile output.json --packages "./integration/..." -- -parallel 4 -timeout=2h - + schema: @echo "✓ Generating json-schema ..." @go run ./bundle/internal/schema ./bundle/internal/schema ./bundle/schema/jsonschema.json -.PHONY: lint lintcheck test testonly coverage build snapshot vendor integration schema +INTEGRATION = gotestsum --format github-actions --rerun-fails --jsonfile output.json --packages "./integration/..." -- -parallel 4 -timeout=2h + +integration: + $(INTEGRATION) + +integration-short: + $(INTEGRATION) -short + +.PHONY: lint lintcheck test testonly coverage build snapshot vendor schema integration integration-short diff --git a/integration/bundle/clusters_test.go b/integration/bundle/clusters_test.go index f9e5c9b64..449206208 100644 --- a/integration/bundle/clusters_test.go +++ b/integration/bundle/clusters_test.go @@ -12,12 +12,12 @@ import ( ) func TestDeployBundleWithCluster(t *testing.T) { - ctx, wt := acc.WorkspaceTest(t) - - if testutil.IsAWSCloud(wt) { + if testutil.GetCloud(t) == testutil.AWS { t.Skip("Skipping test for AWS cloud because it is not permitted to create clusters") } + ctx, wt := acc.WorkspaceTest(t) + nodeTypeId := testutil.GetCloud(t).NodeTypeID() uniqueId := uuid.New().String() root := initTestTemplate(t, ctx, "clusters", map[string]any{ @@ -44,6 +44,11 @@ func TestDeployBundleWithCluster(t *testing.T) { require.NoError(t, err) require.NotNil(t, cluster) + if testing.Short() { + t.Log("Skip the job run in short mode") + return + } + out, err := runResource(t, ctx, root, "foo") require.NoError(t, err) require.Contains(t, out, "Hello World!") diff --git a/integration/bundle/python_wheel_test.go b/integration/bundle/python_wheel_test.go index 5cca1cb53..62846f7b5 100644 --- a/integration/bundle/python_wheel_test.go +++ b/integration/bundle/python_wheel_test.go @@ -29,6 +29,11 @@ func runPythonWheelTest(t *testing.T, templateName, sparkVersion string, pythonW destroyBundle(t, ctx, bundleRoot) }) + if testing.Short() { + t.Log("Skip the job run in short mode") + return + } + out, err := runResource(t, ctx, bundleRoot, "some_other_job") require.NoError(t, err) require.Contains(t, out, "Hello from my func") @@ -51,9 +56,7 @@ func TestPythonWheelTaskDeployAndRunWithWrapper(t *testing.T) { } func TestPythonWheelTaskDeployAndRunOnInteractiveCluster(t *testing.T) { - _, wt := acc.WorkspaceTest(t) - - if testutil.IsAWSCloud(wt) { + if testutil.GetCloud(t) == testutil.AWS { t.Skip("Skipping test for AWS cloud because it is not permitted to create clusters") } diff --git a/integration/bundle/spark_jar_test.go b/integration/bundle/spark_jar_test.go index 65893052e..cbdf5a00c 100644 --- a/integration/bundle/spark_jar_test.go +++ b/integration/bundle/spark_jar_test.go @@ -30,6 +30,11 @@ func runSparkJarTestCommon(t *testing.T, ctx context.Context, sparkVersion, arti destroyBundle(t, ctx, bundleRoot) }) + if testing.Short() { + t.Log("Skip the job run in short mode") + return + } + out, err := runResource(t, ctx, bundleRoot, "jar_job") require.NoError(t, err) require.Contains(t, out, "Hello from Jar!") diff --git a/internal/testutil/cloud.go b/internal/testutil/cloud.go index 4a8a89645..33921db0c 100644 --- a/internal/testutil/cloud.go +++ b/internal/testutil/cloud.go @@ -58,7 +58,3 @@ func GetCloud(t TestingT) Cloud { } return -1 } - -func IsAWSCloud(t TestingT) bool { - return GetCloud(t) == AWS -}