Refactor integration test layout + add minimal 2018 edition test

* Add a new integration_tests subdirectory that holds integration tests
* Add a new, temporary (and really minimal) 2018 edition test crate
This commit is contained in:
Christoph Herzog 2018-12-19 02:35:46 +01:00 committed by theduke
parent 2f5e3ab29b
commit f02e427cab
12 changed files with 63 additions and 2 deletions

View file

@ -3,7 +3,8 @@
members = [ members = [
"juniper_codegen", "juniper_codegen",
"juniper", "juniper",
"juniper_tests", "integration_tests/juniper_tests",
"integration_tests/juniper_2018_edition_tests",
"juniper_hyper", "juniper_hyper",
"juniper_iron", "juniper_iron",
"juniper_rocket", "juniper_rocket",

View file

@ -0,0 +1,8 @@
[package]
name = "juniper_2018_edition_tests"
version = "0.1.0"
authors = ["Christoph Herzog <chris@theduke.at>"]
edition = "2018"
[dependencies]
juniper = { version = "0.11", path = "../../juniper" }

View file

@ -0,0 +1,16 @@
[tasks.build-verbose]
condition = { rust_version = { min = "1.32.0" } }
[tasks.build-verbose.windows]
condition = { rust_version = { min = "1.32.0" } }
[tasks.test-verbose]
condition = { rust_version = { min = "1.32.0" } }
[tasks.test-verbose.windows]
condition = { rust_version = { min = "1.32.0" } }
[tasks.ci-coverage-flow]
disabled = true

View file

@ -0,0 +1,36 @@
/// A VERY minimal test case that ensures that
/// macros and custom derives work in 2018 edition crates.
/// This can be removed once juniper is refactored to the 2018 edition.
#[derive(juniper::GraphQLEnum, PartialEq, Eq, Clone, Copy, Debug)]
enum TaskStatus {
Todo,
Done,
Closed,
}
#[derive(juniper::GraphQLObject, Clone, Debug)]
struct Task {
pub id: i32,
pub status: TaskStatus,
pub title: String,
pub description: Option<String>,
}
#[derive(juniper::GraphQLInputObject, Clone, Debug)]
struct TaskCreate {
pub title: String,
pub description: Option<String>,
}
struct Query;
juniper::graphql_object!(Query: () |&self| {
field task(id: i32) -> Task {
unimplemented!()
}
});
fn main() {
}

View file

@ -4,7 +4,7 @@ version = "0.1.0"
publish = false publish = false
[dependencies] [dependencies]
juniper = { version = "0.11.0", path = "../juniper" } juniper = { version = "0.11.0", path = "../../juniper" }
serde_json = { version = "1" } serde_json = { version = "1" }
[dev-dependencies] [dev-dependencies]