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

[AWS SageMaker] Add more unit tests #3783

Merged
merged 7 commits into from
May 27, 2020

Conversation

akartsky
Copy link
Contributor

@akartsky akartsky commented May 19, 2020

Added more tests for following components :
Deploy (98% coverage)
Ground_truth (98% coverage)
Workteam (96% coverage)
Model (97% coverage)
Batch Transform (98% coverage)

#3782

====================================================================================== 94 passed, 3 warnings in 1.67s ======================================================================================
Name                                                      Stmts   Miss  Cover   Missing
---------------------------------------------------------------------------------------
/app/batch_transform/src/batch_transform.py                  51      1    98%   75
/app/common/_utils.py                                       567     31    95%   62, 73-83, 88-92, 693, 710, 714, 724, 727, 738-742, 804-805, 816-817, 821-824, 834, 870, 873-874
/app/deploy/src/deploy.py                                    45      1    98%   67
/app/ground_truth/src/ground_truth.py                        54      1    98%   76
/app/hyperparameter_tuning/src/hyperparameter_tuning.py      67      1    99%   93
/app/model/src/create_model.py                               32      1    97%   54
/app/train/src/train.py                                      52      1    98%   80
/app/workteam/src/workteam.py                                27      1    96%   49
---------------------------------------------------------------------------------------
TOTAL                                                       895     38    96%

These tests check : (for 1 inout)

  1. Argument parsing is proper
  2. main() function is proper
  3. emulate boto3 client and verify the output

These things can be done more extensively to verify every combination of input

@kubeflow-bot
Copy link

This change is Reviewable

Copy link
Contributor

@goswamig goswamig left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -56,7 +57,7 @@ def create_parser():

def main(argv=None):
parser = create_parser()
args = parser.parse_args()
args = parser.parse_args(argv)
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need this change with line 77 ?

Copy link
Contributor Author

@akartsky akartsky May 19, 2020

Choose a reason for hiding this comment

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

in main, parse_args() automatically takes argv input if we don't specify anything.
But when we mock the function it doesn’t.

So we have to explicitly specify the parameter for unit tests to run

@akartsky
Copy link
Contributor Author

/ok-to-test

@akartsky
Copy link
Contributor Author

/retest

@akartsky akartsky force-pushed the add_more_unit_tests branch 3 times, most recently from dfb76f2 to f3a9416 Compare May 21, 2020 17:07
@RedbackThomson
Copy link
Contributor

Could you please run these with the automated unit and integration test CodeBuild jobs to ensure they all still pass successfully? Otherwise I think I'm happy for this to be merged.

@akartsky
Copy link
Contributor Author

Could you please run these with the automated unit and integration test CodeBuild jobs to ensure they all still pass successfully? Otherwise I think I'm happy for this to be merged.

will do 👍🏻

@RedbackThomson
Copy link
Contributor

/approve
/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RedbackThomson

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

@akartsky
Copy link
Contributor Author

/retest

1 similar comment
@akartsky
Copy link
Contributor Author

/retest

@akartsky
Copy link
Contributor Author

/test tide

@k8s-ci-robot
Copy link
Contributor

@akartsky: The specified target(s) for /test were not found.
The following commands are available to trigger jobs:

  • /test kubeflow-pipeline-frontend-test
  • /test kubeflow-pipeline-backend-test
  • /test kubeflow-pipeline-e2e-test
  • /test kubeflow-pipeline-sample-test
  • /test kubeflow-pipeline-integration-test
  • /test kubeflow-pipeline-mkp-test
  • /test kubeflow-pipeline-upgrade-test

Use /test all to run the following jobs:

  • kubeflow-pipeline-frontend-test
  • kubeflow-pipeline-backend-test
  • kubeflow-pipeline-e2e-test
  • kubeflow-pipeline-sample-test
  • kubeflow-pipeline-upgrade-test

In response to this:

/test tide

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@akartsky
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit b503050 into kubeflow:master May 27, 2020
Jeffwan pushed a commit to Jeffwan/pipelines that referenced this pull request Dec 9, 2020
* add more tests for deploy and ground_truth components

* add more tests for workteam component

* add unit tests for model component

* add more unit tests for batchTransform component

* add more tests

* add 'request' function tests

* add more unit tests for ground truth
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.

5 participants