Skip to content

Commit

Permalink
fixup: enable tests for Go and Rust
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Vasek <[email protected]>
  • Loading branch information
matejvasek committed Aug 7, 2023
1 parent 08b2dbf commit 112decd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-e2e-runtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: E2E Test
strategy:
matrix:
runtime: ["node", "go", "python", "quarkus", "springboot", "typescript"]
runtime: ["node", "go", "python", "quarkus", "springboot", "typescript", "rust"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
12 changes: 0 additions & 12 deletions pkg/pipelines/tekton/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"

"knative.dev/func/pkg/builders"
"knative.dev/func/pkg/builders/buildpacks"
"knative.dev/func/pkg/builders/s2i"
fn "knative.dev/func/pkg/functions"
)
Expand All @@ -32,17 +31,6 @@ func validatePipeline(f fn.Function) (string, error) {
return "", ErrRuntimeRequired
}

if f.Runtime == "go" || f.Runtime == "rust" {
builder := f.Build.BuilderImages[builders.Pack]
defaultBuilder := buildpacks.DefaultBuilderImages[f.Runtime]
if builder != "" && builder != defaultBuilder {
warningMsg = fmt.Sprintf("runtime %q is not supported for on cluster build with default builders, "+
"continuing with the custom builder provided", f.Runtime)
} else {
return "", ErrRuntimeNotSupported{f.Runtime}
}
}

if len(f.Build.Buildpacks) > 0 {
return "", ErrBuilpacksNotSupported
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/pipelines/tekton/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ func Test_validatePipeline(t *testing.T) {
wantErr: true,
},
{
name: "Unsupported runtime - Go - pack builder - without additional Buildpacks",
name: "Supported runtime - Go - pack builder",
function: fn.Function{Build: fn.BuildSpec{Builder: builders.Pack}, Runtime: "go"},
wantErr: true,
wantErr: false,
},
{
name: "Unsupported runtime - Go - pack builder - with additional Buildpacks",
Expand All @@ -95,9 +95,9 @@ func Test_validatePipeline(t *testing.T) {
wantErr: false,
},
{
name: "Unsupported runtime - Rust - pack builder - without additional Buildpacks",
name: "Supported runtime - Rust - pack builder",
function: fn.Function{Build: fn.BuildSpec{Builder: builders.Pack}, Runtime: "rust"},
wantErr: true,
wantErr: false,
},
{
name: "Unsupported runtime - Rust - s2i builder",
Expand Down
1 change: 1 addition & 0 deletions test/e2e/scenario_runtime-http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
var runtimeSupportMap = map[string][]string{
"node": {"pack", "s2i"},
"go": {"pack"},
"rust": {"pack"},
"python": {"pack", "s2i"},
"quarkus": {"pack", "s2i"},
"springboot": {"pack"},
Expand Down
3 changes: 2 additions & 1 deletion test/oncluster/scenario_runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import (

var runtimeSupportMap = map[string][]string{
"node": {"pack", "s2i"},
"go": {},
"go": {"pack"},
"rust": {"pack"},
"python": {"pack", "s2i"},
"quarkus": {"pack", "s2i"},
"springboot": {"pack"},
Expand Down

0 comments on commit 112decd

Please sign in to comment.