Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drone: Run federated server on database other than sqlite #36725

Merged
merged 2 commits into from
Jan 9, 2020

Conversation

dpakach
Copy link
Contributor

@dpakach dpakach commented Jan 9, 2020

Description

Run federated server in mysql database not sqlite.

Related Issue

Related Issue owncloud/QA#636

Motivation and Context

Currently we run the main test server in different databases including mysql, psql etc but the federated server is always run on the sqlite database. As sqlite is not very reliable database, we may run into different issues while running tests. So the database of the federated server is changed to databases other than sqlite.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@codecov
Copy link

codecov bot commented Jan 9, 2020

Codecov Report

Merging #36725 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #36725   +/-   ##
=========================================
  Coverage     64.68%   64.68%           
  Complexity    19118    19118           
=========================================
  Files          1269     1269           
  Lines         74775    74775           
  Branches       1320     1320           
=========================================
  Hits          48369    48369           
  Misses        26018    26018           
  Partials        388      388
Flag Coverage Δ Complexity Δ
#javascript 54.12% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 65.85% <ø> (+0.17%) 19118 <ø> (ø) ⬇️
Impacted Files Coverage Δ Complexity Δ
apps/files_external/lib/Lib/Storage/SFTP.php 57.48% <0%> (ø) 0% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47d1470...e912cf0. Read the comment docs.

.drone.starlark Show resolved Hide resolved
.drone.starlark Outdated Show resolved Hide resolved
@@ -468,137 +468,137 @@ def codestyle():
return pipelines

def changelog():
pipelines = []
Copy link
Contributor

Choose a reason for hiding this comment

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

The spaces-tabs thing happened when the changelog() step was added.
The diffs here get the indent to be consistent with the rest of the file. We may as well make these changes (although it makes a more messy diff)

Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

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

LGTM (if CI passes)

@phil-davis
Copy link
Contributor

Install of federated server looks good: https://drone.owncloud.com/owncloud/core/22537/63/11

installing owncloud
$ wait-for-it -t 600 mariadb-federated:3306
services are ready!
/drone/federated /drone/src
$ php ./occ maintenance:install -vvv         --database=mysql         --database-name=owncloud-federated         --database-table-prefix=oc_         --admin-user=admin         --admin-pass=admin         --data-dir=/drone/federated/data --database-host=mariadb-federated                    --database-user=owncloud                    --database-pass=owncloud
ownCloud was successfully installed

@phil-davis
Copy link
Contributor

https://drone.owncloud.com/owncloud/core/22537/98/14

{"reqId":"MNjuD6efk4bQzUZUI28E","level":3,"time":"2020-01-09T09:04:25+00:00","remoteAddr":"172.19.0.5","user":"--","app":"federatefilesharing","method":"POST","url":"\/apps\/federatedfilesharing\/shares","message":"server can not add remote share, An exception occurred while executing 'INSERT INTO `oc_share_external` (`remote`,`share_token`,`password`,`name`,`owner`,`user`,`mountpoint`,`mountpoint_hash`,`accepted`,`remote_id`) SELECT ?,?,?,?,?,?,?,?,?,? FROM `oc_share_external` WHERE `user` = ? AND `mountpoint_hash` = ? HAVING COUNT(*) = 0' with params [\"https:\\\/\\\/server\", \"o0lYJCHDZxac8Is\", \"\", \"\\\/averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt\", \"user1\", \"user1\", \"{{TemporaryMountPointName#\\\/averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt}}\", \"4179477e980fad7ebbfdfebc56ca24c8\", 0, \"14\", \"user1\", \"4179477e980fad7ebbfdfebc56ca24c8\"]:\n\nSQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'name' at row 1"}

strange - I guess mysql/mariadb has a max length constraint, but sqlite did not.

The way the test file has been named, it reads like it is not expected to work. But the test scenario expects this to work.

https://drone.owncloud.com/owncloud/core/22537/98/18

  Scenario: test sharing long file names with federation share                                                                                                                 # /drone/src/tests/acceptance/features/webUISharingExternal/federationSharing.feature:310
    When user "user1" moves file "/lorem.txt" to "/averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt" using the WebDAV API                               # FeatureContext::userMovesFileUsingTheAPI()
    And the user has reloaded the current page of the webUI                                                                                                                    # WebUIGeneralContext::theUserReloadsTheCurrentPageOfTheWebUI()
    And the user shares file "averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt" with remote user "user1@%remote_server_without_scheme%" using the webUI # WebUISharingContext::theUserSharesFileFolderWithUserUsingTheWebUI()
    And user "user1" re-logs in to "%remote_server%" using the webUI                                                                                                           # WebUILoginContext::theUserRelogsInToUsingTheWebUI()
    And the user accepts the offered remote shares using the webUI                                                                                                             # WebUISharingContext::theUserAcceptsTheOfferedRemoteShares()
    And using server "REMOTE"                                                                                                                                                  # FeatureContext::usingServer()
    Then as "user1" file "/averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt" should exist                                                               # FeatureContext::asFileOrFolderShouldExist()
      file '/averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt' expected to exist but not found
      Failed asserting that false is true.
SCENARIO RESULT: (fail)

--- Failed scenarios:

    /drone/src/tests/acceptance/features/webUISharingExternal/federationSharing.feature:310

@phil-davis
Copy link
Contributor

phil-davis commented Jan 9, 2020

@dpakach I raised issue #36730
I suggest to adjust the scenario so it passes (demonstrates the current behaviour) and tag it issue-36370

@haribhandari07
Copy link
Contributor

LGTM

@dpakach dpakach merged commit ded9449 into master Jan 9, 2020
@delete-merged-branch delete-merged-branch bot deleted the federated-mysql branch January 9, 2020 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants