diff options
| author | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2024-08-01 10:31:21 +0200 |
|---|---|---|
| committer | Markus Pettersson <markus.pettersson@mullvad.net> | 2024-08-09 09:43:58 +0200 |
| commit | b50501b9c2240c09628bf7e63d6ff398faf51f3b (patch) | |
| tree | f9105e9fa1e58df837b8bae5f2e3a4b2cd67a5a3 | |
| parent | 2a283a82037cbe67ab7953420caa5c2c098b7cf2 (diff) | |
| download | mullvadvpn-b50501b9c2240c09628bf7e63d6ff398faf51f3b.tar.xz mullvadvpn-b50501b9c2240c09628bf7e63d6ff398faf51f3b.zip | |
Fix `find_app` file matching bug
It could match on dev builds when specifying a stable build.
Add back sorting by file name length, which on ok solution
to this problem.
| -rw-r--r-- | test/test-manager/src/package.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/test-manager/src/package.rs b/test/test-manager/src/package.rs index fbfba1e48d..c1f9d0232b 100644 --- a/test/test-manager/src/package.rs +++ b/test/test-manager/src/package.rs @@ -1,5 +1,6 @@ use crate::config::{Architecture, OsType, PackageType, VmConfig}; use anyhow::{Context, Result}; +use itertools::Itertools; use once_cell::sync::Lazy; use regex::Regex; use std::path::{Path, PathBuf}; @@ -105,6 +106,7 @@ fn find_app( // Skip for non-Linux, because there's only one package !linux || matching_ident }) // Skip file if it doesn't match the architecture + .sorted_unstable_by_key(|(_path, u8_path)| u8_path.len()) .find(|(_path, u8_path)| u8_path.contains(&app)) // Find match .map(|(path, _)| path).context(if e2e_bin { format!( |
