owncloud / data_exporter

Export/Import for ownCloud user data
GNU General Public License v2.0
7 stars 5 forks source link

Why is trash-bin test only failing in CI? #138

Closed IljaN closed 4 years ago

IljaN commented 4 years ago

We have an acceptance test (trashbin) which is only fails in drone https://drone.owncloud.com/owncloud/data_exporter/868/22/10

chmod -R 777 apps/data_exporter/tests/acceptance/data/trashbinExport fixes the problem. This is the folder with the test-export used in the acceaptance-tests.

Tried different drone.ymls to no avail. When testing manually the feature works as expected. Local makefile test also passes.

phil-davis commented 4 years ago

The files for the system-under-test have to have access for the Apache web-server user www-data The occ commands happen by sending a request to the testing app, which runs the occ command in the context of the system-under-test. That is all good.

But in https://github.com/owncloud/data_exporter/pull/126/files#diff-d974aa2ef14af060f771dc54407894e2 at line 210 the file_get_contents("$importPath/user.json") is not going to work from the acceptance test runner - the file is in the "backend" of the system-under-test.

The test runner is going to already have a "local" copy of all the test code, so that will include the tests/acceptance/data/trashbinExport folder. user.json should be able to be read from there.

It will need a bit of path calculation to be sure to find it both locally and in drone. I can have a look at the details tomorrow morning.

phil-davis commented 4 years ago

Fixed by #145