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

Test coverage for setting api #8800

Closed
amrita-shrestha opened this issue Apr 8, 2024 · 5 comments
Closed

Test coverage for setting api #8800

amrita-shrestha opened this issue Apr 8, 2024 · 5 comments
Assignees
Labels

Comments

@amrita-shrestha
Copy link
Contributor

amrita-shrestha commented Apr 8, 2024

Describe

OCIS has provided documentation for grpc-setting. However, there's an issue tagged as #1349 regarding the documentation of an API endpoint, yet no corresponding pull request has been linked to it. Notably, there isn't specific test coverage dedicated to the setting API. However, the setting API has been employed to meet prerequisites and verify outcomes for features related to notifications and roles.

Overview of used setting API on OCIS API tests

https://github.com/owncloud/ocis/blob/c179485db65d92fa2bb96e48cb01fa92e125d497/tests/acceptance/features/bootstrap/SettingsContext.php contain all code related to setting API
settings endpoint = /api/v0/settings/

endpoint functions steps
/api/v0/settings/roles-list 1.getAllExistingRoles->getRoles
2.getRoleIdByRoleName->getRoles
1.@when /^user "([^"])" tries to get all existing roles$/
2.@given /^the administrator has given "([^"]
)" the role "([^"]*)" using the settings api$/
/api/v0/settings/assignments-add 1.theAdministratorHasGivenUserTheRole->assignRoleToUser
2.userChangeOwnRole->assignRoleToUser
3. userChangeRoleAnotherUser->assignRoleToUser
1. @given /^the administrator has given "([^"])" the role "([^"])" using the settings api$/
2. @when /^user "([^"])" changes his own role to "([^"])"$/
3. @when /^user "([^"])" changes the role "([^"])" for user "([^"]*)"$/
/api/v0/settings/assignments-list 1. userGetAssignmentsList->getAssignmentsList
2. userShouldHaveRole->getAssignmentsList
1. @when /^user "([^"])" tries to get list of assignment$/
2. @then /^user "([^"]
)" should have the role "([^"]*)"$/
/api/v0/settings/bundles-list 1. sendRequestToSwitchSystemLanguage->getBundlesList->sendRequestGetBundlesList 1.@given /^user "([^"])" has switched the system language to "([^"])" using the settings API$/
/api/v0/settings/values-list 1. theUserListsAllValuesListWithHeadersUsingSettingsApi->sendRequestGetSettingsValuesList
2. listAllNotifications->getSettingLanguageValue->sendRequestGetSettingsValuesList
1. @when /^user "([^"]*)" lists values-list with headers using the Settings API$/
/api/v0/settings/values-save 1. sendRequestToSwitchSystemLanguage 1. @given /^user "([^"])" has switched the system language to "([^"])" using the settings API$/
/api/v0/settings/values-save 1. theUserHasDisabledAutoAccepting->sendRequestToDisableAutoAccepting 1.@given user :user has disabled the auto-sync share

Point to discuss

  • are we going to write dedicated test coverage for setting API
@ScharfViktor
Copy link
Contributor

We have this api but we have replaced many of the settings api endpoinds with a graph
example: #6538

I wouldn't put any more effort into it than that. I would just created setting feature and check that it works without edge cases.

@nirajacharya2 nirajacharya2 assigned S-Panta and unassigned S-Panta Apr 18, 2024
@individual-it
Copy link
Member

What about the security of the endpoint?

@saw-jan
Copy link
Member

saw-jan commented Dec 16, 2024

I wouldn't put any more effort into it than that. I would just created setting feature and check that it works without edge cases.

As per our monthly QA meeting on 2024-12-13, we decided to add basic happy tests for the settings APIs that are still in use.

@amrita-shrestha
Copy link
Contributor Author

amrita-shrestha commented Dec 23, 2024

@prashant-gurung899
Copy link
Contributor

Closing this issue as the basic happy tests for settings API are covered in PR: #10827
And also the existing settings API tests are shifted to the new suite apiSettings in this PR: #10841

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants