Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
louiz’
biboumi
Commits
24dc05dd
Commit
24dc05dd
authored
Dec 03, 2017
by
louiz’
Browse files
Run some of the ci tests against a postgresql docker container
parent
6dc49f32
Changes
5
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
24dc05dd
...
...
@@ -17,6 +17,7 @@ variables:
SYSTEMD
:
"
-DWITH_SYSTEMD=1"
LIBIDN
:
"
-DWITH_LIBIDN=1"
SQLITE3
:
"
-DWITH_SQLITE3=1"
POSTGRESQL
:
"
-WITH_POSTGRESQL=1"
#
## Build jobs
...
...
@@ -27,10 +28,10 @@ variables:
tags
:
-
docker
script
:
-
"
echo
Running
cmake
with
the
following
parameters:
-DCMAKE_CXX_COMPILER=${COMPILER}
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
${BOTAN}
${UDNS}
${SYSTEMD}
${LIBIDN}
${SQLITE3}"
-
"
echo
Running
cmake
with
the
following
parameters:
-DCMAKE_CXX_COMPILER=${COMPILER}
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
${BOTAN}
${UDNS}
${SYSTEMD}
${LIBIDN}
${SQLITE3}
${POSTGRESQL}
"
-
mkdir build/
-
cd build/
-
cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${UDNS} ${SYSTEMD} ${LIBIDN} ${SQLITE3}
-
cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${UDNS} ${SYSTEMD} ${LIBIDN} ${SQLITE3}
${POSTGRESQL}
-
make everything -j$(nproc || echo 1)
-
make coverage_check -j$(nproc || echo 1)
artifacts
:
...
...
@@ -64,21 +65,27 @@ build:alpine:
build:1:
variables
:
BOTAN
:
"
-DWITHOUT_BOTAN=1"
POSTGRESQL
:
"
-DWITHOUT_POSTGRESQL=1"
<<
:
*fedora_build
build:2:
variables
:
UDNS
:
"
-DWITHOUT_UDNS=1"
POSTGRESQL
:
"
-DWITHOUT_POSTGRESQL=1"
<<
:
*fedora_build
build:3:
variables
:
SQLITE3
:
"
-DWITHOUT_SQLITE3=1"
TEST_POSTGRES_URI
:
"
postgres@postgres/postgres"
services
:
-
postgres:latest
<<
:
*fedora_build
build:4:
variables
:
SQLITE3
:
"
-DWITHOUT_SQLITE3=1"
POSTGRESQL
:
"
-DWITHOUT_POSTGRESQL=1"
BOTAN
:
"
-DWITHOUT_BOTAN=1"
LIBIDN
:
"
-DWITHOUT_LIBIDN=1"
<<
:
*fedora_build
...
...
@@ -87,17 +94,27 @@ build:5:
variables
:
SQLITE3
:
"
-DWITHOUT_SQLITE3=1"
UDNS
:
"
-DWITHOUT_UDNS=1"
TEST_POSTGRES_URI
:
"
postgres@postgres/postgres"
services
:
-
postgres:latest
<<
:
*fedora_build
build:6:
variables
:
BOTAN
:
"
-DWITHOUT_BOTAN=1"
UDNS
:
"
-DWITHOUT_UDNS=1"
POSTGRESQL
:
"
-DWITHOUT_POSTGRESQL=1"
<<
:
*fedora_build
build:7:
variables
:
UDNS
:
"
-DWITHOUT_UDNS=1"
POSTGRESQL
:
"
-DWITHOUT_POSTGRESQL=1"
<<
:
*fedora_build
build:8:
variables
:
POSTGRESQL
:
"
-DWITHOUT_POSTGRESQL=1"
<<
:
*fedora_build
...
...
CMakeLists.txt
View file @
24dc05dd
...
...
@@ -14,7 +14,7 @@ endif()
#
## Find optional instrumentation libraries that will be used in debug only
#
find_library
(
LIBASAN NAMES asan libasan.so.3 libasan.so.2 libasan.so.1
)
find_library
(
LIBASAN NAMES asan
libasan.so.4
libasan.so.3 libasan.so.2 libasan.so.1
)
find_library
(
LIBUBSAN NAMES ubsan libubsan.so.0
)
#
...
...
src/bridge/bridge.cpp
View file @
24dc05dd
...
...
@@ -1031,6 +1031,7 @@ void Bridge::send_room_history(const std::string& hostname, std::string chan_nam
(
void
)
hostname
;
(
void
)
chan_name
;
(
void
)
resource
;
(
void
)
history_limit
;
#endif
}
...
...
src/xmpp/biboumi_component.cpp
View file @
24dc05dd
...
...
@@ -1080,6 +1080,9 @@ void BiboumiComponent::on_irc_client_connected(const std::string& irc_hostname,
const
auto
local_jid
=
irc_hostname
+
"@"
+
this
->
served_hostname
;
if
(
Database
::
has_roster_item
(
local_jid
,
jid
))
this
->
send_presence_to_contact
(
local_jid
,
jid
,
""
);
#else
(
void
)
irc_hostname
;
(
void
)
jid
;
#endif
}
...
...
@@ -1089,6 +1092,9 @@ void BiboumiComponent::on_irc_client_disconnected(const std::string& irc_hostnam
const
auto
local_jid
=
irc_hostname
+
"@"
+
this
->
served_hostname
;
if
(
Database
::
has_roster_item
(
local_jid
,
jid
))
this
->
send_presence_to_contact
(
irc_hostname
+
"@"
+
this
->
served_hostname
,
jid
,
"unavailable"
);
#else
(
void
)
irc_hostname
;
(
void
)
jid
;
#endif
}
...
...
tests/database.cpp
View file @
24dc05dd
#include
"catch.hpp"
#include
<biboumi.h>
#ifdef USE_DATABASE
#include
<cstdlib>
#include
<database/database.hpp>
#include
<config/config.hpp>
TEST_CASE
(
"Database"
)
{
#ifdef USE_DATABASE
// Database::open("postgresql://test");
#ifdef PQ_FOUND
std
::
string
postgresql_uri
{
"postgresql://"
};
const
char
*
env_value
=
::
getenv
(
"TEST_POSTGRES_URI"
);
if
(
env_value
!=
nullptr
)
postgresql_uri
+=
env_value
;
else
postgresql_uri
+=
"/test"
;
Database
::
open
(
postgresql_uri
);
#else
Database
::
open
(
":memory:"
);
#endif
Database
::
raw_exec
(
"DELETE FROM "
+
Database
::
irc_server_options
.
get_name
());
Database
::
raw_exec
(
"DELETE FROM "
+
Database
::
irc_channel_options
.
get_name
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment