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

Generation of Job name for tests fixed #2386

Merged

Conversation

k0taperk0t
Copy link
Contributor

@k0taperk0t k0taperk0t commented Oct 9, 2023

Change Overview

Instead of generating job name using format template + 5_random_symbols, we used this format only for first job, but for all next jobs format previous_name_of_job + 5_random_symbols has been used. As result sometime we could even to exceed limit in 64 symbols of K8s entity name.

Watch JobName field:

{"File":"pkg/log/log.go","Function":"github.com/kanisterio/kanister/pkg/log.Print","JobName":"kanister-test-job7t2t9","Line":165,"cluster_name":"85854027-f7b2-41e5-a820-92177102961c","hostname":"orbstack","level":"info","msg":"Deleted job","time":"2023-10-09T14:58:23.494576497Z"}
...
PASS: job_test.go:135: JobSuite.TestJobsBasic 10.399s
{"File":"pkg/log/log.go","Function":"github.com/kanisterio/kanister/pkg/log.Print","JobName":"kanister-test-job7t2t97fnq4","Line":165,"cluster_name":"85854027-f7b2-41e5-a820-92177102961c","hostname":"orbstack","level":"info","msg":"New job created","time":"2023-10-09T14:58:23.605349865Z"}
...
{"File":"pkg/log/log.go","Function":"github.com/kanisterio/kanister/pkg/log.Print","JobName":"kanister-test-job7t2t97fnq48s7k8js7h5jtz9k6nglff2b9tr5bhm","Line":165,"cluster_name":"85854027-f7b2-41e5-a820-92177102961c","hostname":"orbstack","level":"info","msg":"New job created","time":"2023-10-09T14:59:14.937041886Z"}
PASS: job_test.go:255: JobSuite.TestJobsReadOnlyVolumes 0.005s
{"File":"pkg/log/log.go","Function":"github.com/kanisterio/kanister/pkg/log.Print","JobName":"kanister-test-job7t2t97fnq48s7k8js7h5jtz9k6nglff2b9tr5bhm58bd9","Line":165,"cluster_name":"85854027-f7b2-41e5-a820-92177102961c","hostname":"orbstack","level":"info","msg":"New job created","time":"2023-10-09T14:59:14.93850743Z"}
PASS: job_test.go:235: JobSuite.TestJobsVolumes 0.000s


FAIL: job_test.go:194: JobSuite.TestJobsWaitAfterDelete

job_test.go:209:
c.Assert(err, IsNil)
... value *errors.StatusError = &errors.StatusError{ErrStatus:v1.Status{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ListMeta:v1.ListMeta{SelfLink:"", ResourceVersion:"", Continue:"", RemainingItemCount:(*int64)(nil)}, Status:"Failure", Message:"unable to parse requirement: values[0][job-name]: Invalid value: "kanister-test-job7t2t97fnq48s7k8js7h5jtz9k6nglff2b9tr5bhm58bd9dj8cz": must be no more than 63 characters", Reason:"BadRequest", Details:(*v1.StatusDetails)(nil), Code:400}} ("unable to parse requirement: values[0][job-name]: Invalid value: "kanister-test-job7t2t97fnq48s7k8js7h5jtz9k6nglff2b9tr5bhm58bd9dj8cz": must be no more than 63 characters")

PR series:

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

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

@k0taperk0t
Copy link
Contributor Author

I agree to the DCO for all the commits in this PR.

@DeepikaDixit DeepikaDixit requested a review from pavannd1 October 11, 2023 17:31
Copy link
Contributor

@viveksinghggits viveksinghggits left a comment

Choose a reason for hiding this comment

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

LGTM, but I don't we even need these tests anymore. I don't think kanister cretes job now.

@k0taperk0t
Copy link
Contributor Author

LGTM, but I don't we even need these tests anymore. I don't think kanister cretes job now.

@viveksinghggits But these tests are still active. If Kanister doesn't create jobs anymore, probably whole this functionality worth to removed from Kanister?

@viveksinghggits
Copy link
Contributor

LGTM, but I don't we even need these tests anymore. I don't think kanister cretes job now.

@viveksinghggits But these tests are still active. If Kanister doesn't create jobs anymore, probably whole this functionality worth to removed from Kanister?

Yes, that's what i should have said. Instead of just removing the tests we should remove that source file.

@k0taperk0t
Copy link
Contributor Author

k0taperk0t commented Oct 12, 2023

Yes, that's what i should have said. Instead of just removing the tests we should remove that source file.

Ok, I can do it in the next PR. This PR blocks #2365, please approve current PR, if it looks good.

@viveksinghggits
Copy link
Contributor

Yes, that's what i should have said. Instead of just removing the tests we should remove that source file.

Ok, I can do it in the next PR. This PR blocks #2365, please approve current PR, if it looks good.

Before actually removing that let's first verify if it's actually not being used anywhere. I think it's not but we will have to verify that.

1 similar comment
@viveksinghggits
Copy link
Contributor

Yes, that's what i should have said. Instead of just removing the tests we should remove that source file.

Ok, I can do it in the next PR. This PR blocks #2365, please approve current PR, if it looks good.

Before actually removing that let's first verify if it's actually not being used anywhere. I think it's not but we will have to verify that.

@k0taperk0t
Copy link
Contributor Author

Before actually removing that let's first verify if it's actually not being used anywhere. I think it's not but we will have to verify that.

@viveksinghggits OK. You commented this PR "LGTM". Could you approve it please? It blocks #2365 . We can figure out if we need to delete this functionality later.

Copy link
Contributor

@viveksinghggits viveksinghggits left a comment

Choose a reason for hiding this comment

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

Can you please create a GitHub issue to track removal of job related utilities if applicable.

@k0taperk0t k0taperk0t force-pushed the generation-of-job-name-for-tests-fixed branch from 11c75e6 to 57a9322 Compare October 12, 2023 16:02
@mergify mergify bot merged commit eba661f into kanisterio:master Oct 12, 2023
14 checks passed
@k0taperk0t k0taperk0t deleted the generation-of-job-name-for-tests-fixed branch October 13, 2023 07:20
leuyentran pushed a commit that referenced this pull request Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants