From 8c1448e0953aed0951cd948aba3c8e5cf7d96379 Mon Sep 17 00:00:00 2001 From: Denis Feklushkin Date: Wed, 7 Dec 2022 14:13:27 +0300 Subject: [PATCH 1/5] DUB: Integration test moved to subpackage --- dub.sdl | 7 +++++-- source/vibe/db/postgresql/test.d => tests/it.d | 4 +--- 2 files changed, 6 insertions(+), 5 deletions(-) rename source/vibe/db/postgresql/test.d => tests/it.d (86%) diff --git a/dub.sdl b/dub.sdl index 911ab73..254cb4f 100644 --- a/dub.sdl +++ b/dub.sdl @@ -5,17 +5,20 @@ license "MIT" copyright "Copyright © 2016" targetType "sourceLibrary" -dependency "dpq2" version="~>1.1.1" +dependency "dpq2" version="~>1.1.3" dependency "vibe-core" version=">=1.9.3 <2.0.0-0" configuration "release_app" { buildType "release" } -configuration "integration_test" { +subPackage { + name "integration_tests" + sourcePaths "tests" targetType "executable" buildType "unittest" versions "IntegrationTest" + dependency "vibe-d-postgresql" version="*" } subPackage { diff --git a/source/vibe/db/postgresql/test.d b/tests/it.d similarity index 86% rename from source/vibe/db/postgresql/test.d rename to tests/it.d index f6cc3af..c131ffb 100644 --- a/source/vibe/db/postgresql/test.d +++ b/tests/it.d @@ -1,8 +1,6 @@ -module vibe.db.postgresql.test; // TODO: rename to run_tests or something - import db = vibe.db.postgresql; -version(IntegrationTest) +version(all) { import std.getopt; import std.experimental.logger; From 41930048d515eeaf9db6226b217c722bb23c278f Mon Sep 17 00:00:00 2001 From: Denis Feklushkin Date: Wed, 7 Dec 2022 14:28:54 +0300 Subject: [PATCH 2/5] CI: run :integration_test instead of unavailable config --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 321adf7..608a6ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,8 +110,8 @@ jobs: - name: Build / test if: matrix.build != 'unittest-cov' run: | - dub test --build=$BUILD - dub run --config=integration_test --build=$BUILD -- --conninfo="$CONN_STRING" --debug=true + dub test :integration_tests --build=$BUILD + dub run :integration_tests --build=$BUILD -- --conninfo="$CONN_STRING" --debug=true shell: bash - name: Build / test with coverage if: matrix.build == 'unittest-cov' From 10c6f24acb930a508c90189564531b103a14ebfe Mon Sep 17 00:00:00 2001 From: Denis Feklushkin Date: Wed, 7 Dec 2022 14:35:28 +0300 Subject: [PATCH 3/5] tests fix --- tests/{it.d => main.d} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/{it.d => main.d} (100%) diff --git a/tests/it.d b/tests/main.d similarity index 100% rename from tests/it.d rename to tests/main.d From 27d572d1e8aad0e80f4421a1b571c57c7d2ef8db Mon Sep 17 00:00:00 2001 From: Denis Feklushkin Date: Wed, 7 Dec 2022 14:48:12 +0300 Subject: [PATCH 4/5] logging fix --- tests/main.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/main.d b/tests/main.d index c131ffb..ddc3912 100644 --- a/tests/main.d +++ b/tests/main.d @@ -21,7 +21,7 @@ version(all) { readOpts(args); if(!debugEnabled) - sharedLog.logLevel = LogLevel.warning; + globalLogLevel = LogLevel.warning; db.__integration_test(connString); @@ -30,6 +30,6 @@ version(all) shared static this() { - sharedLog.logLevel = LogLevel.trace; + globalLogLevel = LogLevel.trace; } } From f76cd549f3e64a8603376977fad0b8060e2fcd34 Mon Sep 17 00:00:00 2001 From: Denis Feklushkin Date: Wed, 7 Dec 2022 14:53:32 +0300 Subject: [PATCH 5/5] CI fix --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 608a6ab..fdc58c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,14 +110,14 @@ jobs: - name: Build / test if: matrix.build != 'unittest-cov' run: | - dub test :integration_tests --build=$BUILD + dub test --build=$BUILD dub run :integration_tests --build=$BUILD -- --conninfo="$CONN_STRING" --debug=true shell: bash - name: Build / test with coverage if: matrix.build == 'unittest-cov' run: | dub test --build=$BUILD - dub run --config=integration_test --build=$BUILD -- --conninfo="$CONN_STRING" --debug=true + dub run :integration_tests --build=$BUILD -- --conninfo="$CONN_STRING" --debug=true dub build :example --build=release dub run doveralls shell: bash