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

Improve ActionSet Progress RunningPhase unit test #1847

Merged
merged 3 commits into from
Jan 9, 2023

Conversation

pavannd1
Copy link
Contributor

@pavannd1 pavannd1 commented Jan 7, 2023

Change Overview

  • Adding a separate test
  • Blueprint phases used have sleep command to ensure we get the RunningPhase value at least once

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

  • fixes #issue-number

Test Plan

  • 💪 Manual
  • ⚡ Unit test
START: controller_test.go:68: ControllerSuite.SetUpSuite
W0106 17:33:36.345532   17143 gcp.go:120] WARNING: the gcp auth plugin is deprecated in v1.22+, unavailable in v1.25+; use gcloud instead.
To learn more, consult https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
PASS: controller_test.go:68: ControllerSuite.SetUpSuite	2.833s

START: controller_test.go:960: ControllerSuite.TestProgressRunningPhase
START: controller_test.go:126: ControllerSuite.SetUpTest
PASS: controller_test.go:126: ControllerSuite.SetUpTest	0.178s

{"File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).logAndSuccessEvent","Line":687,"level":"info","msg":"Added blueprint test-bp-running-phase-nxt8p","time":"2023-01-06T17:33:39.456117-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).onUpdateActionSet","Line":240,"Status":"pending","level":"info","msg":"Updated ActionSet","time":"2023-01-06T17:33:39.599369-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).onUpdateActionSet","Line":247,"Phase":"backupPhaseOne-\u003epending","Status":"running","level":"info","msg":"Updated ActionSet","time":"2023-01-06T17:33:39.674578-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).logAndSuccessEvent","Line":687,"level":"info","msg":"Executing action backup","time":"2023-01-06T17:33:39.72064-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).handleActionSet","Line":416,"NewActionSetName":"test-actionset-b298b","level":"info","msg":"Created actionset and started executing actions","time":"2023-01-06T17:33:40.066567-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).logAndSuccessEvent","Line":687,"Phase":"backupPhaseOne","level":"info","msg":"Executing phase backupPhaseOne","time":"2023-01-06T17:33:40.06665-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).onUpdateActionSet","Line":247,"Phase":"backupPhaseOne-\u003epending","Status":"running","level":"info","msg":"Updated ActionSet","time":"2023-01-06T17:33:40.230606-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).onUpdateActionSet","Line":247,"Phase":"backupPhaseOne-\u003epending","Status":"running","level":"info","msg":"Updated ActionSet","time":"2023-01-06T17:33:41.802171-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).onUpdateActionSet","Line":247,"Phase":"backupPhaseOne-\u003epending","Status":"running","level":"info","msg":"Updated ActionSet","time":"2023-01-06T17:33:43.791495-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).onUpdateActionSet","Line":247,"Phase":"backupPhaseOne-\u003epending","Status":"running","level":"info","msg":"Updated ActionSet","time":"2023-01-06T17:33:45.790681-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).onUpdateActionSet","Line":247,"Phase":"backupPhaseOne-\u003epending","Status":"running","level":"info","msg":"Updated ActionSet","time":"2023-01-06T17:33:47.782919-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).onUpdateActionSet","Line":247,"Phase":"backupPhaseOne-\u003epending","Status":"running","level":"info","msg":"Updated ActionSet","time":"2023-01-06T17:33:49.787333-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).onUpdateActionSet","Line":247,"Phase":"backupPhaseTwo-\u003epending","Status":"running","level":"info","msg":"Updated ActionSet","time":"2023-01-06T17:33:49.859978-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).logAndSuccessEvent","Line":687,"Phase":"backupPhaseOne","level":"info","msg":"Completed phase backupPhaseOne","time":"2023-01-06T17:33:49.860408-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).logAndSuccessEvent","Line":687,"Phase":"backupPhaseTwo","level":"info","msg":"Executing phase backupPhaseTwo","time":"2023-01-06T17:33:49.860456-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).onUpdateActionSet","Line":247,"Phase":"backupPhaseTwo-\u003epending","Status":"running","level":"info","msg":"Updated ActionSet","time":"2023-01-06T17:33:49.953327-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).onUpdateActionSet","Line":247,"Phase":"backupPhaseTwo-\u003epending","Status":"running","level":"info","msg":"Updated ActionSet","time":"2023-01-06T17:33:51.791472-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).onUpdateActionSet","Line":247,"Phase":"backupPhaseTwo-\u003epending","Status":"running","level":"info","msg":"Updated ActionSet","time":"2023-01-06T17:33:53.800753-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).onUpdateActionSet","Line":247,"Phase":"backupPhaseTwo-\u003epending","Status":"running","level":"info","msg":"Updated ActionSet","time":"2023-01-06T17:33:55.827616-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).onUpdateActionSet","Line":247,"Phase":"backupPhaseTwo-\u003epending","Status":"running","level":"info","msg":"Updated ActionSet","time":"2023-01-06T17:33:57.78712-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).logAndSuccessEvent","Line":687,"Phase":"backupPhaseTwo","level":"info","msg":"Completed phase backupPhaseTwo","time":"2023-01-06T17:33:58.518883-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).logAndSuccessEvent","Line":687,"Phase":"deferPhase","level":"info","msg":"Executing deferPhase deferPhase","time":"2023-01-06T17:33:58.593962-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).logAndSuccessEvent","Line":687,"Phase":"deferPhase","level":"info","msg":"Completed deferPhase deferPhase","time":"2023-01-06T17:34:08.181316-08:00"}
{"ActionSet":"test-actionset-b298b","File":"pkg/controller/controller.go","Function":"github.com/kanisterio/kanister/pkg/controller.(*Controller).logAndSuccessEvent","Line":687,"level":"info","msg":"Updated ActionSet 'test-actionset-b298b' Status-\u003ecomplete","time":"2023-01-06T17:34:08.261152-08:00"}
START: controller_test.go:138: ControllerSuite.TearDownTest
PASS: controller_test.go:138: ControllerSuite.TearDownTest	0.000s

PASS: controller_test.go:960: ControllerSuite.TestProgressRunningPhase	33.516s

START: controller_test.go:118: ControllerSuite.TearDownSuite
PASS: controller_test.go:118: ControllerSuite.TearDownSuite	0.062s

OK: 1 passed
--- PASS: Test (36.59s)
PASS
ok  	github.com/kanisterio/kanister/pkg/controller	37.166s
  • 💚 E2E

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2023

Thanks for submitting this pull request 🎉. The team will review it soon and get back to you.

If you haven't already, please take a moment to review our project contributing guideline and Code of Conduct document.

@infraq infraq added this to In Progress in Kanister Jan 7, 2023
Kanister automation moved this from In Progress to Reviewer approved Jan 9, 2023
@mergify mergify bot merged commit 1eac779 into master Jan 9, 2023
Kanister automation moved this from Reviewer approved to Done Jan 9, 2023
@mergify mergify bot deleted the fix-running-phase-test branch January 9, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants