owncloud / ocis

:atom_symbol: ownCloud Infinite Scale Stack
https://doc.owncloud.com/ocis/next/
Apache License 2.0
1.37k stars 181 forks source link

[QA] API test WebDav: unused stepDefinitions related to download with range #9520

Closed prashant-gurung899 closed 2 months ago

prashant-gurung899 commented 3 months ago

Description

/**
     * @Then /^the downloaded content when downloading file "([^"]*)" for user "([^"]*)" with range "([^"]*)" should be "([^"]*)"$/
     *
     * @param string $fileSource
     * @param string $user
     * @param string $range
     * @param string $content
     *
     * @return void
     */
    public function downloadedContentWhenDownloadingForUserWithRangeShouldBe(
        string $fileSource,
        string $user,
        string $range,
        string $content
    ):void {
        $user = $this->getActualUsername($user);
        $response = $this->downloadFileWithRange($user, $fileSource, $range);
        $this->checkDownloadedContentMatches($content, '', $response);
    }

Step definitions related to download with range in webDav.php are unused in any scenarios and one of them is shown above. Investigate whether to keep the step defintions and add test coverage for it or remove the unused step definitions.

Similar case was in this issue : https://github.com/owncloud/ocis/issues/9345

phil-davis commented 3 months ago

Investigate whether to keep the step definitions and add test coverage for it or remove the unused step definitions.

It was a bit surprising to me that there are not any test scenarios in the current test suite that download parts of a file by range of bytes. The tests originally came from oC10, and range-requests are covered there. I suppose that ocis supports downloading just a range of bytes of a file?

Maybe there are some "range download" test scenarios left in the test suite.

Someone can check and report if there is still any coverage of "range download", and what is covered. Then we can decide if we need to extend coverage, or just delete the unused test step code.

prashant-gurung899 commented 3 months ago

@phil-davis, Yeah there are some "download with range" test scenarios in tests/acceptance/features/coreApiWebdavOperations/downloadFile.feature

some of them are :

Scenario Outline: download a file with range
Scenario Outline: download a file with single part ranges
Scenario Outline: download a file with range out of bounds

There are more.

prashant-gurung899 commented 3 months ago

@phil-davis, Yeah there are some "download with range" test scenarios in tests/acceptance/features/coreApiWebdavOperations/downloadFile.feature

some of them are :

Scenario Outline: download a file with range
Scenario Outline: download a file with single part ranges
Scenario Outline: download a file with range out of bounds

There are more.

Other scenarios that i found related to download with range are :

Scenario Outline: download a file with multipart ranges
Scenario Outline: download a range at the end of a file 
Scenario Outline: download a file with last byte range out of bounds 
phil-davis commented 3 months ago

Good - there is reasonable test coverage of range-downloads.

I just noticed that the example unused step definition is a "Then" step. It must have been used in some unusual scenarios. I looked in oC10 core. Those steps are used in cliMain/transferOwnership.feature which tests the transfer-ownership CLI command in oC10. That does not exist in ocis.

So please go ahead and make a PR to delete the unused test step code.

prashant-gurung899 commented 3 months ago

@phil-davis Oh now i got why the step definitions were unused. I will delete those unused step definitions related to range download and push it in the same PR. https://github.com/owncloud/ocis/pull/9519

PrajwolAmatya commented 2 months ago

This issue has been fixed by this PR, https://github.com/owncloud/ocis/pull/9519. So, closing this issue.