-
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
Conversation
ping @SingingBush |
@@ -97,28 +93,6 @@ Prepared prepareFunction(Connection conn, string name, int numArgs) | |||
return prepare(conn, sql); | |||
} | |||
|
|||
/// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, this unittest was not actually documented. And even if it were, it would have been terrible documentation (using scopedCn
for the connection which is completely internal).
TODO: have to investigate spacing. My editor I used for a lot of this didn't obey the .editorconfig. grrrr..... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are checks for version(DoCoreTests)
are redundant now? There was a bunch of version checks that may not be needed with the way the code is now structured.
There are two files in my branch that I believe should be copied into this pull request (with tweaks):
It should make it trivial for people to check the project out and run the tests with no prior setup (except to have docker) and a readme file specific to the test project means that the readme in the root of the project can be used to just put information that's relevant to people that want to use mysql-native as a dependency. |
I might need your help on docker, I'm not well-versed in it. |
Yeah, I think so. Working through the version logic, if you define I'm thinking we should get rid of these version statements, and rely on unit-threaded to allow running of individual tests. But maybe as a future PR, don't want to distract too much from the sheer copy-paste-ness of this PR. |
So I've run into a weird problem. With dub, if you have a dependency with an optional dependency, you can't optionally depend on that optional dependency. I added a second config to omit the dependency on vibe-core, and it still pulls in vibe-core. I think I will need to create a third project that tests vibe, and make the vibe-core dependency optional. Ugh... |
isn't it something you can sort with configurations? like in this: https://github.com/SingingBush/mysql-native/blob/pipeline/integration_testing/tests/dub.sdl
|
No, it doesn't work. I'm going to file a dub bug, but I have a crappy workaround at the moment. You'll see. |
@SingingBush why aren't we running windows/macos integration tests? Are those not possible? |
based on configuration.
Added the dub issue: dlang/dub#2136 |
@SingingBush I've noticed that the "Install dependencies on Ubuntu" never gets run for integration tests. Any idea why? It seems like it's not needed anyway. |
good point that may not be needed anywhere. I think it used to be needed for vibe. Can probably come out |
a1c2fc7
to
2e4cb37
Compare
reflect the same actions as current tests
testing confirms, windows and macos do not support docker, and therefore cannot run an instance of mysql or mariadb. This is a shame, but I'm OK with it for now. |
time building my branch in my repo, and the PR.
running tests (and update broken links)
reflect how the tests can be run.
@SingingBush can you take a look at the docker file and integration test readme that I just added? I have not tested the docker image, I don't really know how to use docker. Note that I used the user/password in the default testConnectionStr.txt file for convenience (this is most likely what they will want to use). |
that looks fine, cheers. After this is all merged I'll use it anyway so any issues then I'll push a commit. |
8543e5d
to
71055c2
Compare
Pretty satisfied with this. The only thing I need to figure out is how to restructure the dub file so that it doesn't spit out tons of warnings. |
Use silenceWarnings in build requirements. in dub.json this would be done with:
|
OK, I found another solution using "sourceLibrary", now the ugly warnings only appear in integration-tests, which I'm not so worried about. I think this is ready to merge. BTW, @SingingBush feel free to open a PR to add your name to the author/copyright |
(mostly for people who want to run actions on their local branches)
@SingingBush can you explain the "dub upgrade" portions of the workflow? We don't need to dub upgrade anything, because there is no checked-in dub.selections.json file. So I'm confused why this is there. I'm also not clear what the caching thing is, but I can probably ask webfreak about that on discord. |
Feel free to remove the dub upgrade bit. Sooner this is merged the better. Can then perhaps get both #187 and #220 merged in and do another release before you rebase/merge #214 and bump the major release version. |
I checked with webfreak, and the dub upgrade is somewhat misnamed, as it caches the entire .dub folder for subsequent runs, in addition to running dub upgrade, as if you were storing it locally on your PC. A good test would be to run it with and without the dub upgrade to see how much time it saves. I'll leave it there for now, it's not hurting anything ( |
This PR splits out all the integration-based testing into its own test project. Only a few tests were true unittests and did not require a full database connection to perform the test (which is a natural consequence of creating a database connection library).
The rest have been added to a subproject called
integration-tests
. You can run these viadub run :integration-tests
At this point, we are using vibe exclusively for the tests. We still need to perform the integration tests with Phobos sockets, that will be a future enhancement.
Also, the troublesome
app.d
has been moved to its own project calledtestconn
(it needs testing as well).