-
Notifications
You must be signed in to change notification settings - Fork 7
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
test(RHTAPWATCH-1067): Unit tests for getUserNamespaces #44
Conversation
26c9b8a
to
cd45a55
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall good progress, but I am not sure why a change in the function itself is required
I saw your comments on the PR thanks. The reason why I had to modify the main function was: take for eg to get specific user namespace test case- the test is expecting only one namespace (“test-tenant”) but is returning all three namespaces (test-tenant, test-tenant2, test-tenant3). I felt that the label selector is not working as expected and thats why I added filteredNamespaces func in the main.go. |
cd45a55
to
e1ce963
Compare
@Omeramsc I tried the method that you suggested
|
PTAL again. test cases pass. |
e1ce963
to
822930a
Compare
lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks much better now; I added a few more comments
f77bade
to
a66abe7
Compare
a294a97
to
becfb27
Compare
04fe886
to
aa98b2b
Compare
@Omeramsc PTAL. Three test cases fail out of the 4 because the function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Omeramsc PTAL. Three test cases fail out of the 4 because the function
getUserNamespaces
appears to be returning all user namespaces, regardless of the specific request. The same error I said in the beginning.
- The BeforeSuite is still applied to all tests. this is not desireable, I'll push a change seperating the unit tests from the functional tests.
- Probably a result of the former point, but in all tests you never created a namespace. the namespaces from the BeforeSuite are configured to pass the functional tests, so the fact they always return is a given. you shouldn't use them, you should create your own in the beforeEach
- the echo server however is not needed in the beforeEach
- resetting variables is in the afterEach is not needed, you need to reset (=remove) the namespaces you create.
If you have any more questions about why we use the beforeEach and afterEach for those tests and resource management, please don't hesitate to ask me before applying more changes to the code.
aa98b2b
to
576b21d
Compare
This PR is blocked by RHTAPWATCH-1237 Reorganize workspace-manager test suites. |
fa2b460
to
495c77b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I'm glad to see it moving forward. added some small requests
Add unit test for func getUserNamespaces
495c77b
to
346ad2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add unit test for func getUserNamespaces