diff --git a/testing/test_deploy.py b/testing/test_deploy.py index df15f00d5a1..74394de1167 100644 --- a/testing/test_deploy.py +++ b/testing/test_deploy.py @@ -307,7 +307,7 @@ def wrap_test(args): test_name = determine_test_name(args) test_case = test_util.TestCase() test_case.class_name = "KubeFlow" - test_case.name = "deploy-kubeflow-" + test_name + test_case.name = args.workflow_name + "-" + test_name try: def run(): @@ -319,9 +319,9 @@ def run(): # https://github.com/kubeflow/kubeflow/issues/631 # TestGrid currently uses the regex junit_(^_)*.xml so we only # want one underscore after junit. - junit_name = test_name.replace("_", "-") + junit_name = test_case.name.replace("_", "-") junit_path = os.path.join(args.artifacts_dir, - "junit_kubeflow-deploy-{0}.xml".format( + "junit_{0}.xml".format( junit_name)) logging.info("Writing test results to %s", junit_path) test_util.create_junit_xml_file([test_case], junit_path) @@ -622,6 +622,9 @@ def main(): # pylint: disable=too-many-locals,too-many-statements parser.add_argument( "--deploy_name", default="", type=str, help="The name of the deployment.") + parser.add_argument( + "--workflow_name", default="", type=str, help="The name of the workflow.") + subparsers = parser.add_subparsers() parser_teardown = subparsers.add_parser( diff --git a/testing/test_deploy_app.py b/testing/test_deploy_app.py index c1aa0d8ea6a..86525843d74 100644 --- a/testing/test_deploy_app.py +++ b/testing/test_deploy_app.py @@ -482,7 +482,7 @@ def wrap_test(args): test_name = "bootstrapper" test_case = test_util.TestCase() test_case.class_name = "KubeFlow" - test_case.name = test_name + test_case.name = args.workflow_name + "-" + test_name try: def run(): @@ -494,9 +494,9 @@ def run(): # https://github.com/kubeflow/kubeflow/issues/631 # TestGrid currently uses the regex junit_(^_)*.xml so we only # want one underscore after junit. - junit_name = test_name.replace("_", "-") + junit_name = test_case.name.replace("_", "-") junit_path = os.path.join(args.artifacts_dir, - "junit_kubeflow-deploy-{0}.xml".format( + "junit_{0}.xml".format( junit_name)) logging.info("Writing test results to %s", junit_path) test_util.create_junit_xml_file([test_case], junit_path) @@ -570,6 +570,8 @@ def main(unparsed_args=None): help="Directory to use for artifacts that should be preserved after " "the test runs. Defaults to test_dir if not set." ) + parser.add_argument( + "--workflow_name", default="deployapp", type=str, help="The name of the workflow.") args = parser.parse_args(args=unparsed_args) diff --git a/testing/workflows/components/kfctl_test.jsonnet b/testing/workflows/components/kfctl_test.jsonnet index a6db884778c..f49099003ef 100644 --- a/testing/workflows/components/kfctl_test.jsonnet +++ b/testing/workflows/components/kfctl_test.jsonnet @@ -151,6 +151,7 @@ local componentTests = util.kfTests { testDir: testDir, kubeConfig: kubeConfig, image: image, + workflow_name: name, buildTemplate+: { argoTemplate+: { container+: { diff --git a/testing/workflows/components/workflows.libsonnet b/testing/workflows/components/workflows.libsonnet index dde904cbeec..4f847f6dc64 100644 --- a/testing/workflows/components/workflows.libsonnet +++ b/testing/workflows/components/workflows.libsonnet @@ -59,6 +59,7 @@ // name and platform should be given unique values. name: "somename", platform: "gke", + workflow_name: "", // In order to refer to objects between the current and outer-most object, we use a variable to create a name for that level: local tests = self, @@ -239,6 +240,7 @@ "--test_dir=" + tests.testDir, "--artifacts_dir=" + tests.artifactsDir, "--deploy_name=test-argo-deploy", + "--workflow_name=" + tests.workflow_name, "deploy_argo", ], }, @@ -258,6 +260,7 @@ "--test_dir=" + tests.testDir, "--artifacts_dir=" + tests.artifactsDir, "--deploy_name=test-katib", + "--workflow_name=" + tests.workflow_name, "test_katib", ], }, @@ -276,6 +279,7 @@ "--test_dir=" + tests.testDir, "--artifacts_dir=" + tests.artifactsDir, "--deploy_name=pytorch-job", + "--workflow_name=" + tests.workflow_name, "deploy_pytorchjob", "--params=image=pytorch/pytorch:v0.2,num_workers=1", ], @@ -652,6 +656,7 @@ "--namespace=" + stepsNamespace, "--test_dir=" + testDir, "--artifacts_dir=" + artifactsDir, + "--workflow_name=" + name, "deploy_minikube", "--vm_name=" + vmName, "--zone=" + zone, @@ -664,6 +669,7 @@ "--namespace=" + stepsNamespace, "--test_dir=" + testDir, "--artifacts_dir=" + artifactsDir, + "--workflow_name=" + name, "teardown_minikube", "--vm_name=" + vmName, "--zone=" + zone, @@ -727,6 +733,7 @@ "--test_dir=" + testDir, "--artifacts_dir=" + artifactsDir, "--deploy_name=pytorch-job", + "--workflow_name=" + name, "deploy_pytorchjob", "--params=image=pytorch/pytorch:v0.2,num_workers=1", ]), // pytorchjob-deploy @@ -747,6 +754,7 @@ "--test_dir=" + testDir, "--artifacts_dir=" + artifactsDir, "--deploy_name=test-argo-deploy", + "--workflow_name=" + name, "deploy_argo", ]), // test-argo-deploy ], // templates