Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update jsonnet tests so that it tests all files under kubeflow #480

Merged
merged 5 commits into from Mar 22, 2018
Merged

Update jsonnet tests so that it tests all files under kubeflow #480

merged 5 commits into from Mar 22, 2018

Conversation

ankushagarwal
Copy link
Contributor

@ankushagarwal ankushagarwal commented Mar 21, 2018

  • This will catch any syntax errors in *sonnet files.
  • Skip all ksonnet prototypes since they need additional deps

/cc @lluunn


This change is Reviewable

* This will catch any syntax errors in *sonnet files.
* Skip all ksonnet prototypes since they need additional deps

/cc @lluunn
@ankushagarwal
Copy link
Contributor Author

/retest

# except ksonnet prototype definitions - they require additional
# dependencies
def should_test(f):
parts = f.split('.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.path.splitext

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -38,18 +38,32 @@
from kubeflow.testing import test_util
from kubeflow.testing import util

# We should test all files which end in .jsonnet or .libsonnet
# except ksonnet prototype definitions - they require additional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't the files in prototypes jsonnet, and otherwise libsonnet?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot test the prototypes directly since they are not valid jsonnet. For example: ksonnet injects the params and the env variable into the prototype when a component is generated from that prototype.

The idea is that we want to test everything(jsonnet and libsonnet file) under the kubeflow/ directory unless it is a ksonnet prototype.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, is the following true:
.jsonnet --> ksonnet prototype, cannot test
.libsonnet --> valid, can test

I manually checked, seems to be the case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. We shouldn't test any .jsonnet under .../prototypes/ since they are ksonnet prototypes.

# except ksonnet prototype definitions - they require additional
# dependencies
def should_test(f):
parts = os.path.splitext(f)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_, ext = os.path.splitext(f)
Then use ext as parts[1] below.

I mean, shouldn't we test only libsonnet? So should_test will be return ext == '.libsonnet'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to run some eval the .jsonnet files in the tests directory : https://github.com/kubeflow/kubeflow/tree/master/kubeflow/core/tests

@lluunn
Copy link
Contributor

lluunn commented Mar 22, 2018

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lluunn

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 94d3d29 into kubeflow:master Mar 22, 2018
@ankushagarwal ankushagarwal deleted the jsonnet-test-all branch March 22, 2018 23:26
yanniszark pushed a commit to arrikto/kubeflow that referenced this pull request Feb 15, 2021
* Init commit

* Add Katib Client

* Add GetConfigMap func
Move templates const

* Change folder for Katib client

* Delete old client

* Change name for default templates
elenzio9 pushed a commit to arrikto/kubeflow that referenced this pull request Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants