Skip to content

ci: run the API and CLI acceptance tests in GitHub Actions [10.16] - #41887

Merged
phil-davis merged 13 commits into
10.16from
ci/acceptance-10.16
Oct 6, 2026
Merged

phil-davis merged 13 commits into
10.16from
ci/acceptance-10.16

Conversation

@oc-tmueller

@oc-tmueller oc-tmueller commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Merge order: #41890 first (the PROPFIND fix that the API smoke tests need), then retarget this PR to 10.16.

Backports master's GitHub Actions acceptance tests to 10.16. Until now, 10.16 CI has been the commit lint and PHP Unit only. The .drone.star file is still in the tree, but drone no longer runs. This is the base for backporting #41882 (API smoke tests on S3 primary storage) in a follow-up PR.

Cherry-picked from master

#41533, #41540, #41607, #41689, #41684, #41747, #41767, #41854. Each commit keeps its (cherry picked from …) line, except the first one, which is a clean pick of 81ffe97.

Changes needed for 10.16

  • behat.yml stays. ci: run only API and CLI smoke tests by default #41607 converts it to behat.php and bumps Behat to ^3.31. The PHP config format needs Behat ≥3.16 (PHP ≥8.1), and ^3.31 needs PHP ≥8.2, but 10.16 runs on PHP 7.4. So 10.16 keeps behat.yml, Behat ^3.13 and the BEHAT_YML naming in run.sh. That also keeps working for oc10 apps that ship their own config/behat.yml. The rest of ci: run only API and CLI smoke tests by default #41607's run.sh changes are ported, including --suites and the colour fixes.
  • No calens in needs. That job comes from ci: add calens validation job to CI workflow #41603, which is not part of this backport.
  • PHP 7.4 is the default in acceptance.yml.
  • notifications is pinned to v0.6.0, the version in the 10.16.5 bundle, using a new additional-app-ref input. The app's default branch requires oC 11 and PHP 8.3. v0.6.0 has no ci make target. On the app's master, ci just depends on vendor, so the workflow calls make vendor.
  • The federated server is 10.16.5, installed from core's owncloud-10.16.5-qa.tar.bz2 release asset on owncloudci/core:nodejs14 (PHP 7.4, the image 10.16's drone used). Master's version installs daily-master-qa, which is oC 11, and there is no daily 10.16 tarball.

Every suite listed in ci.yml exists in 10.16's behat.yml.

🤖 Generated with Claude Code

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)
phil-davis and others added 12 commits October 5, 2026 21:32
* 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
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: 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)
…1689)

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)
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)
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)
…1767)

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)
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)
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]>
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]>
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]>
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]>
@oc-tmueller
oc-tmueller changed the base branch from 10.16 to fix/propfind-check-priority-10.16 October 5, 2026 19:32
@oc-tmueller oc-tmueller closed this Oct 5, 2026
@oc-tmueller oc-tmueller reopened this Oct 5, 2026
@oc-tmueller
oc-tmueller marked this pull request as ready for review October 5, 2026 23:53
Base automatically changed from fix/propfind-check-priority-10.16 to 10.16 October 6, 2026 07:09

@phil-davis phil-davis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread tests/acceptance/config/behat.yml Resolved
Comment thread tests/acceptance/run.sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, this found lots of changes that were done to improve this script recently in master

@phil-davis
phil-davis merged commit 9b34557 into 10.16 Oct 6, 2026
@phil-davis
phil-davis deleted the ci/acceptance-10.16 branch October 6, 2026 07:19
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