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

Use of baseURL in acceptance tests #30879

Closed
2 tasks
phil-davis opened this issue Mar 23, 2018 · 6 comments
Closed
2 tasks

Use of baseURL in acceptance tests #30879

phil-davis opened this issue Mar 23, 2018 · 6 comments

Comments

@phil-davis
Copy link
Contributor

The API acceptance tests are passed the base URL of the server-under-test in a format like:

http://localhost:8080/ocs/
http://localhost:8080/cloudfolder/ocs/

when they want to access some API endpoint that does not start with ocs/ then they take the ocs/ off and then add the required string for the URL.

The webUI acceptance tests are passed the base URL of the server-under-test in a format like:

http://localhost:8080/
http://localhost:8080/cloudfolder/

and they add the ocs/ or other endpoint URL as needed to access API endpoints.

Also it is not currently consistent if the passed-in base URL always has a / at the end or not.

This all makes a bit of a muddle for different methods that are in "API acceptance" classes and "webUI acceptance" classes.

To discuss/decide:

  • common standard format for storing baseURL
  • whether to require a \ at the end, or not, or be flexible parsing the passed-in value

@individual-it @SergioBertolinSG @davitol

@phil-davis
Copy link
Contributor Author

My suggestions:

  • pass in and store just the "really base" part like http://localhost:8080 or http://localhost:8080/cloudfolder
  • cope with the passed-in baseURL parameter having a / at the end (easy to be flexible when parsing the passed-in value)
  • store the baseURL only in 1 place in an API acceptance test context class (e.g. FeatureContext). The webUI acceptance test context classes can get it from there if they need it.

@ownclouders
Copy link
Contributor

GitMate.io thinks possibly related issues are #22485 (test), #22492 (test), #30863 (Cleanup double-slash URLs in acceptance tests), #30493 (Rename integration API tests to acceptance), and #30833 (Refactor acceptance tests to use common user-group-server).

@SergioBertolinSG
Copy link
Contributor

@phil-davis I fully agree with changing this. But be aware that it involves changes in many functions, as many of them to create the request url starts using baseUrl, for example:

$fullUrl = $this->baseUrl . "v2.php/cloud/users/$user/groups";

It will affect also acceptance tests of apps also (customgroups, guests, etc).

@phil-davis
Copy link
Contributor Author

Yes, it will need careful examination of everything that uses, passes... baseURL !

@phil-davis
Copy link
Contributor Author

PRs merged. webUI acceptance tests now use the "API test" view of baseUrl to know where to browse etc.

@lock
Copy link

lock bot commented Jul 30, 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 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants