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] tests: adding test coverage for thumbnail service #10763

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

nirajacharya2
Copy link
Contributor

@nirajacharya2 nirajacharya2 commented Dec 12, 2024

Description

When the image exceeded the any value in env

  • THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE
  • THUMBNAILS_MAX_INPUT_WIDTH
  • THUMBNAILS_MAX_INPUT_HEIGHT

the server would return status code 500 which shouldn't be the case as mentioned in #10589

This PR adds test coverage for issue #10589. making sure the correct status code is returned.

Imp discussion : #10763 (comment)

Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1: locally
  • test case 2: ci
  • ...

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:

@nirajacharya2 nirajacharya2 self-assigned this Dec 12, 2024
@nirajacharya2 nirajacharya2 force-pushed the image-config-test branch 3 times, most recently from 8c65dfe to d0d2152 Compare December 17, 2024 04:12
@nirajacharya2 nirajacharya2 marked this pull request as ready for review December 17, 2024 04:13
Copy link
Contributor

@amrita-shrestha amrita-shrestha left a comment

Choose a reason for hiding this comment

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

lgtm

@nirajacharya2 nirajacharya2 force-pushed the image-config-test branch 2 times, most recently from 0ca57bf to 5f02f38 Compare December 19, 2024 04:13
Copy link
Contributor

@PrajwolAmatya PrajwolAmatya left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +398 to +399
When user "Alice" downloads the preview of "/lorem-big.txt" with width "36" and height "36" and processor thumbnail using the WebDAV API
Then the HTTP status code should be "403"
Copy link
Member

Choose a reason for hiding this comment

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

what happens if we do not set the configs? 200?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what happens if we do not set the configs? 200?

depends on the image. dose it exceed the default values for the configs?

config defaults
THUMBNAILS_MAX_INPUT_WIDTH 7680
THUMBNAILS_MAX_INPUT_HEIGHT 7680
THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE 50MB

https://doc.owncloud.com/ocis/next/deployment/services/s-list/thumbnails.html#thumbnails-and-secureview

Copy link
Member

Choose a reason for hiding this comment

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

Good. It is understandable for image file but for a text file, how does the thumbnail service react? if the text file is under max input size?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its same as an image file. if the text file is under max input size a thumbnail is created

Copy link
Member

Choose a reason for hiding this comment

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

then the scenarios look good 👍

@nirajacharya2 nirajacharya2 force-pushed the image-config-test branch 2 times, most recently from b046446 to 1ef4a83 Compare December 24, 2024 05:44
@nirajacharya2 nirajacharya2 force-pushed the image-config-test branch 2 times, most recently from 167a0db to a04bbdf Compare December 30, 2024 03:48
Copy link
Contributor

@amrita-shrestha amrita-shrestha left a comment

Choose a reason for hiding this comment

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

lgtm

@S-Panta S-Panta merged commit dc02488 into master Dec 30, 2024
4 checks passed
@nirajacharya2 nirajacharya2 deleted the image-config-test branch December 30, 2024 06:53
ownclouders pushed a commit that referenced this pull request Dec 30, 2024
[tests-only][full-ci] tests: adding test coverage for thumbnail service
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.

6 participants