From 88b77f91fbc0d3bfb7de6ccd15dc2f30b1daf040 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Mon, 12 Jun 2017 21:23:53 +0200 Subject: [PATCH] Fix CI --- .gitlab-ci.yml | 85 +++++++++++++++++++++++++++++++++++----------- lib/Lutim.pm | 2 +- t/postgresql2.conf | 2 +- t/postgresql3.conf | 2 +- t/sqlite1.conf | 2 +- t/sqlite2.conf | 2 +- t/sqlite3.conf | 2 +- 7 files changed, 72 insertions(+), 25 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e8d6c4f..4d0d8f7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,36 @@ stages: before_script: - carton install - rm -f *db -sqlite: +sqlite1: + stage: sqlite + cache: + key: "$CI_BUILD_REF_NAME" + untracked: true + paths: + - local + script: + - make podcheck + - MOJO_CONFIG=t/sqlite1.conf make test-sqlite + - MOJO_CONFIG=t/sqlite1.conf make watch + - MOJO_CONFIG=t/sqlite1.conf make cleanbdd + - MOJO_CONFIG=t/sqlite1.conf make cleanfiles + - MOJO_CONFIG=t/sqlite1.conf make stats +sqlite2: + stage: sqlite + cache: + key: "$CI_BUILD_REF_NAME" + untracked: true + paths: + - local + script: + - make podcheck + - MOJO_CONFIG=t/sqlite2.conf make minion & + - MOJO_CONFIG=t/sqlite2.conf make test-sqlite + - MOJO_CONFIG=t/sqlite2.conf make watch + - MOJO_CONFIG=t/sqlite2.conf make cleanbdd + - MOJO_CONFIG=t/sqlite2.conf make cleanfiles + - MOJO_CONFIG=t/sqlite2.conf make stats +sqlite3: stage: sqlite cache: key: "$CI_BUILD_REF_NAME" @@ -18,18 +47,8 @@ sqlite: - sleep 10 - service postgresql status - make create-pg-test-db - - MOJO_CONFIG=t/sqlite2.conf make minion & - MOJO_CONFIG=t/sqlite3.conf make minion & - - MOJO_CONFIG=t/sqlite1.conf make test-sqlite - - MOJO_CONFIG=t/sqlite1.conf make watch - - MOJO_CONFIG=t/sqlite1.conf make cleanbdd - - MOJO_CONFIG=t/sqlite1.conf make cleanfiles - - MOJO_CONFIG=t/sqlite1.conf make stats - - MOJO_CONFIG=t/sqlite2.conf make test-sqlite - - MOJO_CONFIG=t/sqlite2.conf make watch - - MOJO_CONFIG=t/sqlite2.conf make cleanbdd - - MOJO_CONFIG=t/sqlite2.conf make cleanfiles - - MOJO_CONFIG=t/sqlite2.conf make stats + - sleep 3 - MOJO_CONFIG=t/sqlite3.conf make test-sqlite - MOJO_CONFIG=t/sqlite3.conf make watch - MOJO_CONFIG=t/sqlite3.conf make cleanbdd @@ -38,7 +57,25 @@ sqlite: tags: - Debian - Jessie -postgresql: +postgresql1: + stage: postgresql + cache: + key: "$CI_BUILD_REF_NAME" + untracked: true + paths: + - local + script: + - make podcheck + - service postgresql restart + - sleep 10 + - service postgresql status + - make create-pg-test-db + - MOJO_CONFIG=t/postgresql1.conf make test-pg + - MOJO_CONFIG=t/postgresql1.conf make watch + - MOJO_CONFIG=t/postgresql1.conf make cleanbdd + - MOJO_CONFIG=t/postgresql1.conf make cleanfiles + - MOJO_CONFIG=t/postgresql1.conf make stats +postgresql2: stage: postgresql cache: key: "$CI_BUILD_REF_NAME" @@ -52,17 +89,27 @@ postgresql: - service postgresql status - make create-pg-test-db - MOJO_CONFIG=t/postgresql2.conf make minion & - - MOJO_CONFIG=t/postgresql3.conf make minion & - - MOJO_CONFIG=t/postgresql1.conf make test-pg - - MOJO_CONFIG=t/postgresql1.conf make watch - - MOJO_CONFIG=t/postgresql1.conf make cleanbdd - - MOJO_CONFIG=t/postgresql1.conf make cleanfiles - - MOJO_CONFIG=t/postgresql1.conf make stats + - sleep 3 - MOJO_CONFIG=t/postgresql2.conf make test-pg - MOJO_CONFIG=t/postgresql2.conf make watch - MOJO_CONFIG=t/postgresql2.conf make cleanbdd - MOJO_CONFIG=t/postgresql2.conf make cleanfiles - MOJO_CONFIG=t/postgresql2.conf make stats +postgresql3: + stage: postgresql + cache: + key: "$CI_BUILD_REF_NAME" + untracked: true + paths: + - local + script: + - make podcheck + - service postgresql restart + - sleep 10 + - service postgresql status + - make create-pg-test-db + - MOJO_CONFIG=t/postgresql3.conf make minion & + - sleep 3 - MOJO_CONFIG=t/postgresql3.conf make test-pg - MOJO_CONFIG=t/postgresql3.conf make watch - MOJO_CONFIG=t/postgresql3.conf make cleanbdd diff --git a/lib/Lutim.pm b/lib/Lutim.pm index c36145b..e30b070 100644 --- a/lib/Lutim.pm +++ b/lib/Lutim.pm @@ -80,7 +80,7 @@ sub startup { # Minion if ($config->{minion}->{enabled}) { - $self->config('minion')->{dbtype} = 'sqlite' unless defined $config->{minion}->{dbtype}; + $self->config->{minion}->{dbtype} = 'sqlite' unless defined $config->{minion}->{dbtype}; if ($config->{minion}->{dbtype} eq 'sqlite') { $self->config('minion')->{db_path} = 'minion.db' unless defined $config->{minion}->{db_path}; $self->plugin('Minion' => { SQLite => 'sqlite:'.$config->{minion}->{db_path} }); diff --git a/t/postgresql2.conf b/t/postgresql2.conf index b44fb5a..452e6ca 100644 --- a/t/postgresql2.conf +++ b/t/postgresql2.conf @@ -118,7 +118,7 @@ # you can define it relative to lutim directory or set an absolute path # remember that it has to be in a directory writable by Lutim user # optional, default is lutim.db - #db_path => 'lutim.db', + db_path => 'testpg2.db', # PostgreSQL ONLY - only used if dbtype is set to postgresql # these are the credentials to access the PostgreSQL database diff --git a/t/postgresql3.conf b/t/postgresql3.conf index 1a8d816..a8a5810 100644 --- a/t/postgresql3.conf +++ b/t/postgresql3.conf @@ -118,7 +118,7 @@ # you can define it relative to lutim directory or set an absolute path # remember that it has to be in a directory writable by Lutim user # optional, default is lutim.db - #db_path => 'lutim.db', + db_path => 'testpg3.db', # PostgreSQL ONLY - only used if dbtype is set to postgresql # these are the credentials to access the PostgreSQL database diff --git a/t/sqlite1.conf b/t/sqlite1.conf index 5f2b023..c4cae54 100644 --- a/t/sqlite1.conf +++ b/t/sqlite1.conf @@ -118,7 +118,7 @@ # you can define it relative to lutim directory or set an absolute path # remember that it has to be in a directory writable by Lutim user # optional, default is lutim.db - db_path => 'test1.db', + db_path => 'testdqlite1.db', # PostgreSQL ONLY - only used if dbtype is set to postgresql # these are the credentials to access the PostgreSQL database diff --git a/t/sqlite2.conf b/t/sqlite2.conf index 7071dff..e4c6a12 100644 --- a/t/sqlite2.conf +++ b/t/sqlite2.conf @@ -118,7 +118,7 @@ # you can define it relative to lutim directory or set an absolute path # remember that it has to be in a directory writable by Lutim user # optional, default is lutim.db - db_path => 'test2.db', + db_path => 'testsqlite2.db', # PostgreSQL ONLY - only used if dbtype is set to postgresql # these are the credentials to access the PostgreSQL database diff --git a/t/sqlite3.conf b/t/sqlite3.conf index 3230469..dea2e0b 100644 --- a/t/sqlite3.conf +++ b/t/sqlite3.conf @@ -118,7 +118,7 @@ # you can define it relative to lutim directory or set an absolute path # remember that it has to be in a directory writable by Lutim user # optional, default is lutim.db - db_path => 'test.db', + db_path => 'testsqlite3.db', # PostgreSQL ONLY - only used if dbtype is set to postgresql # these are the credentials to access the PostgreSQL database