Bump octocrab from 0.28.0 to 0.29.1 (#1193)

* Bump octocrab from 0.28.0 to 0.29.1

Bumps [octocrab](https://github.com/XAMPPRocky/octocrab) from 0.28.0 to 0.29.1.
- [Release notes](https://github.com/XAMPPRocky/octocrab/releases)
- [Changelog](https://github.com/XAMPPRocky/octocrab/blob/main/CHANGELOG.md)
- [Commits](https://github.com/XAMPPRocky/octocrab/compare/v0.28.0...v0.29.1)

---
updated-dependencies:
- dependency-name: octocrab
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Make wayback suggestion test more robust

- Retry mechanism
- Better checks

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias <matthias-endler@gmx.net>
This commit is contained in:
dependabot[bot] 2023-08-07 12:58:54 +02:00 committed by GitHub
parent d6ea7bbbc4
commit 8f83081b03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 10 deletions

4
Cargo.lock generated
View file

@ -2367,9 +2367,9 @@ dependencies = [
[[package]]
name = "octocrab"
version = "0.28.0"
version = "0.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0943920a77d028b66ebe4407813733ad4d0ebe7b12dafd608ddec8478e5fef0b"
checksum = "a2f5937fa816ca24c81cd817637a29be1eb9be0b4ddfccf3783df3eb095cc4f6"
dependencies = [
"arc-swap",
"async-trait",

View file

@ -57,16 +57,29 @@ where
mod tests {
use crate::archive::wayback::get_wayback_link;
use reqwest::Error;
use std::{error::Error as StdError, time::Duration};
use tokio::time::sleep;
#[tokio::test]
async fn wayback_suggestion() -> Result<(), Error> {
let url = &"https://example.com".try_into().unwrap();
let response = get_wayback_link(url).await?;
let suggestion = response.unwrap();
async fn wayback_suggestion() -> Result<(), Box<dyn StdError>> {
let url = "https://example.com".parse()?;
assert!(suggestion.as_str().contains("web.archive.org"));
Ok(())
// This test can be flaky, because the wayback machine does not always
// return a suggestion. Retry a few times if needed.
for _ in 0..3 {
if let Some(suggestion) = get_wayback_link(&url).await? {
assert_eq!(
suggestion
.host_str()
.expect("Suggestion doesn't have a host"),
"web.archive.org"
);
assert!(suggestion.path().ends_with(url.as_str()));
return Ok(());
}
sleep(Duration::from_secs(1)).await; // add delay between retries
}
Err("Did not get a valid Wayback Machine suggestion.".into())
}
#[tokio::test]

View file

@ -32,7 +32,7 @@ ip_network = "0.4.1"
jwalk = "0.8.1"
linkify = "0.10.0"
log = "0.4.19"
octocrab = "0.28.0"
octocrab = "0.29.1"
once_cell = "1.18.0"
openssl-sys = { version = "0.9.90", optional = true }
path-clean = "1.0.1"