Skip to content

Commit

Permalink
Update dependencies in yaml-test and elasticsearch packages
Browse files Browse the repository at this point in the history
  • Loading branch information
swallez committed Aug 21, 2024
1 parent 4f248cc commit c998c22
Show file tree
Hide file tree
Showing 8 changed files with 512 additions and 1,250 deletions.
1,672 changes: 466 additions & 1,206 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion elasticsearch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ reqwest = { version = "0.12", default-features = false, features = ["gzip", "jso
url = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_with = "1"
serde_with = "3"
void = "1"

[dev-dependencies]
Expand Down
14 changes: 7 additions & 7 deletions xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ publish = false

[dependencies]
structopt = "0.3"
reqwest = { version = "0.11", features = ["blocking", "json"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
anyhow = "1.0"
once_cell = "1.8"
reqwest = { version = "0.12", features = ["blocking", "json"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
anyhow = "1"
once_cell = "1.19"
chrono = { version = "0.4", features = ["serde"] }
zip = "0.5"
regex = "1.5.4"
zip = "2"
regex = "1"
48 changes: 24 additions & 24 deletions yaml_test_runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,32 @@ elasticsearch = { path = "./../elasticsearch", features = ["experimental-apis"]}
api_generator = { path = "./../api_generator" }

anyhow = "1.0"
base64 = "^0.11"
clap = "~2"
failure = "0.1.6"
itertools = "0.10.0"
Inflector = "0.11.4"
lazy_static = "1.4.0"
log = "0.4.8"
once_cell = "1.4.0"
path-slash = "0.1.1"
quote = "~0.3"
regex = "1.3.1"
reqwest = "~0.9"
semver = "0.9.0"
serde = "~1"
serde_yaml = "0.8.11"
serde_json = { version = "~1", features = ["arbitrary_precision"] }
simple_logger = "1.9.0"
syn = { version = "~0.11", features = ["full"] }
url = "2.1.1"
yaml-rust = "0.4.3"
tar = "~0.4"
flate2 = "~1"
globset = "~0.4"
base64 = "0.22"
clap = "4"
failure = "0.1"
itertools = "0.13"
Inflector = "0.11"
lazy_static = "1.5"
log = "0.4"
once_cell = "1"
path-slash = "0.2"
quote = "0.3"
regex = "1"
reqwest = "0.12"
semver = "1"
serde = "1"
serde_yaml = "0.9"
serde_json = { version = "1", features = ["arbitrary_precision"] }
simple_logger = "5"
syn = { version = "0.11", features = ["full"] }
url = "2"
yaml-rust = "0.4"
tar = "0.4"
flate2 = "1"
globset = "0.4"

[dev-dependencies]
tokio = { version = "1.0", default-features = false, features = ["macros", "net", "time"] }
tokio = { version = "1", default-features = false, features = ["macros", "net", "time"] }

[lints.clippy]
# yaml tests contain approximate values of PI
Expand Down
2 changes: 1 addition & 1 deletion yaml_test_runner/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl<'a> YamlTests<'a> {
) -> Self {
let path = path.to_slash_lossy();
Self {
path,
path: path.to_string(),
version,
skip,
suite,
Expand Down
19 changes: 10 additions & 9 deletions yaml_test_runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extern crate quote;
extern crate simple_logger;

use anyhow::bail;
use clap::{App, Arg};
use clap::{Arg, Command};
use log::LevelFilter;
use serde_json::Value;
use std::{fs, path::PathBuf, process::exit};
Expand All @@ -46,18 +46,19 @@ fn main() -> anyhow::Result<()> {
.init()
.unwrap();

let matches = App::new(env!("CARGO_PKG_NAME"))
let matches = Command::new(env!("CARGO_PKG_NAME"))
.about(env!("CARGO_PKG_DESCRIPTION"))
.arg(Arg::with_name("url")
.short("u")
.arg(Arg::new("url")
.short('u')
.long("url")
.value_name("ELASTICSEARCH_URL")
.help("The url of a running Elasticsearch cluster. Used to determine the version, test suite and branch to use to compile tests")
.required(true)
.takes_value(true))
.required(true))
.get_matches();

let url = matches.value_of("url").expect("missing 'url' argument");
let url = matches
.get_one::<String>("url")
.expect("missing 'url' argument");
let (branch, suite, version, sem_version) =
match branch_suite_and_version_from_elasticsearch(url) {
Ok(v) => v,
Expand Down Expand Up @@ -125,7 +126,7 @@ fn main() -> anyhow::Result<()> {
fn branch_suite_and_version_from_elasticsearch(
url: &str,
) -> Result<(String, TestSuite, String, semver::Version), failure::Error> {
let client = reqwest::ClientBuilder::new()
let client = reqwest::blocking::ClientBuilder::new()
.danger_accept_invalid_certs(true)
.build()?;

Expand All @@ -134,7 +135,7 @@ fn branch_suite_and_version_from_elasticsearch(
Ok(ref s) if s == "free" => TestSuite::Free,
_ => TestSuite::XPack,
};
let mut response = client.get(url).send()?;
let response = client.get(url).send()?;
let json: Value = response.json()?;
let branch = json["version"]["build_hash"].as_str().unwrap().to_string();

Expand Down
2 changes: 1 addition & 1 deletion yaml_test_runner/src/step/skip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl Skip {
fn parse_version_requirements(version: &Option<String>) -> Option<semver::VersionReq> {
if let Some(v) = version {
if v.to_lowercase() == "all" {
Some(semver::VersionReq::any())
Some(semver::VersionReq::STAR)
} else {
lazy_static! {
static ref VERSION_REGEX: Regex =
Expand Down
3 changes: 2 additions & 1 deletion yaml_test_runner/tests/common/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ use std::io::Write;
pub fn base_64_encode_credentials(user: &str, password: &str) -> String {
let mut value = Vec::new();
{
let mut encoder = Base64Encoder::new(&mut value, base64::STANDARD);
let mut encoder =
Base64Encoder::new(&mut value, &base64::engine::general_purpose::STANDARD);
write!(encoder, "{}:", user).unwrap();
write!(encoder, "{}", password).unwrap();
};
Expand Down

0 comments on commit c998c22

Please sign in to comment.