acrate_database
: Add connect tests
This commit is contained in:
parent
7e62707e1e
commit
b43cc8aa3e
4 changed files with 61 additions and 0 deletions
22
.idea/runConfigurations/Test.xml
Normal file
22
.idea/runConfigurations/Test.xml
Normal file
|
@ -0,0 +1,22 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Test" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
|
||||
<option name="buildProfileId" value="dev" />
|
||||
<option name="command" value="test" />
|
||||
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
|
||||
<envs>
|
||||
<env name="ACRATE_DATABASE_URL" value="postgres:///acrate?host=/run/postgresql/" />
|
||||
</envs>
|
||||
<option name="emulateTerminal" value="true" />
|
||||
<option name="channel" value="DEFAULT" />
|
||||
<option name="requiredFeatures" value="true" />
|
||||
<option name="allFeatures" value="true" />
|
||||
<option name="withSudo" value="false" />
|
||||
<option name="buildTarget" value="REMOTE" />
|
||||
<option name="backtrace" value="SHORT" />
|
||||
<option name="isRedirectInput" value="false" />
|
||||
<option name="redirectInputPath" value="" />
|
||||
<method v="2">
|
||||
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
22
.idea/runConfigurations/Test_ignored.xml
Normal file
22
.idea/runConfigurations/Test_ignored.xml
Normal file
|
@ -0,0 +1,22 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Test ignored" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
|
||||
<option name="buildProfileId" value="dev" />
|
||||
<option name="command" value="test -- --ignored" />
|
||||
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
|
||||
<envs>
|
||||
<env name="ACRATE_DATABASE_URL" value="postgres:///acrate?host=/run/postgresql/" />
|
||||
</envs>
|
||||
<option name="emulateTerminal" value="true" />
|
||||
<option name="channel" value="DEFAULT" />
|
||||
<option name="requiredFeatures" value="true" />
|
||||
<option name="allFeatures" value="true" />
|
||||
<option name="withSudo" value="false" />
|
||||
<option name="buildTarget" value="REMOTE" />
|
||||
<option name="backtrace" value="SHORT" />
|
||||
<option name="isRedirectInput" value="false" />
|
||||
<option name="redirectInputPath" value="" />
|
||||
<method v="2">
|
||||
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
|
@ -19,11 +19,13 @@ micronfig = { version = "0.3.0", optional = true }
|
|||
mime = "0.3.17"
|
||||
pretty_env_logger = { version = "0.5.0", optional = true }
|
||||
uuid = "1.11.0"
|
||||
tokio = { version = "1.42.0", optional = true }
|
||||
|
||||
[features]
|
||||
default = ["connect"]
|
||||
bin = ["diesel_migrations", "pretty_env_logger", "connect"]
|
||||
connect = ["micronfig"]
|
||||
tests = ["tokio", "connect"]
|
||||
|
||||
[lib]
|
||||
name = "acrate_database"
|
||||
|
|
15
acrate_database/tests/test_connect.rs
Normal file
15
acrate_database/tests/test_connect.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
use acrate_database::connect::{connect_async, connect_sync};
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn test_connect_sync() -> diesel::ConnectionResult<()> {
|
||||
connect_sync()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[ignore]
|
||||
async fn test_connect_async() -> diesel::ConnectionResult<()> {
|
||||
connect_async().await?;
|
||||
Ok(())
|
||||
}
|
Loading…
Reference in a new issue