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

Cleanup double-slash URLs in acceptance tests #30863

Merged
merged 1 commit into from
Mar 22, 2018

Conversation

phil-davis
Copy link
Contributor

@phil-davis phil-davis commented Mar 22, 2018

Description

In places where the acceptance tests use baseURL and append stuff to it, add checks that put a / after baseURL only if baseURL does not already end in a /

That makes it flexible to have baseURL passed in with or without a trailing slash, and to not get double-slash sent in API requests.

Related Issue

owncloud/QA#517

Motivation and Context

When running acceptance tests, on the PHP server we see requests like:

[Thu Mar 22 10:00:06 2018] 127.0.0.1:45804 [200]: /ocs//v1.php/apps/testing/api/v1/increasefileid
[Thu Mar 22 10:00:06 2018] 127.0.0.1:45806 [200]: //ocs/v1.php/cloud/capabilities
[Thu Mar 22 10:00:06 2018] 127.0.0.1:45808 [200]: //ocs/v1.php/apps/testing/api/v1/apps
[Thu Mar 22 10:00:07 2018] 127.0.0.1:45810 [200]: //ocs/v1.php/apps/testing/api/v1/app/core/shareapi_enabled
[Thu Mar 22 10:00:07 2018] 127.0.0.1:45812 [200]: //ocs/v1.php/cloud/capabilities
[Thu Mar 22 10:00:07 2018] 127.0.0.1:45814 [200]: //ocs/v1.php/apps/testing/api/v1/app/core/shareapi_enabled

Nothing bad goes wrong, ownCloud copes with "random" double-slash in the URI. But it makes people ask questions when they notice this in acceptance test output. So it is good to clean it up.

How Has This Been Tested?

Local runs of some API acceptance tests now give requests like:

[Thu Mar 22 09:53:57 2018] 127.0.0.1:45418 [200]: /ocs/v1.php/apps/testing/api/v1/increasefileid
[Thu Mar 22 09:53:57 2018] 127.0.0.1:45420 [200]: /ocs/v1.php/cloud/capabilities
[Thu Mar 22 09:53:57 2018] 127.0.0.1:45422 [200]: /ocs/v1.php/apps/testing/api/v1/apps
[Thu Mar 22 09:53:57 2018] 127.0.0.1:45424 [200]: /ocs/v1.php/apps/testing/api/v1/app/core/shareapi_enabled
[Thu Mar 22 09:53:57 2018] 127.0.0.1:45426 [200]: /ocs/v1.php/cloud/capabilities
[Thu Mar 22 09:53:57 2018] 127.0.0.1:45428 [200]: /ocs/v1.php/apps/testing/api/v1/app/core/shareapi_enabled

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)
  • Acceptance test refactoring

Checklist:

  • [x My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov
Copy link

codecov bot commented Mar 22, 2018

Codecov Report

Merging #30863 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #30863   +/-   ##
=========================================
  Coverage     62.25%   62.25%           
  Complexity    18205    18205           
=========================================
  Files          1140     1140           
  Lines         68043    68043           
  Branches       1230     1230           
=========================================
  Hits          42362    42362           
  Misses        25318    25318           
  Partials        363      363
Flag Coverage Δ Complexity Δ
#javascript 51.99% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 63.42% <ø> (ø) 18205 <ø> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ffd950...583fcc9. Read the comment docs.

@phil-davis phil-davis merged commit c3ef163 into master Mar 22, 2018
@phil-davis phil-davis deleted the double-slash-acceptance-tests branch March 22, 2018 05:30
@phil-davis
Copy link
Contributor Author

Backport stable10 #30864

@lock
Copy link

lock bot commented Jul 31, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants