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

[YUNIKORN-563] test: improve unit test assertion #739

Closed
wants to merge 1 commit into from
Closed

[YUNIKORN-563] test: improve unit test assertion #739

wants to merge 1 commit into from

Conversation

stu01509
Copy link
Contributor

What is this PR for?

Improve unit test assertion

What type of PR is it?

  • - Bug Fix
  • - Improvement
  • - Feature
  • - Documentation
  • - Hot Fix
  • - Refactoring

Todos

  • - Task

What is the Jira issue?

https://issues.apache.org/jira/browse/YUNIKORN-563

How should this be tested?

Screenshots (if appropriate)

Questions:

  • - The licenses files need update.
  • - There is breaking changes for older versions.
  • - It needs documentation.

assert.Assert(t, result != nil)
assert.Equal(t, len(result), 1)
assert.Equal(t, result["a"], "b")
testCases := []struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +143 to +150

assert.DeepEqual(t, holder.pod.Labels, map[string]string{
"applicationId": "app01",
"labelKey0": "labelKeyValue0",
"labelKey1": "labelKeyValue1",
"placeholder": "true",
"queue": "root.default",
})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://github.com/apache/yunikorn-k8shim/pull/239/files#r592236442

I didn't refactor the holder.pod.Annotations, because it contains yunikorn.apache.org/task-groups has a long value.
Screenshot 2023-11-30 at 10 48 39 PM

Copy link

codecov bot commented Dec 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (28995cd) 69.46% compared to head (b610017) 69.43%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #739      +/-   ##
==========================================
- Coverage   69.46%   69.43%   -0.03%     
==========================================
  Files          50       50              
  Lines        7993     7993              
==========================================
- Hits         5552     5550       -2     
- Misses       2252     2254       +2     
  Partials      189      189              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pbacsko pbacsko self-requested a review December 4, 2023 15:07
Copy link
Contributor

@pbacsko pbacsko left a comment

Choose a reason for hiding this comment

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

+1

@pbacsko pbacsko closed this in ff939a5 Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants