Skip to content

Commit f02e427

Browse files
theduketheduke
authored andcommitted
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
1 parent 2f5e3ab commit f02e427

File tree

12 files changed

+63
-2
lines changed

12 files changed

+63
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
members = [
44
"juniper_codegen",
55
"juniper",
6-
"juniper_tests",
6+
"integration_tests/juniper_tests",
7+
"integration_tests/juniper_2018_edition_tests",
78
"juniper_hyper",
89
"juniper_iron",
910
"juniper_rocket",
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "juniper_2018_edition_tests"
3+
version = "0.1.0"
4+
authors = ["Christoph Herzog <[email protected]>"]
5+
edition = "2018"
6+
7+
[dependencies]
8+
juniper = { version = "0.11", path = "../../juniper" }
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
[tasks.build-verbose]
3+
condition = { rust_version = { min = "1.32.0" } }
4+
5+
[tasks.build-verbose.windows]
6+
condition = { rust_version = { min = "1.32.0" } }
7+
8+
[tasks.test-verbose]
9+
condition = { rust_version = { min = "1.32.0" } }
10+
11+
[tasks.test-verbose.windows]
12+
condition = { rust_version = { min = "1.32.0" } }
13+
14+
[tasks.ci-coverage-flow]
15+
disabled = true
16+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/// A VERY minimal test case that ensures that
2+
/// macros and custom derives work in 2018 edition crates.
3+
/// This can be removed once juniper is refactored to the 2018 edition.
4+
5+
#[derive(juniper::GraphQLEnum, PartialEq, Eq, Clone, Copy, Debug)]
6+
enum TaskStatus {
7+
Todo,
8+
Done,
9+
Closed,
10+
}
11+
12+
#[derive(juniper::GraphQLObject, Clone, Debug)]
13+
struct Task {
14+
pub id: i32,
15+
pub status: TaskStatus,
16+
pub title: String,
17+
pub description: Option<String>,
18+
}
19+
20+
#[derive(juniper::GraphQLInputObject, Clone, Debug)]
21+
struct TaskCreate {
22+
pub title: String,
23+
pub description: Option<String>,
24+
}
25+
26+
struct Query;
27+
28+
juniper::graphql_object!(Query: () |&self| {
29+
field task(id: i32) -> Task {
30+
unimplemented!()
31+
}
32+
});
33+
34+
35+
fn main() {
36+
}

juniper_tests/Cargo.toml renamed to integration_tests/juniper_tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
publish = false
55

66
[dependencies]
7-
juniper = { version = "0.11.0", path = "../juniper" }
7+
juniper = { version = "0.11.0", path = "../../juniper" }
88
serde_json = { version = "1" }
99

1010
[dev-dependencies]

0 commit comments

Comments
 (0)