Compare commits
47 Commits
dependabot
...
fix-pedant
Author | SHA1 | Date | |
---|---|---|---|
4b8730d6e0 | |||
25aea0f04d | |||
410a602638 | |||
894afaa75d | |||
29710d9263 | |||
d49a8d330b | |||
cb746c949b | |||
f4a83aad2c | |||
5765016163 | |||
8ded2da3ee | |||
a5c99fa7f5 | |||
caee48f4a4 | |||
18af42ed58 | |||
5505331599 | |||
deec0a0fa6 | |||
514960324c | |||
f86c59fe41 | |||
f7366f8939 | |||
0c0c2331b1 | |||
92f3a15384 | |||
93de768362 | |||
ebee3bb272 | |||
23587a7099 | |||
648e2b47ba | |||
6f58f1f769 | |||
b4bd8d2176 | |||
19bc8126a8 | |||
a790b6cca6 | |||
ae22e0f385 | |||
c9ccb2891c | |||
9fbbad7157 | |||
3789ddd152 | |||
f25e883fd1 | |||
a684341cd3 | |||
3f42a03fa8 | |||
8a71b308df | |||
37f8a1d32e | |||
84686aecdb | |||
208a6db95c | |||
d43ef2402e | |||
14e353fd26 | |||
0735399ff9 | |||
ef1e53637e | |||
453963193f | |||
7ebc300d6f | |||
0520679022 | |||
7b50187daa |
8
.github/workflows/rust.yml
vendored
8
.github/workflows/rust.yml
vendored
@ -42,13 +42,9 @@ jobs:
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Clippy Linting
|
||||
run: cargo clippy --all-features -- -Dclippy::all
|
||||
# TODO
|
||||
# run: cargo clippy --all-features -- -Dclippy::all -Dclippy::pedantic
|
||||
run: cargo clippy --all-features -- -Dclippy::all -Dclippy::pedantic
|
||||
- name: Clippy Test Linting
|
||||
run: cargo clippy --tests -- -Dclippy::all
|
||||
# TODO
|
||||
# run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic
|
||||
run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic
|
||||
|
||||
|
||||
test:
|
||||
|
11
CHANGELOG.md
11
CHANGELOG.md
@ -5,16 +5,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
### Dependencies
|
||||
- Bump `serde` from 1.0.160 to 1.0.166 (#613, #617, #627, #636)
|
||||
- Bump `serde` from 1.0.160 to 1.0.176 (#613, #617, #627, #636, #639, #640, #645, [#648](https://github.com/vbrandl/hoc/pull/648), [#650](https://github.com/vbrandl/hoc/pull/650))
|
||||
- Bump `actions/cache` from 2 to 3 (#616)
|
||||
- Bump `tokio` from 1.28.0 to 1.29.1 (#618, #625, #633, #634)
|
||||
- Bump `reqwest` from 0.11.17 to 0.11.18 (#619)
|
||||
- Bump `vergen` from 8.1.3 to 8.2.3 (#621, #622, #635)
|
||||
- Bump `vergen` from 8.1.3 to 8.2.4 (#621, #622, #635, #638)
|
||||
- Bump `tracing-actix-web` from 0.7.4 to 0.7.5 (#623)
|
||||
- Bump `git2` from 0.17.1 to 0.17.2 (#624)
|
||||
- Bump `tempfile` from 3.5.0 to 3.6.0 (#626)
|
||||
- Bump `serde_json` from 1.0.96 to 1.0.99 (#630, #632)
|
||||
- Bump `tempfile` from 3.5.0 to 3.7.0 (#626, [#646](https://github.com/vbrandl/hoc/pull/646))
|
||||
- Bump `serde_json` from 1.0.96 to 1.0.104 (#630, #632, #637, #641, #644, [#649](https://github.com/vbrandl/hoc/pull/649))
|
||||
- Bump `openssl` from 0.10.50 to 0.10.55 (#631)
|
||||
- Bump `tracing-bunyan-formatter` from 0.3.7 to 0.3.8 (#642)
|
||||
- Bump `anyhow` from 1.0.71 to 1.0.72 (#643)
|
||||
- Bump `ructe` from 0.16.1 to 0.17.0 ([#647](https://github.com/vbrandl/hoc/pull/647))
|
||||
|
||||
|
||||
## [0.35.0] 2023-05-04
|
||||
|
108
Cargo.lock
generated
108
Cargo.lock
generated
@ -281,9 +281,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.71"
|
||||
version = "1.0.72"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8"
|
||||
checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854"
|
||||
|
||||
[[package]]
|
||||
name = "arc-swap"
|
||||
@ -299,7 +299,7 @@ checksum = "7b2d0f03b3640e3a630367e40c468cb7f309529c708ed1d88597047b0e7c6ef7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.23",
|
||||
"syn 2.0.25",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -648,15 +648,6 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fastrand"
|
||||
version = "1.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be"
|
||||
dependencies = [
|
||||
"instant",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fastrand"
|
||||
version = "2.0.0"
|
||||
@ -771,7 +762,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.23",
|
||||
"syn 2.0.25",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1282,7 +1273,7 @@ dependencies = [
|
||||
"gix-command",
|
||||
"gix-config-value",
|
||||
"parking_lot",
|
||||
"rustix",
|
||||
"rustix 0.37.22",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
@ -1431,7 +1422,7 @@ version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7058c94f4164fcf5b8457d35f6d8f6e1007f9f7f938c9c7684a7e01d23c6ddde"
|
||||
dependencies = [
|
||||
"fastrand 2.0.0",
|
||||
"fastrand",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1655,15 +1646,6 @@ dependencies = [
|
||||
"hashbrown 0.12.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "instant"
|
||||
version = "0.1.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "io-close"
|
||||
version = "0.3.7"
|
||||
@ -1693,9 +1675,9 @@ checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6"
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.10.5"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
|
||||
checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57"
|
||||
dependencies = [
|
||||
"either",
|
||||
]
|
||||
@ -1814,6 +1796,12 @@ version = "0.3.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519"
|
||||
|
||||
[[package]]
|
||||
name = "linux-raw-sys"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0"
|
||||
|
||||
[[package]]
|
||||
name = "local-channel"
|
||||
version = "0.1.3"
|
||||
@ -2021,7 +2009,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.23",
|
||||
"syn 2.0.25",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2138,7 +2126,7 @@ dependencies = [
|
||||
"pest_meta",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.23",
|
||||
"syn 2.0.25",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2169,7 +2157,7 @@ checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.23",
|
||||
"syn 2.0.25",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2350,9 +2338,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ructe"
|
||||
version = "0.16.1"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "79c86c1631418815c5947a34be5872806586c65398754ec91cc2df35a8e26ba8"
|
||||
checksum = "9b0a930679d54e46fa4e66be3d9a333026da04d2b659e42aab4dfd1586452815"
|
||||
dependencies = [
|
||||
"base64 0.21.2",
|
||||
"bytecount",
|
||||
@ -2397,7 +2385,20 @@ dependencies = [
|
||||
"errno",
|
||||
"io-lifetimes",
|
||||
"libc",
|
||||
"linux-raw-sys",
|
||||
"linux-raw-sys 0.3.8",
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustix"
|
||||
version = "0.38.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5"
|
||||
dependencies = [
|
||||
"bitflags 2.3.3",
|
||||
"errno",
|
||||
"libc",
|
||||
"linux-raw-sys 0.4.3",
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
@ -2468,29 +2469,29 @@ checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.166"
|
||||
version = "1.0.176"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d01b7404f9d441d3ad40e6a636a7782c377d2abdbe4fa2440e2edcc2f4f10db8"
|
||||
checksum = "76dc28c9523c5d70816e393136b86d48909cfb27cecaa902d338c19ed47164dc"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.166"
|
||||
version = "1.0.176"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6"
|
||||
checksum = "a4e7b8c5dc823e3b90651ff1d3808419cd14e5ad76de04feaf37da114e7a306f"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.23",
|
||||
"syn 2.0.25",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.99"
|
||||
version = "1.0.104"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3"
|
||||
checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"ryu",
|
||||
@ -2609,9 +2610,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.23"
|
||||
version = "2.0.25"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737"
|
||||
checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -2620,15 +2621,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tempfile"
|
||||
version = "3.6.0"
|
||||
version = "3.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6"
|
||||
checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"cfg-if",
|
||||
"fastrand 1.9.0",
|
||||
"fastrand",
|
||||
"redox_syscall 0.3.5",
|
||||
"rustix",
|
||||
"rustix 0.38.4",
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
@ -2649,7 +2649,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.23",
|
||||
"syn 2.0.25",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2796,14 +2796,14 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.23",
|
||||
"syn 2.0.25",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-bunyan-formatter"
|
||||
version = "0.3.7"
|
||||
version = "0.3.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "25a348912d4e90923cb93343691d3be97e3409607363706c400fc935bb032fb0"
|
||||
checksum = "464ce79ea7f689ca56d90a9c5563e803a4b61b2695e789205644ed8e8101e6bf"
|
||||
dependencies = [
|
||||
"ahash 0.8.3",
|
||||
"gethostname",
|
||||
@ -2951,9 +2951,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
|
||||
|
||||
[[package]]
|
||||
name = "vergen"
|
||||
version = "8.2.3"
|
||||
version = "8.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ce38fc503fa57441ac2539c3e723b5adf76601eb4f1ad24025c6660d27f355b7"
|
||||
checksum = "bbc5ad0d9d26b2c49a5ab7da76c3e79d3ee37e7821799f8223fcb8f2f391a2e7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"gix",
|
||||
@ -3013,7 +3013,7 @@ dependencies = [
|
||||
"once_cell",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.23",
|
||||
"syn 2.0.25",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
||||
@ -3047,7 +3047,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.23",
|
||||
"syn 2.0.25",
|
||||
"wasm-bindgen-backend",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
16
Cargo.toml
16
Cargo.toml
@ -26,23 +26,23 @@ mime = "0.3"
|
||||
number_prefix = "0.4.0"
|
||||
openssl-probe = "0.1.5"
|
||||
reqwest = "0.11.18"
|
||||
serde = "1.0.166"
|
||||
serde = "1.0.176"
|
||||
serde_derive = "1.0.166"
|
||||
serde_json = "1.0.99"
|
||||
serde_json = "1.0.104"
|
||||
tracing = "0.1.37"
|
||||
tracing-actix-web = "0.7.5"
|
||||
tracing-bunyan-formatter = "0.3.7"
|
||||
tracing-bunyan-formatter = "0.3.8"
|
||||
tracing-futures = "0.2.5"
|
||||
tracing-log = "0.1.3"
|
||||
tracing-subscriber = { version = "0.3.17", features = ["registry", "env-filter"] }
|
||||
|
||||
[build-dependencies]
|
||||
anyhow = "1.0.71"
|
||||
ructe = { version = "0.16.1", features = ["mime03"] }
|
||||
vergen = { version = "8.2.3", default-features = false, features = ["git", "gitoxide"] }
|
||||
anyhow = "1.0.72"
|
||||
ructe = { version = "0.17.0", features = ["mime03"] }
|
||||
vergen = { version = "8.2.4", default-features = false, features = ["git", "gitoxide"] }
|
||||
|
||||
[dev-dependencies]
|
||||
awc = "3.1.1"
|
||||
ructe = "0.16.1"
|
||||
tempfile = "3.6.0"
|
||||
ructe = "0.17.0"
|
||||
tempfile = "3.7.0"
|
||||
tokio = "1.29.1"
|
||||
|
19
src/error.rs
19
src/error.rs
@ -41,17 +41,14 @@ impl ResponseError for Error {
|
||||
|
||||
fn error_response(&self) -> HttpResponse {
|
||||
let mut buf = Vec::new();
|
||||
match self {
|
||||
Error::BranchNotFound => {
|
||||
templates::p404_no_master_html(&mut buf, VERSION_INFO, 0).unwrap();
|
||||
HttpResponse::NotFound().content_type("text/html").body(buf)
|
||||
}
|
||||
_ => {
|
||||
templates::p500_html(&mut buf, VERSION_INFO, 0).unwrap();
|
||||
HttpResponse::InternalServerError()
|
||||
.content_type("text/html")
|
||||
.body(buf)
|
||||
}
|
||||
if let Error::BranchNotFound = self {
|
||||
templates::p404_no_master_html(&mut buf, VERSION_INFO, 0).unwrap();
|
||||
HttpResponse::NotFound().content_type("text/html").body(buf)
|
||||
} else {
|
||||
templates::p500_html(&mut buf, VERSION_INFO, 0).unwrap();
|
||||
HttpResponse::InternalServerError()
|
||||
.content_type("text/html")
|
||||
.body(buf)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -282,6 +282,7 @@ where
|
||||
}
|
||||
pull(&path)?;
|
||||
let (hoc, head, commits) = hoc(&service_url, &state.repos(), &state.cache(), branch)?;
|
||||
#[allow(clippy::cast_precision_loss)]
|
||||
let hoc_pretty = match NumberPrefix::decimal(hoc as f64) {
|
||||
NumberPrefix::Standalone(hoc) => hoc.to_string(),
|
||||
NumberPrefix::Prefixed(prefix, hoc) => format!("{hoc:.1}{prefix}"),
|
||||
|
@ -6,7 +6,7 @@ fn init() {
|
||||
dotenvy::dotenv().ok();
|
||||
openssl_probe::init_ssl_cert_env_vars();
|
||||
|
||||
telemetry::init_subscriber(telemetry::get_subscriber("hoc", "info"))
|
||||
telemetry::init_subscriber(telemetry::get_subscriber("hoc", "info"));
|
||||
}
|
||||
|
||||
#[actix_rt::main]
|
||||
|
@ -5,14 +5,14 @@ use tempfile::TempDir;
|
||||
#[test]
|
||||
fn no_repos() {
|
||||
let repos = TempDir::new().unwrap();
|
||||
assert_eq!(0, count_repositories(&repos).unwrap())
|
||||
assert_eq!(0, count_repositories(&repos).unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn no_repos_for_provider() {
|
||||
let repos = TempDir::new().unwrap();
|
||||
let _provider = TempDir::new_in(&repos).unwrap();
|
||||
assert_eq!(0, count_repositories(&repos).unwrap())
|
||||
assert_eq!(0, count_repositories(&repos).unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -20,7 +20,7 @@ fn no_repos_for_owner() {
|
||||
let repos = TempDir::new().unwrap();
|
||||
let provider = TempDir::new_in(&repos).unwrap();
|
||||
let _owner = TempDir::new_in(&provider).unwrap();
|
||||
assert_eq!(0, count_repositories(&repos).unwrap())
|
||||
assert_eq!(0, count_repositories(&repos).unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -29,7 +29,7 @@ fn one_repo_for_owner() {
|
||||
let provider = TempDir::new_in(&repos).unwrap();
|
||||
let owner = TempDir::new_in(&provider).unwrap();
|
||||
let _repo = TempDir::new_in(&owner).unwrap();
|
||||
assert_eq!(1, count_repositories(&repos).unwrap())
|
||||
assert_eq!(1, count_repositories(&repos).unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -39,7 +39,7 @@ fn two_repos_for_owner() {
|
||||
let owner = TempDir::new_in(&provider).unwrap();
|
||||
let _repo1 = TempDir::new_in(&owner).unwrap();
|
||||
let _repo2 = TempDir::new_in(&owner).unwrap();
|
||||
assert_eq!(2, count_repositories(&repos).unwrap())
|
||||
assert_eq!(2, count_repositories(&repos).unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -51,7 +51,7 @@ fn two_repos_for_two_providers() {
|
||||
let provider2 = TempDir::new_in(&repos).unwrap();
|
||||
let owner2 = TempDir::new_in(&provider2).unwrap();
|
||||
let _repo2 = TempDir::new_in(&owner2).unwrap();
|
||||
assert_eq!(2, count_repositories(&repos).unwrap())
|
||||
assert_eq!(2, count_repositories(&repos).unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -62,5 +62,5 @@ fn two_subdirs_in_one_repo() {
|
||||
let repo = TempDir::new_in(&owner).unwrap();
|
||||
let _subdir1 = TempDir::new_in(&repo).unwrap();
|
||||
let _subdir2 = TempDir::new_in(&repo).unwrap();
|
||||
assert_eq!(1, count_repositories(&repos).unwrap())
|
||||
assert_eq!(1, count_repositories(&repos).unwrap());
|
||||
}
|
||||
|
@ -25,14 +25,14 @@ pub async fn spawn_app() -> TestApp {
|
||||
let listener = TcpListener::bind("127.0.0.1:0").expect("Failed to bind random port");
|
||||
|
||||
let port = listener.local_addr().unwrap().port();
|
||||
let address = format!("http://127.0.0.1:{}", port);
|
||||
let address = format!("http://127.0.0.1:{port}");
|
||||
|
||||
let _repo_dir = tempdir().expect("Cannot create repo_dir");
|
||||
let _cache_dir = tempdir().expect("Cannot create cache_dir");
|
||||
let repo_dir = tempdir().expect("Cannot create repo_dir");
|
||||
let cache_dir = tempdir().expect("Cannot create cache_dir");
|
||||
|
||||
let mut settings = Settings::load().expect("Failed to read configuration.");
|
||||
settings.repodir = _repo_dir.path().to_path_buf();
|
||||
settings.cachedir = _cache_dir.path().to_path_buf();
|
||||
settings.repodir = repo_dir.path().to_path_buf();
|
||||
settings.cachedir = cache_dir.path().to_path_buf();
|
||||
|
||||
let server = hoc::run(listener, settings)
|
||||
.await
|
||||
@ -44,7 +44,7 @@ pub async fn spawn_app() -> TestApp {
|
||||
|
||||
TestApp {
|
||||
address,
|
||||
_repo_dir,
|
||||
_cache_dir,
|
||||
_repo_dir: repo_dir,
|
||||
_cache_dir: cache_dir,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user