Skip to content

test: do not start federated server as a PHP dev server - #41684

Merged
DeepDiver1975 merged 1 commit into
masterfrom
fix-running-php-dev-server
Jul 14, 2026
Merged

DeepDiver1975 merged 1 commit into
masterfrom
fix-running-php-dev-server

Conversation

@phil-davis

Copy link
Copy Markdown
Contributor

We can run some acceptance test scenario(s) directly from the command line without having to set up Apache etc. The run.sh script will start a PHP dev server, and that is easy for checking scenarios during development.

The current run.sh script starts 2 PHP dev servers. The 2nd one was supposed to be for use in test scenarios for federation.

But the 2nd PHP dev server was started with the same code, database and data directory as the 1st one. That causes lots of problems with the 2 attempted instances of ownCloud Classic getting very confused about which users, files etc exist.

This PR removes the startup of the 2nd PHP dev server. If a developer needs to run federated scenarios locally, then they need to fully set up a separate Federated server that uses different database tables, data storage directory etc.

I can now run a scenario with a 1-line command such as:

make test-acceptance-api BEHAT_FEATURE=tests/acceptance/features/apiComments/comments.feature:9

If I run the PHP dev server manually in another terminal window with:
php -S localhost:8080 -t /home/phil/git/owncloud/core

Then I can run a test scenario with:

make test-acceptance-api BEHAT_FEATURE=tests/acceptance/features/apiComments/comments.feature:9 TEST_SERVER_URL=http://localhost:8080

Specifying TEST_SERVER_URL in the make command means that the script does not start the PHP dev server, it assumes that the code is already being served by something at TEST_SERVER_URL

We can run some acceptance test scenario(s) directly from the
command line without having to set up Apache etc. The run.sh
script will start a PHP dev server, and that is easy for
checking scenarios during development.

The current run.sh script starts 2 PHP dev servers. The 2nd one
was supposed to be for use in test scenarios for federation.

But the 2nd PHP dev server was started with the same code,
database and data directory as the 1st one. That causes lots
of problems with the 2 attempted instances of ownCloud Classic
getting very confused about which users, files etc exist.

This PR removes the startup of the 2nd PHP dev server. If a
developer needs to run federated scenarios locally, then they
need to fully set up a separate Federated server that uses
different database tables, data storage directory etc.

I can now run a scenario with a 1-line command such as:

make test-acceptance-api BEHAT_FEATURE=tests/acceptance/features/apiComments/comments.feature:9

Signed-off-by: Phillip Davis <[email protected]>
@phil-davis
phil-davis requested a review from a team as a code owner July 14, 2026 08:44
@phil-davis
phil-davis requested review from a user and saw-jan July 14, 2026 09:02
@DeepDiver1975
DeepDiver1975 merged commit c690b1d into master Jul 14, 2026
27 checks passed
@DeepDiver1975
DeepDiver1975 deleted the fix-running-php-dev-server branch July 14, 2026 09:24
oc-tmueller pushed a commit that referenced this pull request Oct 5, 2026
We can run some acceptance test scenario(s) directly from the
command line without having to set up Apache etc. The run.sh
script will start a PHP dev server, and that is easy for
checking scenarios during development.

The current run.sh script starts 2 PHP dev servers. The 2nd one
was supposed to be for use in test scenarios for federation.

But the 2nd PHP dev server was started with the same code,
database and data directory as the 1st one. That causes lots
of problems with the 2 attempted instances of ownCloud Classic
getting very confused about which users, files etc exist.

This PR removes the startup of the 2nd PHP dev server. If a
developer needs to run federated scenarios locally, then they
need to fully set up a separate Federated server that uses
different database tables, data storage directory etc.

I can now run a scenario with a 1-line command such as:

make test-acceptance-api BEHAT_FEATURE=tests/acceptance/features/apiComments/comments.feature:9

Signed-off-by: Phillip Davis <[email protected]>
(cherry picked from commit c690b1d)
phil-davis added a commit that referenced this pull request Oct 6, 2026
…41887)

* fix: ensure that the checkPropFind event occurs before httpPropFind

These two events had the same event priority. They happened to get
in the right order because their event entries were sorted
alphabetically, so "c" came before "h".

Sabre\Event is no longer going to do this alphabetical sorting.
It will trigger events in priority order, and then for events with
the same priority, it will trigger the events in the order that they
have been put into the listeners array. This will make the order of
event execution more transparent.

Signed-off-by: Phillip Davis <[email protected]>
(cherry picked from commit cd67d47)

* test: adjust acceptance tests for running GitHub workflows (#41533)

* test: handle trashbin restore test when installed in subfolder

When owncloud core is installed in a subfolder, then the href for
items in the trashbin has a path that includes the subfolder.
For example:
 /server/remote.php/dav/trash-bin/Alice/...

Handle the possible presence of the subfolder at the start of the path.

* test: log messages confirming servers are up

when starting acceptance tests

* test: fix TEST_SERVER_FED_URL use in acceptance test run.sh

* chore(ci): add Apache site configs for acceptance testing

These Apache site config templates can be used to set up Apache
for single-server or dual-server (federated) testing environments
with each server in a separate subdirectory of the Apache server root.
Or, in the single-server case, installing ownCloud core directly
into the Apache root folder /var/www/html

* test: process APP_NAME when deciding what apps to disable (#41540)

When running acceptance tests, we disable the firstrunwizard
and notifications app by default. These apps are often provided
in a bundled ownCloud core tarball. But they can get in the way
of webUI tests, because:

- the firstrunwizard might display itself at the very start of testing
- notifications can appear at the top of the webUI, and might obscure
  things that are being tested.

But if we are actually testing one of these apps, then we don't want
to disable the app.

The logic in acceptance ytetst run.sh is enhanced to avoid disabling
the app when it is the app-under-test.

(cherry picked from commit b361ff7)

* ci: run only API and CLI smoke tests by default (#41607)

* ci: add initial acceptance test workflow

* ci: add some API acceptance test suites

* ci: run only one test suite for now

* ci: find out why no priv for /var/www/html

* ci: adjust /var/www permissions

* ci: adjust server install

* ci: run apiFederationToRoot1 suite

* ci: copy all files including hidden files

* test(deps): bump behat-related minor version dependencies

Bump to the current minor releases. This is what is used in reality
in CI, so record that here to make sure that everyone is using at
least these versions.

* test(deps): pin symfony/yaml to 7.4.11

Because 7.4.12 has a limit of 128 on the number of collection aliases.
And we need over 200.
A way to configure this may be needed.

* test: remove unneeded colons from behat.yml

* test: convert behat YML config to behat.php

Using YML for the Behat config has b een deprecated.
So make the change to Behat PHP config.

* test: fix PHP code style of behat.php

* test(deps): revert pin symfony/yaml to 7.4.11

This reverts commit 1d5dc1e.

* test: install all PHP extensions

* ci: add more API acceptance test suites

* ci: add all API acceptance test suites

* test: fix reference to server root

* test: fix

* ci: shorten acceptance test workflow names

The names were long, and it gets hard to view and find the
workflows in the list on a PR.

* ci: install ImageMagick for Previews tests

* test: update preview test fixture

* ci: refactor server and federated folder

* ci: add some CLI acceptance tests

* ci: provide email server for cliProvisioning

* test: override dumb terminal setting with xterm

and fixup the color command variables in the acceptance test
script so that they contain the actual escape sequences for
selecting the required colors.

* ci: add more cli test suites

* ci: only run acceptance tests after lint and unit tests pass

* ci: run multiple acceptance test suites per job

This reduces the number of job pipelines needed.
Which reduces the number of times the server setup has to be done.

The test suites are grouped so that the run time of each workflow
job will be 30 to 40 minutes.

* ci: run only API and CLI smoke tests by default

If the PR title contains the string "full-ci" then run all the
acceptance tests. But by default just run the test scenarios
tagged "smokeTest".

* test: refactor behat settings to remove duplicated code

The previous behat.yml acceptance test settings were automatically
converted to behat.php for the latet releases of the behat
acceptance test framework. That conversion produced a lot of
identical repeated sets of settings.

This change refactors that to remove the duplicated code and thus
make future maintenance easier.

* ci: split API smoke tests into 4 parts

* ci: quote ADDITIONAL_PACKAGES variable used in install command

* ci: adjust to split API smoke tests into 5 parts

[10.16] Kept behat.yml and the Behat ^3.13 requirements: behat.php and Behat ^3.31
need PHP >= 8.2, and 10.16 runs on PHP 7.4. Dropped the calens job (from #41603,
not part of this change) from the acceptance jobs' needs.

(cherry picked from commit 86611fb)

* chore(ci): add workflow jobs to summarise acceptance test results (#41689)

acceptance-api-pass will run after all API acceptance test workflows have
either been skipped or finished. If all those workflows were either
skipped or success (i.e. none failed), then this summary workflow
will echo that it is a pass.

acceptance-cli-pass will run after all CLI acceptance test workflows have
either been skipped or finished. If all those workflows were either
skipped or success (i.e. none failed), then this summary workflow
will echo that it is a pass.

This will produce two simple results for GitHub that can be Required.

Signed-off-by: Phillip Davis <[email protected]>
(cherry picked from commit 90624e9)

* test: do not start federated server as a PHP dev server (#41684)

We can run some acceptance test scenario(s) directly from the
command line without having to set up Apache etc. The run.sh
script will start a PHP dev server, and that is easy for
checking scenarios during development.

The current run.sh script starts 2 PHP dev servers. The 2nd one
was supposed to be for use in test scenarios for federation.

But the 2nd PHP dev server was started with the same code,
database and data directory as the 1st one. That causes lots
of problems with the 2 attempted instances of ownCloud Classic
getting very confused about which users, files etc exist.

This PR removes the startup of the 2nd PHP dev server. If a
developer needs to run federated scenarios locally, then they
need to fully set up a separate Federated server that uses
different database tables, data storage directory etc.

I can now run a scenario with a 1-line command such as:

make test-acceptance-api BEHAT_FEATURE=tests/acceptance/features/apiComments/comments.feature:9

Signed-off-by: Phillip Davis <[email protected]>
(cherry picked from commit c690b1d)

* ci: always start mariadb service for federated tests (#41747)

For federated tests, we always us mariadb for the federated server,
the same as was done in the drone configs. So for federated tests,
start the mariadb service even if the local system will be using
PostgreSQL.

Signed-off-by: Phillip Davis <[email protected]>
(cherry picked from commit 302369a)

* ci(acceptance): do not cancel sibling suites on the first failure (#41767)

Each acceptance test workflow runs different test scenarios.
If one acceptance test suite fails, we still want to see the
results of the other test suites.

Signed-off-by: Phillip Davis <[email protected]>
(cherry picked from commit d617d43)

* ci: run apt-get update before installing Linux packages (#41854)

Every acceptance job was failing on the "Install Linux packages" step, and
re-running did not help:

  E: Failed to fetch .../g/ghostscript/libgs-common_10.02.1~dfsg1-0ubuntu7.8_all.deb
     404  Not Found [IP: 52.147.219.192 80]
  E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

The step installed straight from the package index baked into the runner image.
That index is stale, so the exact .deb versions it names have already been
superseded on the Azure mirror and the URLs 404. A ghostscript security update -
imagemagick pulls ghostscript in - is enough to break every job, with no change
on our side. See actions/runner-images#7452.

So run apt-get update immediately before each install. "Install Apache" already
did; "Install Linux packages" and the libxml2-utils step did not.

Also:

- add -o Acquire::Retries=3 to the installs, so one flaky mirror hit retries
  instead of taking a whole matrix job down with it;
- use apt-get rather than apt for libxml2-utils - apt has no stable CLI for
  scripts and says so on every run.

Seen on https://github.com/owncloud/core/actions/runs/35783629819/job/107115884062

Co-authored-by: Thomas Müller <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
(cherry picked from commit b137901)

* ci: run the acceptance workflow on the 10.16 line's PHP and app versions

10.16 runs on PHP 7.4, so default the acceptance workflow to it rather
than master's 8.3.

The notifications app's default branch now requires ownCloud 11 and
PHP 8.3. Add an additional-app-ref input and pin notifications to
v0.6.0, the version the 10.16.5 bundle ships. That tag has no "ci"
make target; on the app's master "ci" only depends on "vendor", so call
"vendor" directly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: install a 10.16 federated server for the 10.16 acceptance tests

The federated install came over from master as the daily-master-qa
tarball on the PHP 8.3 image. That is ownCloud 11, which the runner's
PHP 7.4 cannot run, and which refuses the 10.16 line of the
notifications app.

There is no daily 10.16 tarball, so install the v10.16.5 qa release
asset instead, on owncloudci/core:nodejs14 (PHP 7.4), the image the
10.16 drone pipeline used.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: use setup-php's own Apache module for PHP 7.4

Ubuntu 24.04 has no libapache2-mod-php7.4 package, so every acceptance
job failed at Install Apache. setup-php's PHP 7.4 build already installs
the module (/usr/lib/apache2/modules/libphp7.4.so and
mods-available/php7.4.load), so enable it with the prefork MPM instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test: stay under symfony/yaml's alias limit in behat.yml

symfony/yaml 5.4.52 caps collection aliases at 128 per document, and
Behat parses its config with the static Yaml::parse(), so the limit
cannot be raised. behat.yml used 210 aliases, and every acceptance run
on 10.16 failed before loading a single suite. Every symfony/yaml
release without the cap is blocked by Composer's security advisories,
so pinning one is not an option either.

Write the LDAP suite context out in each suite instead of aliasing it.
The parsed configuration is identical; 105 aliases remain. master is not
affected because it moved to behat.php, which needs PHP 8.1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Signed-off-by: Phillip Davis <[email protected]>
Co-authored-by: Phillip Davis <[email protected]>
Co-authored-by: Thomas Müller <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants