Skip to content
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

Fix Rustls features #81

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ jobs:
command: test
args: --no-fail-fast --no-default-features --features "rocksdb cluster enterprise reqwest_blocking" --all

- name: check build (reqwest_blocking_rustls)
uses: actions-rs/cargo@v1
env:
RUST_LOG: arangors=trace
with:
command: check
args: --no-default-features --features "rocksdb cluster enterprise reqwest_blocking_rustls" --all

- name: test (reqwest_blocking_rustls)
uses: actions-rs/cargo@v1
env:
RUST_LOG: arangors=trace
timeout-minutes: 40
with:
command: test
args: --no-fail-fast --no-default-features --features "rocksdb cluster enterprise reqwest_blocking_rustls" --all

- name: check build (default features)
uses: actions-rs/cargo@v1
env:
Expand Down Expand Up @@ -112,6 +129,23 @@ jobs:
command: test
args: --no-fail-fast --no-default-features --features "rocksdb cluster enterprise reqwest_async" --all

- name: check build (reqwest_async_rustls)
uses: actions-rs/cargo@v1
env:
RUST_LOG: arangors=trace
with:
command: check
args: --no-default-features --features "rocksdb cluster enterprise reqwest_async_rustls" --all

- name: test (reqwest_async_rustls)
uses: actions-rs/cargo@v1
env:
RUST_LOG: arangors=trace
timeout-minutes: 40
with:
command: test
args: --no-fail-fast --no-default-features --features "rocksdb cluster enterprise reqwest_async" --all

- name: check build (surf_async)
uses: actions-rs/cargo@v1
env:
Expand Down
8 changes: 1 addition & 7 deletions examples/analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const URL: &str = "http://localhost:8529";

#[cfg_attr(feature = "reqwest_async", tokio::main)]
#[cfg_attr(feature = "surf_async", async_std::main)]
#[cfg_attr(feature = "reqwest_blocking", maybe_async::must_be_sync)]
#[cfg_attr(feature = "blocking", maybe_async::must_be_sync)]
async fn main() -> Result<(), Error> {
let analyzer_name = "test_analyzer".to_string();

Expand All @@ -35,9 +35,3 @@ async fn main() -> Result<(), Error> {

Ok(())
}
#[cfg(not(any(
feature = "reqwest_blocking",
feature = "reqwest_async",
feature = "surf_async"
)))]
fn main() {}
9 changes: 1 addition & 8 deletions examples/aql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct User {

#[cfg_attr(feature = "reqwest_async", tokio::main)]
#[cfg_attr(feature = "surf_async", async_std::main)]
#[cfg_attr(feature = "reqwest_blocking", maybe_async::must_be_sync)]
#[cfg_attr(feature = "blocking", maybe_async::must_be_sync)]
async fn main() {
env_logger::init();

Expand Down Expand Up @@ -93,10 +93,3 @@ async fn main() {
let result: Vec<User> = database.aql_query(aql).await.unwrap();
println!("{:?}", result);
}

#[cfg(not(any(
feature = "reqwest_blocking",
feature = "reqwest_async",
feature = "surf_async"
)))]
fn main() {}
8 changes: 1 addition & 7 deletions examples/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const URL: &str = "http://localhost:8529";

#[cfg_attr(feature = "reqwest_async", tokio::main)]
#[cfg_attr(feature = "surf_async", async_std::main)]
#[cfg_attr(feature = "reqwest_blocking", maybe_async::must_be_sync)]
#[cfg_attr(feature = "blocking", maybe_async::must_be_sync)]
async fn main() -> Result<(), Error> {
let collection_name = "test_collection_create_and_drop";

Expand All @@ -31,9 +31,3 @@ async fn main() -> Result<(), Error> {

Ok(())
}
#[cfg(not(any(
feature = "reqwest_blocking",
feature = "reqwest_async",
feature = "surf_async"
)))]
fn main() {}
9 changes: 1 addition & 8 deletions examples/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const URL: &str = "http://localhost:8529";

#[cfg_attr(feature = "reqwest_async", tokio::main)]
#[cfg_attr(feature = "surf_async", async_std::main)]
#[cfg_attr(feature = "reqwest_blocking", maybe_async::must_be_sync)]
#[cfg_attr(feature = "blocking", maybe_async::must_be_sync)]
async fn main() -> Result<(), Error> {
let conn = Connection::establish_jwt(URL, "username", "password").await?;
let database = conn.db("test_db").await?;
Expand All @@ -25,10 +25,3 @@ async fn main() -> Result<(), Error> {

Ok(())
}

#[cfg(not(any(
feature = "reqwest_blocking",
feature = "reqwest_async",
feature = "surf_async"
)))]
fn main() {}
9 changes: 1 addition & 8 deletions examples/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct User {

#[cfg_attr(feature = "reqwest_async", tokio::main)]
#[cfg_attr(feature = "surf_async", async_std::main)]
#[cfg_attr(feature = "reqwest_blocking", maybe_async::must_be_sync)]
#[cfg_attr(feature = "blocking", maybe_async::must_be_sync)]
async fn main() -> Result<(), Error> {
let collection_name = "test_collection_document_example";

Expand Down Expand Up @@ -146,10 +146,3 @@ async fn main() -> Result<(), Error> {

Ok(())
}

#[cfg(not(any(
feature = "reqwest_blocking",
feature = "reqwest_async",
feature = "surf_async"
)))]
fn main() {}
2 changes: 1 addition & 1 deletion examples/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const URL: &str = "http://localhost:8529";

#[cfg_attr(feature = "reqwest_async", tokio::main)]
#[cfg_attr(feature = "surf_async", async_std::main)]
#[cfg_attr(feature = "reqwest_blocking", maybe_async::must_be_sync)]
#[cfg_attr(feature = "blocking", maybe_async::must_be_sync)]
async fn main() -> Result<(), Error> {
let conn = Connection::establish_jwt(URL, "username", "password").await?;
let database = conn.db("test_db").await?;
Expand Down
8 changes: 1 addition & 7 deletions examples/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const URL: &str = "http://localhost:8529";

#[cfg_attr(feature = "reqwest_async", tokio::main)]
#[cfg_attr(feature = "surf_async", async_std::main)]
#[cfg_attr(feature = "reqwest_blocking", maybe_async::must_be_sync)]
#[cfg_attr(feature = "blocking", maybe_async::must_be_sync)]
async fn main() -> Result<(), Error> {
let collection_name = "test_collection".to_string();

Expand Down Expand Up @@ -48,9 +48,3 @@ async fn main() -> Result<(), Error> {

Ok(())
}
#[cfg(not(any(
feature = "reqwest_blocking",
feature = "reqwest_async",
feature = "surf_async"
)))]
fn main() {}
2 changes: 1 addition & 1 deletion src/collection/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub struct CreateOptions<'a> {

/// Optional object that specifies the collection level schema for
/// documents. The attribute keys rule, level and message must follow the
/// rules documented in Document Schema Validation https://www.arangodb.com/docs/devel/document-schema-validation.html
/// rules documented in Document Schema Validation <https://www.arangodb.com/docs/devel/document-schema-validation.html>
#[serde(skip_serializing_if = "Option::is_none")]
#[builder(default, setter(strip_option))]
schema: Option<serde_json::Value>,
Expand Down
7 changes: 6 additions & 1 deletion src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ pub struct Version {
pub license: String,
}

#[cfg(any(feature = "reqwest_async", feature = "reqwest_blocking"))]
#[cfg(any(
feature = "reqwest_async",
feature = "reqwest_blocking",
feature = "reqwest_async_rustls",
feature = "reqwest_blocking_rustls"
))]
pub type Connection = GenericConnection<uclient::reqwest::ReqwestClient>;

#[cfg(feature = "surf_async")]
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ compile_error!(
#[cfg(any(
feature = "reqwest_async",
feature = "reqwest_blocking",
feature = "reqwest_async_rustls",
feature = "reqwest_blocking_rustls",
feature = "surf_async"
))]
pub use crate::connection::Connection;
Expand Down
8 changes: 4 additions & 4 deletions tests/analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async fn create_ngram_analyzer<C: ClientExt>(
}

#[maybe_async::test(
any(feature = "reqwest_blocking"),
any(feature = "blocking"),
async(any(feature = "reqwest_async"), tokio::test),
async(any(feature = "surf_async"), async_std::test)
)]
Expand All @@ -88,7 +88,7 @@ async fn test_create_and_drop_norm_analyzer() {
}

#[maybe_async::test(
any(feature = "reqwest_blocking"),
any(feature = "blocking"),
async(any(feature = "reqwest_async"), tokio::test),
async(any(feature = "surf_async"), async_std::test)
)]
Expand All @@ -110,7 +110,7 @@ async fn test_create_and_drop_ngram_analyzer() {
}

#[maybe_async::test(
any(feature = "reqwest_blocking"),
any(feature = "blocking"),
async(any(feature = "reqwest_async"), tokio::test),
async(any(feature = "surf_async"), async_std::test)
)]
Expand Down Expand Up @@ -141,7 +141,7 @@ async fn test_list_analyzer() {
}

#[maybe_async::test(
any(feature = "reqwest_blocking"),
any(feature = "blocking"),
async(any(feature = "reqwest_async"), tokio::test),
async(any(feature = "surf_async"), async_std::test)
)]
Expand Down
8 changes: 4 additions & 4 deletions tests/aql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct User {
}

#[maybe_async::test(
any(feature = "reqwest_blocking"),
any(feature = "blocking"),
async(any(feature = "reqwest_async"), tokio::test),
async(any(feature = "surf_async"), async_std::test)
)]
Expand All @@ -35,7 +35,7 @@ async fn test_aql_str() {
}

#[maybe_async::test(
any(feature = "reqwest_blocking"),
any(feature = "blocking"),
async(any(feature = "reqwest_async"), tokio::test),
async(any(feature = "surf_async"), async_std::test)
)]
Expand All @@ -52,7 +52,7 @@ async fn test_aql() {
}

#[maybe_async::test(
any(feature = "reqwest_blocking"),
any(feature = "blocking"),
async(any(feature = "reqwest_async"), tokio::test),
async(any(feature = "surf_async"), async_std::test)
)]
Expand All @@ -71,7 +71,7 @@ async fn test_aql_bind_vars() {
}

#[maybe_async::test(
any(feature = "reqwest_blocking"),
any(feature = "blocking"),
async(any(feature = "reqwest_async"), tokio::test),
async(any(feature = "surf_async"), async_std::test)
)]
Expand Down
Loading