-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Make possible to run acceptance tests on Apache #9127
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
Merged
MorrisJobke
merged 5 commits into
master
from
make-possible-to-run-acceptance-tests-on-apache
Apr 9, 2018
Merged
Make possible to run acceptance tests on Apache #9127
MorrisJobke
merged 5 commits into
master
from
make-possible-to-run-acceptance-tests-on-apache
Apr 9, 2018
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The Docker image for acceptance tests provides support for both the PHP built-in web server and the Apache web server; the acceptance tests for the server are run on the PHP built-in web server, but the acceptance tests for some apps will have to be run on the Apache web server (for example, Talk, as it uses long polling), so a Docker image to support both cases has to be used in "run.sh". ".drone.yml" was just updated for consistency, although it was not really needed. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Apache sub-processes are run as the www-data user, and they need to be able to write to the "apps", "config" and "data" directories, so they have to belong to that user, and therefore the Nextcloud server has to be installed and configured too as the www-data user. The PHP built-in web server will still be run as the root user, but in that case the owner of those directories makes no difference, so this is compatible with both cases. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Before, the domain was automatically added assuming that the
NextcloudTestServerContext had no parameters defined in the Behat
configuration. However, in order to use a helper for Apache it would
need to be specified in the configuration with something like:
- NextcloudTestServerContext:
nextcloudTestServerHelper: NextcloudTestServerLocalApacheHelper
The substitution now works both when a helper is specified and when it
is not; note, however, that providing custom parameters to the helper is
not supported, although they are not needed anyway so it is not really a
problem.
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
The default and only helper to run acceptance tests run them on the PHP built-in web server. This commit introduces a new helper that can be used to run them on an Apache web server instead. This helper is meant to be used by the acceptance tests of apps that require a multi-threaded web server to run (like Talk, due to its use of long polling). To use the helper it is only needed to set it in the Behat configuration for the acceptance tests of the app, as explained in the "NextcloudTestServerContext" documentation. It is assumed that the acceptance tests are run using the default setup, and therefore inside a Docker container based on the image for acceptance tests from Nextcloud. Due to that the helper is expected to have root permissions, and thus it starts and stops the Apache web server directly using "service start/stop apache2". In the same way it also restores the owner and group for "apps", "config" and "data" to "www-data", as it is the user that Apache sub-processes are run as. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
For consistency with the helper for the Apache web server the helper for the PHP built-in web server was renamed too. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
rullzer
approved these changes
Apr 9, 2018
Member
rullzer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it all passes fine by me!
MorrisJobke
approved these changes
Apr 9, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Until now the acceptance tests were always run on the PHP built-in web server. This pull request makes possible to optionally run them on an Apache web server too.
Acceptance tests for the Nextcloud server run fine on the PHP built-in web server; this is meant to be used for the acceptance tests of those apps that require a multi-threaded web server (for example, Talk, as it uses long polling).
To run the acceptance tests on an Apache web server it is simply necessary to set the
nextcloudTestServerHelperparameter of theNextcloudTestServerContexttoNextcloudTestServerLocalApacheHelperin the Behat configuration of the acceptance tests for the app, and also link the server directory to /var/www/html/ in Drone (when the acceptance tests are run through run.sh the link is done automatically, it is only needed for Drone).The above description can be seen more clearly in nextcloud/spreed@07b6b10 and nextcloud/spreed@137e7c6#diff-3216dfff0ed3e301453e6799e8c367e2R161, which are part of the pull request to add acceptance tests for Nextcloud Talk.