From 865234bf3797308fb648d0cab43c01b5a09821ee Mon Sep 17 00:00:00 2001 From: Michael Stilkerich Date: Mon, 3 Jan 2022 17:25:54 +0100 Subject: [PATCH] Add Baikal to CI setup --- .github/configs/baikal/initdb.sql | 5 ++++ .github/scripts/deployBaikal.sh | 38 +++++++++++++++++++++++++++++ .github/workflows/ci.yml | 39 ++++++++++++++++++++++++++++++ tests/interop/AccountData.php.dist | 22 +++++++---------- 4 files changed, 91 insertions(+), 13 deletions(-) create mode 100644 .github/configs/baikal/initdb.sql create mode 100755 .github/scripts/deployBaikal.sh diff --git a/.github/configs/baikal/initdb.sql b/.github/configs/baikal/initdb.sql new file mode 100644 index 0000000..b6138b4 --- /dev/null +++ b/.github/configs/baikal/initdb.sql @@ -0,0 +1,5 @@ +INSERT INTO addressbooks (id, principaluri, displayname, uri, description, synctoken) VALUES(1,'principals/citest','Default Address Book','default','Default Address Book for citest',1); +INSERT INTO calendars (id,synctoken,components) VALUES(1,1,'VEVENT,VTODO'); +INSERT INTO calendarinstances (id,calendarid,principaluri,displayname,uri,description,calendarorder,calendarcolor,timezone) VALUES(1,1,'principals/citest','Default calendar','default','Default calendar',0,'','Europe/Berlin'); +INSERT INTO principals (id,uri,email,displayname) VALUES(1,'principals/citest','citest@example.com','citest'); +INSERT INTO users (id,username,digesta1) VALUES(1,'citest','583d4a8e7edca58122952a093ed573d7'); diff --git a/.github/scripts/deployBaikal.sh b/.github/scripts/deployBaikal.sh new file mode 100755 index 0000000..184a198 --- /dev/null +++ b/.github/scripts/deployBaikal.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +set -e + +BAIKALURL=http://localhost:8080 + +# Web Setup +curl -v -X POST \ + -d 'Baikal_Model_Config_Standard::submitted=1' \ + -d 'refreshed=0' \ + -d 'data[timezone]=Europe/Berlin' \ + -d 'witness[timezone]=1' \ + -d 'data[card_enabled]=1' \ + -d 'witness[card_enabled]=1' \ + -d 'witness[cal_enabled]=1' \ + -d 'data[invite_from]=noreply@localhost' \ + -d 'witness[invite_from]=1' \ + -d 'data[dav_auth_type]=Digest' \ + -d 'witness[dav_auth_type]=1' \ + -d 'data[admin_passwordhash]=admin' \ + -d 'witness[admin_passwordhash]=1' \ + -d 'data[admin_passwordhash_confirm]=admin' \ + -d 'witness[admin_passwordhash_confirm]=1' \ + $BAIKALURL/admin/install/ + + +curl -v -X POST \ + -d 'Baikal_Model_Config_Database::submitted=1' \ + -d 'refreshed=0' \ + -d 'data[sqlite_file]=/var/www/baikal/Specific/db/db.sqlite' \ + -d 'witness[sqlite_file]=1' \ + -d 'witness[mysql]=1' \ + $BAIKALURL/admin/install/ + +# Add test user and addressbook to database +docker exec baikal sh -c 'apt-get update && apt-get install -y sqlite3' +cat .github/configs/baikal/initdb.sql | docker exec -i baikal sqlite3 /var/www/baikal/Specific/db/db.sqlite + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index def28f4..3b2578d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -288,3 +288,42 @@ jobs: flags: interop name: Carddavclient Google interoperability test coverage fail_ci_if_error: false + + interop-baikal: + runs-on: ubuntu-20.04 + + env: + XDEBUG_MODE: coverage + CARDDAVCLIENT_INTEROP_SRV: Baikal + + services: + baikal: + image: ckulka/baikal + options: >- + --health-cmd "nc -z localhost 80" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + --name baikal + ports: + - 8088:80 + + steps: + - name: Checkout carddavclient + uses: actions/checkout@v2 + - name: Set up CI environment + uses: ./.github/actions/setup + with: + php-version: '8.0' + - name: Setup Baikal + run: | + .github/scripts/deployBaikal.sh + - name: Run interop tests + run: make tests-interop + - name: Upload interop-baikal test coverage reports to codecov.io + uses: codecov/codecov-action@v1 + with: + file: testreports/interop/clover.xml + flags: interop + name: Carddavclient Baikal interoperability test coverage + fail_ci_if_error: false diff --git a/tests/interop/AccountData.php.dist b/tests/interop/AccountData.php.dist index 0036e1b..50b784b 100644 --- a/tests/interop/AccountData.php.dist +++ b/tests/interop/AccountData.php.dist @@ -73,14 +73,16 @@ final class AccountData "syncAllowExtraChanges" => false, "featureSet" => TestInfrastructureSrv::SRVFEATS_SABRE, ], - /* "Baikal" => [ - "username" => "baikalUser", - "password" => "foobar", - "discoveryUri" => "http://baikal.localhost", + "username" => "citest", + "password" => "citest", + "discoveryUri" => "http://localhost:8080/", "syncAllowExtraChanges" => false, + // as of Baikal 0.8.0, the shipped Sabre/DAV version 4.1.4 still does not contain the fix for this bug + // Bug is fixed in Sabre/DAV 4.1.5 "featureSet" => TestInfrastructureSrv::SRVFEATS_SABRE, ], + /* "BaikalKrb" => [ "username" => "", "password" => "", @@ -137,18 +139,12 @@ final class AccountData "url" => "http://localhost:8080/remote.php/dav/addressbooks/users/admin/contacts/", "displayname" => "Contacts", ], - /* - "Baikal_First" => [ + "Baikal_0" => [ "account" => "Baikal", - "url" => "http://baikal.localhost/dav.php/addressbooks/baikalUser/default/", + "url" => "http://localhost:8080/dav.php/addressbooks/citest/default/", "displayname" => "Default Address Book", ], - "Baikal_Second" => [ - "account" => "Baikal", - "url" => "http://baikal.localhost/dav.php/addressbooks/baikalUser/abook2/", - "displayname" => "Addressbook 2", - "readonly" => true - ], + /* "BaikalKrb_First" => [ "account" => "BaikalKrb", "url" => "http://baikal.example.com/dav.php/addressbooks/baikalUser/default/",