Skip to content

Commit

Permalink
Fix testgrid test name (#2450)
Browse files Browse the repository at this point in the history
* fix

* fix

* fix

* fix
  • Loading branch information
lluunn authored and k8s-ci-robot committed Feb 12, 2019
1 parent c1165e5 commit 8016cb8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
9 changes: 6 additions & 3 deletions testing/test_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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)
Expand Down Expand Up @@ -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(
Expand Down
8 changes: 5 additions & 3 deletions testing/test_deploy_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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)
Expand Down Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions testing/workflows/components/kfctl_test.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ local componentTests = util.kfTests {
testDir: testDir,
kubeConfig: kubeConfig,
image: image,
workflow_name: name,
buildTemplate+: {
argoTemplate+: {
container+: {
Expand Down
8 changes: 8 additions & 0 deletions testing/workflows/components/workflows.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -239,6 +240,7 @@
"--test_dir=" + tests.testDir,
"--artifacts_dir=" + tests.artifactsDir,
"--deploy_name=test-argo-deploy",
"--workflow_name=" + tests.workflow_name,
"deploy_argo",
],
},
Expand All @@ -258,6 +260,7 @@
"--test_dir=" + tests.testDir,
"--artifacts_dir=" + tests.artifactsDir,
"--deploy_name=test-katib",
"--workflow_name=" + tests.workflow_name,
"test_katib",
],
},
Expand All @@ -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",
],
Expand Down Expand Up @@ -652,6 +656,7 @@
"--namespace=" + stepsNamespace,
"--test_dir=" + testDir,
"--artifacts_dir=" + artifactsDir,
"--workflow_name=" + name,
"deploy_minikube",
"--vm_name=" + vmName,
"--zone=" + zone,
Expand All @@ -664,6 +669,7 @@
"--namespace=" + stepsNamespace,
"--test_dir=" + testDir,
"--artifacts_dir=" + artifactsDir,
"--workflow_name=" + name,
"teardown_minikube",
"--vm_name=" + vmName,
"--zone=" + zone,
Expand Down Expand Up @@ -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
Expand All @@ -747,6 +754,7 @@
"--test_dir=" + testDir,
"--artifacts_dir=" + artifactsDir,
"--deploy_name=test-argo-deploy",
"--workflow_name=" + name,
"deploy_argo",
]), // test-argo-deploy
], // templates
Expand Down

0 comments on commit 8016cb8

Please sign in to comment.