-
Notifications
You must be signed in to change notification settings - Fork 2
refactor!: port Python tests to Rust #106
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
Conversation
- fix: fix logic for check_files_are_same - refactor: remove OperationV2::hoards_root - refactor: make private things public
- refactor: make more things public - fix: make upgrade logic more reliable
Some tests were failing because they were running in parallel while depending on environment variables that were being changed by other tests. This fixes those tests and updates CI and such to run tests single-threaded for now.
- Windows now falls back to environment variables if the known folders are not known. - macOS will consider XDG directories, if the appropriate environment variables are set, and default to macOS-specific folders otherwise.
✔️ Deploy Preview for hoard-docs ready! 🔨 Explore the source changes: 20cb3e2 🔍 Inspect the deploy log: https://app.netlify.com/sites/hoard-docs/deploys/62326743858c1c0008ec998a 😎 Browse the preview: https://deploy-preview-106--hoard-docs.netlify.app |
Codecov Report
@@ Coverage Diff @@
## main #106 +/- ##
==========================================
- Coverage 94.56% 89.66% -4.90%
==========================================
Files 35 61 +26
Lines 1988 4666 +2678
==========================================
+ Hits 1880 4184 +2304
- Misses 108 482 +374
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving comments with TODOs and notes for the merge commit
strategy: | ||
matrix: | ||
# Linux is handled by the coverage check | ||
os: ["windows-latest", "macos-latest", "ubuntu-latest"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ci: merge integration tests job into testing/coverage job
@@ -1,3 +1,4 @@ | |||
.idea/ | |||
/target | |||
*.profraw | |||
.vscode/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chore: add .vscode to gitignore
@@ -2,7 +2,7 @@ | |||
name = "hoard" | |||
version = "0.4.0" | |||
authors = ["Michael Bryant <[email protected]>"] | |||
edition = "2018" | |||
edition = "2021" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chore: upgrade to 2021 edition
@@ -30,17 +29,26 @@ serde_yaml = { version = "0.8", optional = true } | |||
sha2 = "0.10" | |||
similar = { version = "2.1", default-features = false, features = ["text"] } | |||
structopt = "0.3.26" | |||
tempfile = "3.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feat: edit temporary copy of configuration file
@@ -18,6 +18,16 @@ You can find all documentation at https://hoard.rs. | |||
|
|||
See [`config.toml.sample`](config.toml.sample) for a documented example configuration file. | |||
|
|||
## Testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc: add testing section to README
"foo".into() => "${HOME}/something".into() | ||
}, | ||
#[cfg(windows)] | ||
items: btreemap! { | ||
"foo".into() => "${USERPROFILE}/something".into() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test(windows): use USERPROFILE
env var, not HOME
@@ -352,10 +371,10 @@ mod tests { | |||
fn multiple_entry_no_config() { | |||
let hoard = Hoard::Multiple(MultipleEntries { | |||
config: None, | |||
items: hashmap! { | |||
items: btreemap! { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactor: use BTreeMap
instead of HashMap
for ordered iteration
@@ -51,7 +51,7 @@ impl Filter for Filters { | |||
#[cfg(test)] | |||
mod tests { | |||
use super::*; | |||
use crate::hoard_file::ChecksumType; | |||
use crate::hoard_item::ChecksumType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactor: rename hoard_file
-> hoard_item
@@ -300,6 +311,7 @@ impl HoardDiffIter { | |||
}; | |||
|
|||
Ok(ProcessedFile { | |||
deleted_remotely, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: revise file diff analysis logic
Fixes #100 (and then some).
This ports the Python tests to Rust and includes some fixes to the main code to make the tests pass, as appropriate.
A lot of stuff ended up being reworked as part of this, so the merge commit message with contain a record of everything touched.