-
Notifications
You must be signed in to change notification settings - Fork 14
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
Compile-test some tests #114
Conversation
some thoughts: Let's explicitly group tests into 'generation tests' and 'compilation tests'. I'm thinking Also, where are we running the compilation currently? In other words, where is the The rest looks good to me though, thanks for the the simple_table split! |
because it is a workspace and they are members of it, it will get build with a
i am somewhat against this idea, because why generate 2 times if once is enough? the compile test would also need generation, would it not? (i dont like duplicating tests) Edit: i just wanna note that i have nothing against adding and testing examples (like #111), but those are likely not enough to actually test all features dsync has also i am not quite happy with the current implementation of this PR, reasons:
|
ah, understood! I also changed my mind about splitting the tests: all our tests should be generate+compile tests (when possible) What I don't like about #111 is that the tests are written/compiled as examples which could confine us (perhaps in a good way?) |
i dont understand what this would confine us about, i think it is a good way to demonstrate both library usage (though the PR itself would still need to update some things) and for us to get notified directly if the examples get broken (like not compiling anymore), though generation output is not affected by this
if we should go ahead with the current PR, i would like to know what you think about the "also i am not quite happy with the current implementation of this PR, reasons", should the tests be in a separate workspace instead of referencing the main Cargo.toml? (but this would make tooling like vscode-rust-analyzer require opening that folder as the entry point to actually allow proper rust editing) |
hey @hasezoey, hope all has been well and that you've enjoyed the holiday season (happy new year!). I revisited your reasoning and I agree -- it's better for us not to include the tests as part of the workspace. In this case, let's move forward with #111 for now, we can change our approach later on as necessary. |
Updated to latest master and separated out the workspace to be a test-specific workspace, also updated the test scripts to easily generate & compile things |
needed to be split per backend, because original file types were not compatible
this will break some tooling at the moment (like rust-analyzer for vscode) or top-level cargo build and requires them to be execute in the new "root"
also remove "dsync" dependency, because it has no effect there (and only increases the test's target directory)
to execute all "test_*" files in order
converted test from #126 to be compile-able, found out that this test still used |
marked as "ready for review", because though there are still some points i dont quite like, it is better than before and definitely provides us with better robustness than without it this pr does not mean that #111 shouldnt be merged too |
|
||
pub mod diesel { | ||
pub use diesel::*; | ||
} |
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.
I've noticed this in the other tests -- do you recall why this was necessary? Just curious :)
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.
see #94, #109 and then #116, which lead to the other PRs which changed to use diesel::
basically everywhere (but not completely yet because of trait imports, see #94 (comment))
TL;DR: we are mostly there to completely remove this, but having this PR (#114) will make it a lot easier figuring out which traits need to be imported / the absolute path necessary
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.
🙌
This PR is build on #112(merged, rebased)This PR changes some generation tests to also be compile-tested, which currently include:
simple_table_pg
simple_table_sqlite
simple_table_mysql
single_model_file
custom_model_and_schema_path
this required the following changes:
simple_table
out to their own connections, because not all types are compatible everywhere (exUnsigned
is a mysql exclusive type)