Skip to content

Commit

Permalink
fix windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitrii Tikhomirov authored and Dmitrii Tikhomirov committed Nov 3, 2024
1 parent 6ae0c59 commit 7655690
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/kn-plugin-workflow/pkg/specs/openapi_minifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"fmt"
"io"
"os"
"path"
"path/filepath"
"strings"

Expand Down Expand Up @@ -115,7 +116,7 @@ func (m *OpenApiMinifier) fetchSpecFromFunction(workflowFile string) error {
if len(parts) != 2 {
return fmt.Errorf("❌ ERROR: Invalid operation format: %s", function.Operation)
}
apiFileName := parts[0]
apiFileName := path.Base(parts[0])
operation := parts[1]

if _, ok := m.operations[apiFileName]; !ok {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,15 @@ func checkResult(t *testing.T, test minifyTest, minifiedFiles map[string]string)
func parseFunctions(t *testing.T, functions map[string]sets.Set[string], workflow *v1alpha08.Flow, test minifyTest) {
for _, function := range workflow.Functions {
if strings.HasPrefix(function.Operation, test.specsDir) {
trimmedPrefix := strings.TrimPrefix(function.Operation, test.specsDir+string(os.PathSeparator))
trimmedPrefix := strings.TrimPrefix(function.Operation, test.specsDir+"/")
if !strings.Contains(trimmedPrefix, "#") {
t.Fatalf("Invalid operation format in function: %s", function.Operation)
}
parts := strings.SplitN(trimmedPrefix, "#", 2)
if len(parts) != 2 {
t.Fatalf("Invalid operation format: %s", function.Operation)
}
apiFileName := parts[0]
apiFileName := path.Base(parts[0])
operation := parts[1]

if _, ok := functions[apiFileName]; !ok {
Expand Down

0 comments on commit 7655690

Please sign in to comment.