forked from simendsjo/mysqln
-
Notifications
You must be signed in to change notification settings - Fork 28
Split testing into its own project #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c0314bf
Try to split out tests and test dependencies into separate projects
schveiguy 619332e
Integration tests now runnable
schveiguy 592e218
Remove extraneous main function and extra imports that are no longer
schveiguy 51aa526
these shouldn't have been added.
schveiguy d498e25
Add phobos tests. Work around dub bug that doesn't allow dependencies
schveiguy 4723082
Remove ubuntu "extra packages", update commented-out mysql-8 tests to
schveiguy 466fc39
Try only building on PRs and pushes to master. Otherwise, github wastes
schveiguy a148f58
Remove obsolete test runner. Update README to reflect new ways of
schveiguy 48b0193
run library tests in integration test applications. Update README to
schveiguy 2411644
Add docker config and readme on how to use it.
schveiguy 6efb6e3
Fix spacing. Run test utility in integration tests.
schveiguy 6e7ccda
Use target type of sourceLibrary to help run unittest configuration.
schveiguy ef97eb1
Add workflow_dispatch to workflows to allow manual triggering of builds
schveiguy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,22 @@ | ||
name "mysql-native" | ||
description "A native MySQL driver implementation based on Steve Teale's original" | ||
license "BSL-1.0" | ||
copyright "Copyright (c) 2011-2019 Steve Teale, James W. Oliphant, Simen Endsjø, Sönke Ludwig, Sergey Shamov, and Nick Sabalausky" | ||
authors "Steve Teale" "James W. Oliphant" "Simen Endsjø" "Sönke Ludwig" "Sergey Shamov" "Nick Sabalausky" | ||
copyright "Copyright (c) 2011-2021 Steve Teale, James W. Oliphant, Simen Endsjø, Sönke Ludwig, Sergey Shamov, Nick Sabalausky, and Steven Schveighoffer" | ||
authors "Steve Teale" "James W. Oliphant" "Simen Endsjø" "Sönke Ludwig" "Sergey Shamov" "Nick Sabalausky" "Steven Schveighoffer" | ||
|
||
dependency "vibe-core" version="~>1.16.0" optional=true | ||
|
||
toolchainRequirements frontend=">=2.068" | ||
|
||
sourcePaths "source/" | ||
importPaths "source/" | ||
|
||
configuration "application" { | ||
targetType "executable" | ||
versions "VibeCustomMain" | ||
} | ||
subPackage "./integration-tests" | ||
subPackage "./integration-tests-vibe" | ||
subPackage "./integration-tests-phobos" | ||
subPackage "./testconn" | ||
|
||
configuration "library" { | ||
targetType "library" | ||
excludedSourceFiles "source/app.d" | ||
} | ||
|
||
// Do not use this. Use "run_tests" insetad. | ||
configuration "unittest" { | ||
excludedSourceFiles "source/app.d" | ||
preBuildCommands \ | ||
"echo \"ERROR: Don't use 'dub test' to test mysql-native. Use 'run_tests' instead.\"" \ | ||
"echo Bailing..." \ | ||
"mkdir" // Generate error to halt build | ||
} | ||
|
||
// Run with: dub test -c unittest-vibe | ||
configuration "unittest-vibe" { | ||
targetType "executable" | ||
targetPath "bin/" | ||
targetName "mysqln-tests-vibe" | ||
excludedSourceFiles "source/app.d" | ||
|
||
dependency "vibe-core" version="~>1.16.0" optional=false | ||
|
||
// mainSourceFile "source/mysql/package.d" | ||
debugVersions "MYSQLN_TESTS" | ||
} | ||
|
||
// Run with: dub run -c unittest-vibe-ut -- -t | ||
configuration "unittest-vibe-ut" { | ||
targetType "executable" | ||
targetPath "bin/" | ||
targetName "mysqln-tests-vibe" | ||
excludedSourceFiles "source/app.d" | ||
sourceFiles "bin/ut.d" | ||
importPaths "bin/" | ||
buildOptions "unittests" | ||
|
||
dependency "vibe-core" version="~>1.16.0" optional=false | ||
|
||
dependency "unit-threaded" version="~>1.0.15" | ||
|
||
debugVersions "MYSQLN_TESTS" | ||
versions "MYSQLN_TESTS_NO_MAIN" | ||
versions "unitUnthreaded" | ||
|
||
preBuildCommands "dub run unit-threaded -c gen_ut_main -- -f bin/ut.d" | ||
targetType "sourceLibrary" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name "integration-tests-phobos" | ||
description "Phobos tests for mysql-native" | ||
license "BSL-1.0" | ||
copyright "Copyright (c) 2011-2021 Steve Teale, James W. Oliphant, Simen Endsjø, Sönke Ludwig, Sergey Shamov, Nick Sabalausky, and Steven Schveighoffer" | ||
authors "Steve Teale" "James W. Oliphant" "Simen Endsjø" "Sönke Ludwig" "Sergey Shamov" "Nick Sabalausky" "Steven Schveighoffer" | ||
|
||
dependency "mysql-native:integration-tests" path="../" | ||
targetType "executable" |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name "integration-tests-vibe" | ||
description "Vibe tests for mysql-native" | ||
license "BSL-1.0" | ||
copyright "Copyright (c) 2011-2021 Steve Teale, James W. Oliphant, Simen Endsjø, Sönke Ludwig, Sergey Shamov, Nick Sabalausky, and Steven Schveighoffer" | ||
authors "Steve Teale" "James W. Oliphant" "Simen Endsjø" "Sönke Ludwig" "Sergey Shamov" "Nick Sabalausky" "Steven Schveighoffer" | ||
|
||
dependency "mysql-native:integration-tests" path="../" | ||
dependency "vibe-core" version="~>1.16.0" | ||
targetType "executable" |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Integration Tests for MySQL Native | ||
================================== | ||
|
||
This sub-project is intended for proving the functionality of the project against a database instance. | ||
|
||
See the instructions in the [main README](../README.md#developers---how-to-run-the-test-suite) on how to use this subpackage. | ||
|
||
## Docker image | ||
|
||
A docker-compose.yml is supplied for convenience when testing locally. It's preconfigured to use the same username/password that is used by default. | ||
|
||
To run tests on your machine, presuming docker is installed, simply run: | ||
|
||
``` | ||
$ docker-compose up --detach | ||
``` | ||
|
||
Once you are finished, tear down the docker instance | ||
|
||
``` | ||
$ docker-compose down | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: '3.7' | ||
services: | ||
mysql: | ||
# Don't use latest (MySQL Server 8.0) as we cannot currently support it | ||
image: mysql:5.7 | ||
restart: always | ||
ports: ['3306:3306'] | ||
environment: | ||
- MYSQL_ALLOW_EMPTY_PASSWORD=yes | ||
- MYSQL_DATABASE=mysqln_testdb | ||
- MYSQL_USER=mysqln_test | ||
- MYSQL_PASSWORD=pass123 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.