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

[Backend] Refactor integration tests, facilitate local testing #3138

Merged
merged 8 commits into from
Feb 21, 2020

Conversation

Bobgy
Copy link
Contributor

@Bobgy Bobgy commented Feb 21, 2020

Add README and script to help run backend integration tests locally.

Also moved cleanup steps to test setup stage, so that

  • each test doesn't depend on cluster initial state, e.g. if you halt your test in the middle, rerunning the test would fail because of the cluster being in an intermediate state. With this change, test will just pass.
  • dev can debug manually after a test fails

UPDATE: tests will clean up both before and after it runs, to unblock frontend-integration-test which depends on the cluster being empty, but clean up after test is disabled in dev mode


This change is Reviewable

@Bobgy
Copy link
Contributor Author

Bobgy commented Feb 21, 2020

/assign @IronPan
/assign @jingzhang36

@@ -207,12 +216,6 @@ func (s *JobApiTestSuite) TestJobApis() {
assert.Equal(t, 1, totalSize)
argParamsRun := runs[0]
s.checkArgParamsRun(t, argParamsRun, argParamsExperiment.ID, argParamsExperiment.Name, argParamsJob.ID, argParamsJob.Name)

Copy link
Contributor

Choose a reason for hiding this comment

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

My understanding is that you make sure all the pipelines/runs/experiments/... are cleaned up before the test begins in SetupTests() methods, and therefore you don't need to clean up those pipelines/runs/experiments/... after the test ends, which enables the dev to debug integration test errors after the test ends. Is that correct? If so, can we add comments here as why we don't clean up after test ends (since conventionally we do)?

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, that's correct.
Another benefit is, if you halt your test in the middle, rerunning the test won't fail because of cluster in an intermediate state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just realized, frontend-integration-test actually fails after this.
So I guess either we need to add cluster cleanup in frontend-integration-test, or we still need clean up after each integration test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated implementation to use a flag to turn off resource clean up when developing it.

}

func TestExperimentAPI(t *testing.T) {
suite.Run(t, new(ExperimentApiTest))
}

func (s *ExperimentApiTest) TearDownSuite() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this method used in manual process? Didn't see it called in the script.

Copy link
Contributor Author

@Bobgy Bobgy Feb 21, 2020

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. Thanks!
/lgtm
/approve

@jingzhang36
Copy link
Contributor

Other than a nit question regarding TearDownSuite(), /lgtm and /approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jingzhang36

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
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot removed the lgtm label Feb 21, 2020
@Bobgy Bobgy added the lgtm label Feb 21, 2020
@Bobgy
Copy link
Contributor Author

Bobgy commented Feb 21, 2020

@jingzhang36 thanks for the review!

@k8s-ci-robot k8s-ci-robot merged commit b90040a into kubeflow:master Feb 21, 2020
@Bobgy Bobgy deleted the test_refactor_integration branch February 21, 2020 07:59
Jeffwan pushed a commit to Jeffwan/pipelines that referenced this pull request Dec 9, 2020
…low#3138)

* Make local testing easier

* Move cleanup to test setup stage

* Add readme for how to run integration tests

* Add warning about data loss

* Add warning also in the script

* Change flag to isDevMode and cleanup resources if not in dev mode

* Pass through arguments in the bash script

* Fix unit tests
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.

4 participants