Skip to content

Commit

Permalink
Add Baikal to CI setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mstilkerich committed Jan 3, 2022
1 parent c584925 commit 865234b
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .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');
38 changes: 38 additions & 0 deletions .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

39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -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
22 changes: 9 additions & 13 deletions tests/interop/AccountData.php.dist
Expand Up @@ -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" => "",
Expand Down Expand Up @@ -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/",
Expand Down

0 comments on commit 865234b

Please sign in to comment.