Skip to content

Commit 4fb9fd9

Browse files
author
arpechenin
committed
- remove redundant regenerate code
Signed-off-by: arpechenin <[email protected]>
1 parent c88c791 commit 4fb9fd9

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

backend/test/compiler/argo_ginkgo_test.go

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,10 @@
1515
package compiler
1616

1717
import (
18-
"flag"
1918
"fmt"
20-
"github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
2119
matcher "github.com/kubeflow/pipelines/backend/test/compiler/matchers"
2220
"os"
2321
"path/filepath"
24-
"sigs.k8s.io/yaml"
2522
"strings"
2623

2724
"github.com/kubeflow/pipelines/backend/src/apiserver/config/proxy"
@@ -35,8 +32,6 @@ import (
3532
. "github.com/onsi/gomega"
3633
)
3734

38-
var regenerateAllSkipTests = flag.Bool("regenerate", false, "Regenerate all compiled workflow and skip tests")
39-
4035
var _ = BeforeEach(func() {
4136
logger.Log("Initializing proxy config...")
4237
proxy.InitializeConfigWithEmptyForTests()
@@ -73,19 +68,6 @@ var _ = Describe("Verify Spec Compilation to Workflow >", Label(POSITIVE, WORKFL
7368
compiledWorkflowFileName := fileNameWithoutExtension + ".yaml"
7469
compiledWorkflowFilePath := filepath.Join(argoYAMLDir, compiledWorkflowFileName)
7570

76-
if *regenerateAllSkipTests {
77-
pipelineSpecs, platformSpec := workflowutils.LoadPipelineSpecsFromIR(
78-
pipelineSpecFilePath,
79-
param.compilerOptions.CacheDisabled,
80-
nil,
81-
)
82-
regeneratedWf := workflowutils.GetCompiledArgoWorkflow(pipelineSpecs, platformSpec, &param.compilerOptions)
83-
err := RegenerateSpec(compiledWorkflowFilePath, *regeneratedWf)
84-
if err != nil {
85-
Fail(fmt.Sprintf("Critical error: %v", err))
86-
}
87-
continue
88-
}
8971
It(fmt.Sprintf("When I compile %s pipeline spec, then the compiled yaml should be %s", pipelineSpecFileName, compiledWorkflowFileName), func() {
9072
test_utils.CheckIfSkipping(pipelineSpecFileName)
9173

@@ -129,23 +111,3 @@ var _ = Describe("Verify Spec Compilation to Workflow >", Label(POSITIVE, WORKFL
129111
})
130112
}
131113
})
132-
133-
func RegenerateSpec(path string, wf v1alpha1.Workflow) error {
134-
wfYml, _ := yaml.Marshal(wf)
135-
wfYmlStr := string(wfYml)
136-
file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
137-
if err != nil {
138-
return err
139-
}
140-
var wfLines []string
141-
for _, line := range strings.Split(wfYmlStr, "\n") {
142-
if !strings.Contains(line, "- --cache_disabled") {
143-
wfLines = append(wfLines, line)
144-
}
145-
}
146-
_, err = file.WriteString(strings.Join(wfLines, "\n"))
147-
if err != nil {
148-
return err
149-
}
150-
return nil
151-
}

0 commit comments

Comments
 (0)