Skip to content

ci: run only API and CLI smoke tests by default - #41607

Merged
DeepDiver1975 merged 34 commits into
masterfrom
api-cli-acceptance-full-ci
Jun 9, 2026
Merged

DeepDiver1975 merged 34 commits into
masterfrom
api-cli-acceptance-full-ci

Conversation

@phil-davis

Copy link
Copy Markdown
Contributor

Compared to #41598 this adds control to the acceptance test CI so that:

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".

If we do this then it will very much reduce the time and resources taken by the acceptance test CI for regular PRs.
And we can run the full set of acceptance tests when desired by putting "full-ci" into the PR title.

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.
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.
Using YML for the Behat config has b een deprecated.
So make the change to Behat PHP config.
The names were long, and it gets hard to view and find the
workflows in the list on a PR.
and fixup the color command variables in the acceptance test
script so that they contain the actual escape sequences for
selecting the required colors.
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.
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".
@phil-davis
phil-davis force-pushed the api-cli-acceptance-full-ci branch from d681b97 to ef419f5 Compare June 9, 2026 14:46
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.
@phil-davis
phil-davis force-pushed the api-cli-acceptance-full-ci branch from ef419f5 to 991e81c Compare June 9, 2026 14:50

@DeepDiver1975 DeepDiver1975 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.

Introduces a reusable acceptance.yml workflow and a ci.yml caller that runs only @smokeTest-tagged API and CLI scenarios by default, with full suite execution triggered by adding full-ci to the PR title.

The architecture is well thought out. Key observations:

Smoke-test gate strategy: Using a PR title string (full-ci) to toggle full CI is pragmatic for a team workflow but is easy to forget and invisible to reviewers. Consider also supporting a label (e.g. full-ci) as an alternative trigger — labels are more discoverable and can be applied without editing the PR title.

fail-fast: true on the matrix: This is fine for fast feedback but will abort all parallel matrix legs as soon as one fails. For a smoke-test suite this is generally acceptable; for the full suite triggered by full-ci it may hide independent failures. Consider making fail-fast configurable via an input.

selenium/standalone-chrome-debug:3.141.59-oxygen: This is a fixed, aging Selenium image (3.141.59 is the last Selenium 3 release from 2021). It's only used for WebUI tests, but worth noting as technical debt. Not a blocker.

additional-packages injection: The sudo apt-get install -y $ADDITIONAL_PACKAGES step expands an input directly into a shell command without quoting. If the input contained shell metacharacters this would be a concern, but since it's a workflow caller-controlled input (not user-controlled), the risk is low. Still worth quoting: sudo apt-get install -y "$ADDITIONAL_PACKAGES".

owncloudci/core:php83 for federated install: This hardcodes PHP 8.3 for the federated server regardless of the php-versions matrix input. Intentional (to keep federated simple) but worth documenting in a comment.

Digest pins: actions/checkout and shivammathur/setup-php are pinned to commit digests — good supply-chain hygiene.

Overall this is a solid, well-structured PR that meaningfully reduces CI cost for routine PRs. The smoke/full-ci split is a good default strategy.

@phil-davis

Copy link
Copy Markdown
Contributor Author

"This is a fixed, aging Selenium image (3.141.59 is the last Selenium 3 release from 2021). It's only used for WebUI tests, but worth noting as technical debt"

That is a good observation. Behat with the selenium webdriver for browser UI tests got stuck on an old webdriver for a long time. So we also got stuck using the last chrome and/or Firefox that had the old webdriver interface. When I get the webUI tests running in GitHub workflows, I will have a look to to see if there is now a Behat dependency chain that works properly with the latest browser releases.

@phil-davis

Copy link
Copy Markdown
Contributor Author

owncloudci/core:php83 - I think that the php83 tag for owncloudci/core has been made as a "special" at the moment. We don't have a whole range of flexible PHP versions available there anyway (for now).

@phil-davis
phil-davis requested a review from DeepDiver1975 June 9, 2026 15:16
@phil-davis

Copy link
Copy Markdown
Contributor Author

IMO this is ready to review and merge for now.
It gives reasonable API and CLI acceptance test coverage for routine PRs by running the smokeTest scenarios by default. They are run in a half-dozen pipelines that should finish in less than 30 minutes each.

Acceptance tests only start when the PHP unit tests have passed. That avoids swamping the CI infrastructure with pipelines, if the unit tests are not yet passing. The developer can get the unit tests passing without having lots of acceptance test pipelines keep starting.

If the change seems to be higher risk, then the developer can put full-ci somewhere in the PR title, and the full set of acceptance test scenarios will run.

We probably also want to make some policy about running the full set of acceptance test scenarios at regular intervals, to catch edge-case regressions that were not found by the smoke tests. Certainly that needs to be done in the lead-up to a release. But maybe we want to run that at regular intervals (weekly, monthly?)

After this PR, I will work on getting the webUI tests running.

@phil-davis
phil-davis requested a review from saw-jan June 9, 2026 15:24

@DeepDiver1975 DeepDiver1975 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.

Updated revision (+1 line vs previously reviewed). Content is substantially unchanged — previous review comments still apply. No new concerns from this revision.

@DeepDiver1975
DeepDiver1975 merged commit 86611fb into master Jun 9, 2026
26 checks passed
@DeepDiver1975
DeepDiver1975 deleted the api-cli-acceptance-full-ci branch June 9, 2026 19:04
oc-tmueller pushed a commit that referenced this pull request Oct 5, 2026
* 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)
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