Skip to content

test: check the XML returned by occ commands in acceptance tests#41655

Draft
phil-davis wants to merge 4 commits into
masterfrom
acceptance-test-occ-result-checking
Draft

test: check the XML returned by occ commands in acceptance tests#41655
phil-davis wants to merge 4 commits into
masterfrom
acceptance-test-occ-result-checking

Conversation

@phil-davis

Copy link
Copy Markdown
Contributor

Before trying to parse the return XML of remote occ commands that are done in the acceptance test setup and teardown script, first check that the string is valid XML.

If it is not valid XML, then echo the string to the console so that the problem can be seen.

Before trying to parse the return XML of remote occ commands that
are done in the acceptance test setup and teardown script, first
check that the string is valid XML.

If it is not valid XML, then echo the string to the console so
that the problem can be seen.
@phil-davis phil-davis changed the title Test: check the XML returned by occ commands in acceptance tests test: check the XML returned by occ commands in acceptance tests Jun 26, 2026
Comment thread tests/acceptance/run.sh
Comment on lines +876 to +887
if [ "${TEST_WITH_FED_PHPDEVSERVER}" == "true" ]
then
# This runs a 2nd server, but serving the code from the same location
# as the 1st server at TEST_SERVER_URL. It cannot operate reliably, because
# it will share the filesystem, database etc.
PORT_FED=$((8180 + ${EXECUTOR_NUMBER}))
echo ${PORT_FED}
php -S localhost:${PORT_FED} -t ../.. &
PHPPID_FED=$!
echo ${PHPPID_FED}
export TEST_SERVER_FED_URL="http://localhost:${PORT_FED}"
fi

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note: A developer can run an acceptance test feature locally without having to bother setting up their git clone of the ownCloud classic core repo to be served by Apache. A command like this will run a test scenario:

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

Prior to this change, this run.sh script would start 2 PHP dev server processes. That was to try to simulate having a federated environment. Actually that is usually not effective, because the 2nd PHP dev server is serving from the same git repo as the 1st server. So it ends up with the same config, data, database etc.

So for now, I have change this so that the federated dev server startup only happens if TEST_WITH_FED_PHPDEVSERVER is set to "true".

Probably I will remove this completely in the future, and write different documentation telling how to configure and start a completely separate git clone of the core repo as the 2nd server.

@phil-davis

Copy link
Copy Markdown
Contributor Author

https://github.com/owncloud/core/actions/runs/28230268934/job/83632128247?pr=41655

The result of the remote_occ cURL command '--no-warnings app:enable' to 'http://localhost/server/ocs/v2.php/apps/testing/api/v1/occ notifications' with auth 'admin:admin' was not valid XML
--------

--------

When resetting the app state after running the tests, the name of the app is ending up in the wrong place in the command. It should be at the end.

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.

1 participant