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

[tests-only][full-ci] Add API tests for creating groups (graph API) #4992

Merged
merged 4 commits into from
Nov 11, 2022

Conversation

saw-jan
Copy link
Member

@saw-jan saw-jan commented Nov 7, 2022

Description

Added API tests for group creation

Added scenarios:

  1. Scenario Outline: admin user creates a group
    | simplegroup     |
    | España§àôœ€     |
    | नेपाली            |
    | $x<=>[y*z^2+1]! |
    | 😅 😆           |
    | comma,grp1      |
    | Finance (NP)    |
    | slash\Middle    |
  1. Scenario: admin user tries to create a group that already exists
  2. Scenario: normal user tries to create a group

Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment: local

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@saw-jan saw-jan added the QA:team label Nov 7, 2022
@saw-jan saw-jan self-assigned this Nov 7, 2022
.drone.env Outdated Show resolved Hide resolved
@saw-jan saw-jan marked this pull request as draft November 7, 2022 11:32
@saw-jan saw-jan changed the title [tests-only][full-ci] Add API tests for creating groups (graph API) [not-to-merge-yet][tests-only][full-ci] Add API tests for creating groups (graph API) Nov 7, 2022
@saw-jan saw-jan mentioned this pull request Nov 7, 2022
22 tasks
@saw-jan saw-jan force-pushed the api-test/create-group branch from a8a80e7 to cfdf5a6 Compare November 8, 2022 03:41
@saw-jan saw-jan requested a review from SwikritiT November 8, 2022 08:55
@SagarGi
Copy link
Member

SagarGi commented Nov 9, 2022

Opps !! I mistakenly approved this (eventually it will be). Sorry !!. @saw-jan

@saw-jan saw-jan requested a review from SagarGi November 9, 2022 04:25
Copy link
Contributor

@kiranparajuli589 kiranparajuli589 left a comment

Choose a reason for hiding this comment

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

looks good 👍

Copy link
Member

@SagarGi SagarGi left a comment

Choose a reason for hiding this comment

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

lgtm 👍

@saw-jan saw-jan force-pushed the api-test/create-group branch from cfdf5a6 to 4806fa6 Compare November 10, 2022 04:55
@saw-jan saw-jan changed the title [not-to-merge-yet][tests-only][full-ci] Add API tests for creating groups (graph API) [tests-only][full-ci] Add API tests for creating groups (graph API) Nov 10, 2022
@saw-jan saw-jan marked this pull request as ready for review November 10, 2022 04:55
tests/acceptance/features/apiGraph/createGroup.feature Outdated Show resolved Hide resolved
Scenario: admin user tries to create a group that already exists
Given group "mygroup" has been created
When user "Alice" tries to create a group "mygroup" using the Graph API
And the HTTP status code should be "500"
Copy link
Member

Choose a reason for hiding this comment

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

@butonic do we really expect 500 when a group cannot be created, or is this a bug?

Copy link
Contributor

Choose a reason for hiding this comment

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

we have an open issue: #3516

good that user cannot see 500 because web checks same groups name:

image

tests/acceptance/features/bootstrap/GraphContext.php Outdated Show resolved Hide resolved
Copy link
Contributor

@ScharfViktor ScharfViktor left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@individual-it individual-it left a comment

Choose a reason for hiding this comment

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

adjust Scenario: admin user tries to create a group that already exists to not expect 500
and add the test to expected to fail file

@ScharfViktor
Copy link
Contributor

adjust Scenario: admin user tries to create a group that already exists to not expect 500 and add the test to expected to fail file

add please https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/createUser.feature#L28 line to expected failures and change that we expect 400 instead of 500

@ScharfViktor
Copy link
Contributor

do we need case with empty group name?

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@saw-jan
Copy link
Member Author

saw-jan commented Nov 10, 2022

do we need case with empty group name?

In core, we have like this:

  Scenario: admin tries to create a group that is the empty string
    When the administrator tries to send a group creation request for group "" using the provisioning API
    Then the OCS status code should be "101"
    And the HTTP status code should be "200"

Should I add similar scenario for oCIS?

@ScharfViktor
Copy link
Contributor

Should I add similar scenario for oCIS?

I would add this case

@individual-it individual-it merged commit 03f53a3 into master Nov 11, 2022
@delete-merged-branch delete-merged-branch bot deleted the api-test/create-group branch November 11, 2022 03:46
ownclouders pushed a commit that referenced this pull request Nov 11, 2022
Author: Sawjan Gurung <[email protected]>
Date:   Fri Nov 11 09:31:13 2022 +0545

    [tests-only][full-ci] Add API tests for creating groups (graph API) (#4992)
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.

5 participants