Skip to content

Commit

Permalink
Merge pull request #51 from denizzzka/integration_test_as_subpackage
Browse files Browse the repository at this point in the history
DUB: Integration test moved to subpackage
  • Loading branch information
denizzzka authored Dec 7, 2022
2 parents a600a5d + f76cd54 commit 018c9f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ jobs:
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
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
Expand Down
7 changes: 5 additions & 2 deletions dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 3 additions & 5 deletions source/vibe/db/postgresql/test.d → tests/main.d
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -23,7 +21,7 @@ version(IntegrationTest)
{
readOpts(args);
if(!debugEnabled)
sharedLog.logLevel = LogLevel.warning;
globalLogLevel = LogLevel.warning;

db.__integration_test(connString);

Expand All @@ -32,6 +30,6 @@ version(IntegrationTest)

shared static this()
{
sharedLog.logLevel = LogLevel.trace;
globalLogLevel = LogLevel.trace;
}
}

0 comments on commit 018c9f0

Please sign in to comment.