diff --git a/.gitignore b/.gitignore index 21e8bca..1439928 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ themes/default/templates/raw.html.ep themes/default/templates/stats.json.ep tmp/* .zanata-cache/* +cover_db/* diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f08e3fc..8bedcd6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -66,11 +66,11 @@ carton: carton_sqlite: <<: *carton_bdd_definition script: - - carton install --deployment --without=postgresql --without=minion --without=cache + - carton install --deployment --without=postgresql --without=minion --without=cache --without=test carton_postgresql: <<: *carton_bdd_definition script: - - carton install --deployment --without=sqlite --without=minion --without=cache + - carton install --deployment --without=sqlite --without=minion --without=cache --without=test ### SQLite tests ## @@ -78,16 +78,17 @@ carton_postgresql: sqlite1: <<: *sqlite_definition script: - - carton install --deployment --without=postgresql --without=minion --without=cache + - carton install --deployment --without=postgresql --without=minion --without=cache --without=test - 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/sqlite1.conf make cover sqlite2: <<: *sqlite_definition script: - - carton install --deployment --without=postgresql --without=cache + - carton install --deployment --without=postgresql --without=cache --without=test - MOJO_CONFIG=t/sqlite2.conf make minion & - sleep 3 - MOJO_CONFIG=t/sqlite2.conf make test-sqlite @@ -95,13 +96,14 @@ sqlite2: - MOJO_CONFIG=t/sqlite2.conf make cleanbdd - MOJO_CONFIG=t/sqlite2.conf make cleanfiles - MOJO_CONFIG=t/sqlite2.conf make stats + - MOJO_CONFIG=t/sqlite2.conf make cover sqlite3: <<: *sqlite_definition services: - name: postgres:9.6 alias: postgres script: - - carton install --deployment --without=cache + - carton install --deployment --without=cache --without=test - export PGPASSWORD=lutim_pwd; echo 'CREATE DATABASE lutim_minion WITH OWNER lutim;' | psql -h postgres -U lutim lutim_db - MOJO_CONFIG=t/sqlite3.conf make minion & - sleep 3 @@ -110,6 +112,7 @@ sqlite3: - MOJO_CONFIG=t/sqlite3.conf make cleanbdd - MOJO_CONFIG=t/sqlite3.conf make cleanfiles - MOJO_CONFIG=t/sqlite3.conf make stats + - MOJO_CONFIG=t/sqlite3.conf make cover ### PostgreSQL tests ## @@ -117,16 +120,17 @@ sqlite3: postgresql1: <<: *pg_definition script: - - carton install --deployment --without=sqlite --without=minion --without=cache + - carton install --deployment --without=sqlite --without=minion --without=cache --without=test - 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 + - MOJO_CONFIG=t/postgresql1.conf make cover postgresql2: <<: *pg_definition script: - - carton install --deployment --without=cache + - carton install --deployment --without=cache --without=test - MOJO_CONFIG=t/postgresql2.conf make minion & - sleep 3 - MOJO_CONFIG=t/postgresql2.conf make test-pg @@ -134,10 +138,11 @@ postgresql2: - MOJO_CONFIG=t/postgresql2.conf make cleanbdd - MOJO_CONFIG=t/postgresql2.conf make cleanfiles - MOJO_CONFIG=t/postgresql2.conf make stats + - MOJO_CONFIG=t/postgresql2.conf make cover postgresql3: <<: *pg_definition script: - - carton install --deployment --without=sqlite --without=cache + - carton install --deployment --without=sqlite --without=cache --without=test - export PGPASSWORD=lutim_pwd; echo 'CREATE DATABASE lutim_minion WITH OWNER lutim;' | psql -h postgres -U lutim lutim_db - MOJO_CONFIG=t/postgresql3.conf make minion & - sleep 3 @@ -146,3 +151,4 @@ postgresql3: - MOJO_CONFIG=t/postgresql3.conf make cleanbdd - MOJO_CONFIG=t/postgresql3.conf make cleanfiles - MOJO_CONFIG=t/postgresql3.conf make stats + - MOJO_CONFIG=t/postgresql3.conf make cover diff --git a/Makefile b/Makefile index ebde30e..3c8a686 100644 --- a/Makefile +++ b/Makefile @@ -20,11 +20,14 @@ stats-locales: podcheck: podchecker lib/Lutim/DB/Image.pm +cover: + PERL5OPT='-Ilib/' HARNESS_PERL_SWITCHES='-MDevel::Cover' $(CARTON) cover --ignore_re '^local' + test-sqlite: - $(CARTON) $(REAL_LUTIM) test + @PERL5OPT='-Ilib/' HARNESS_PERL_SWITCHES='-MDevel::Cover' $(CARTON) $(REAL_LUTIM) test test-pg: - $(CARTON) $(REAL_LUTIM) test + @PERL5OPT='-Ilib/' HARNESS_PERL_SWITCHES='-MDevel::Cover' $(CARTON) $(REAL_LUTIM) test test: podcheck test-sqlite test-pg diff --git a/cpanfile b/cpanfile index cf40b78..4553738 100644 --- a/cpanfile +++ b/cpanfile @@ -37,3 +37,6 @@ feature 'cache', 'Cache system' => sub { requires 'CHI'; requires 'Data::Serializer'; }; +feature 'test' => sub { + requires 'Devel::Cover'; +}; diff --git a/cpanfile.snapshot b/cpanfile.snapshot index 477b1e7..457a7ec 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -897,6 +897,65 @@ DISTRIBUTIONS perl 5.008004 strict 0 warnings 0 + Devel-Cover-1.29 + pathname: P/PJ/PJCJ/Devel-Cover-1.29.tar.gz + provides: + Devel::Cover 1.29 + Devel::Cover::Annotation::Git 1.29 + Devel::Cover::Annotation::Random 1.29 + Devel::Cover::Annotation::Svk 1.29 + Devel::Cover::Branch 1.29 + Devel::Cover::Collection 1.29 + Devel::Cover::Collection::Template::Provider 1.29 + Devel::Cover::Condition 1.29 + Devel::Cover::Condition_and_2 1.29 + Devel::Cover::Condition_and_3 1.29 + Devel::Cover::Condition_or_2 1.29 + Devel::Cover::Condition_or_3 1.29 + Devel::Cover::Condition_xor_4 1.29 + Devel::Cover::Criterion 1.29 + Devel::Cover::DB 1.29 + Devel::Cover::DB::Criterion 1.29 + Devel::Cover::DB::Digests 1.29 + Devel::Cover::DB::File 1.29 + Devel::Cover::DB::IO 1.29 + Devel::Cover::DB::IO::Base 1.29 + Devel::Cover::DB::IO::JSON 1.29 + Devel::Cover::DB::IO::Sereal 1.29 + Devel::Cover::DB::IO::Storable 1.29 + Devel::Cover::DB::Run 1.29 + Devel::Cover::DB::Structure 1.29 + Devel::Cover::Html_Common 1.29 + Devel::Cover::Op 1.29 + Devel::Cover::Pod 1.29 + Devel::Cover::Report::Compilation 1.29 + Devel::Cover::Report::Html 1.29 + Devel::Cover::Report::Html_basic 1.29 + Devel::Cover::Report::Html_basic::Template::Provider 1.29 + Devel::Cover::Report::Html_minimal 1.29 + Devel::Cover::Report::Html_subtle 1.29 + Devel::Cover::Report::Html_subtle::Template::Provider 1.29 + Devel::Cover::Report::Json 1.29 + Devel::Cover::Report::Sort 1.29 + Devel::Cover::Report::Text 1.29 + Devel::Cover::Report::Text2 1.29 + Devel::Cover::Report::Vim 1.29 + Devel::Cover::Report::Vim::Template::Provider 1.29 + Devel::Cover::Statement 1.29 + Devel::Cover::Subroutine 1.29 + Devel::Cover::Test 1.29 + Devel::Cover::Time 1.29 + Devel::Cover::Truth_Table 1.29 + Devel::Cover::Truth_Table::Row 1.29 + Devel::Cover::Util 1.29 + Devel::Cover::Web 1.29 + requirements: + B::Debug 0 + Digest::MD5 0 + ExtUtils::MakeMaker 0 + HTML::Entities 3.69 + Storable 0 + Test::More 0 Devel-GlobalDestruction-0.14 pathname: H/HA/HAARG/Devel-GlobalDestruction-0.14.tar.gz provides: @@ -1124,6 +1183,27 @@ DISTRIBUTIONS Test::More 0 Test::Warn 0 perl 5.006 + HTML-Parser-3.72 + pathname: G/GA/GAAS/HTML-Parser-3.72.tar.gz + provides: + HTML::Entities 3.69 + HTML::Filter 3.72 + HTML::HeadParser 3.71 + HTML::LinkExtor 3.69 + HTML::Parser 3.72 + HTML::PullParser 3.57 + HTML::TokeParser 3.69 + requirements: + ExtUtils::MakeMaker 0 + HTML::Tagset 3 + XSLoader 0 + perl 5.008 + HTML-Tagset-3.20 + pathname: P/PE/PETDANCE/HTML-Tagset-3.20.tar.gz + provides: + HTML::Tagset 3.20 + requirements: + ExtUtils::MakeMaker 0 HTTP-Lite-2.44 pathname: N/NE/NEILB/HTTP-Lite-2.44.tar.gz provides: