forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: refactor E2E examples tests and fix
Makefile
(argoproj#14094)
Signed-off-by: Mason Malone <[email protected]>
- Loading branch information
Showing
42 changed files
with
199 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
//go:build examples | ||
|
||
package e2e | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/suite" | ||
|
||
"github.com/argoproj/argo-workflows/v3/test/e2e/fixtures" | ||
fileutil "github.com/argoproj/argo-workflows/v3/util/file" | ||
"github.com/argoproj/argo-workflows/v3/workflow/common" | ||
) | ||
|
||
type ExamplesSuite struct { | ||
fixtures.E2ESuite | ||
} | ||
|
||
func (s *ExamplesSuite) BeforeTest(suiteName, testName string) { | ||
s.E2ESuite.BeforeTest(suiteName, testName) | ||
s.Given().KubectlApply("../../examples/configmaps/simple-parameters-configmap.yaml", fixtures.NoError) | ||
} | ||
|
||
func (s *ExamplesSuite) TestExampleWorkflows() { | ||
err := fileutil.WalkManifests("../../examples", func(path string, data []byte) error { | ||
wfs, err := common.SplitWorkflowYAMLFile(data, true) | ||
if err != nil { | ||
s.T().Fatalf("Error parsing %s: %v", path, err) | ||
} | ||
for _, wf := range wfs { | ||
if _, ok := wf.GetLabels()["workflows.argoproj.io/test"]; ok { | ||
s.T().Logf("Found example workflow at %s with test label\n", path) | ||
s.Given(). | ||
ExampleWorkflow(&wf). | ||
When(). | ||
SubmitWorkflow(). | ||
WaitForWorkflow(fixtures.ToBeSucceeded) | ||
} | ||
} | ||
return nil | ||
}) | ||
s.CheckError(err) | ||
} | ||
|
||
func TestExamplesSuite(t *testing.T) { | ||
suite.Run(t, new(ExamplesSuite)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.