-
Notifications
You must be signed in to change notification settings - Fork 2
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
extract cache logic out of gm
itself
#44
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this commit fixes the imports in the `gm` commands and the tests.
this commit defines a tool `assert cache` to check the content of the cache and keep the test as readable as possible.
this commit remove the `pwd` from the paths in the actual cache and expected content to hopefully make the output of a failing test easier to read :crossed_fingers: sample output ``` Test "tests cache-manipulation" failed with exit code 1: Error: × Assertion failed. ╭─[/home/amtoine/documents/repos/github.com/amtoine/nu-git-manager/tests/mod.nu:172:1] 172 │ | str trim --left --char '/' 173 │ assert equal $actual $expected · ────────┬──────── · ╰── These are not equal. Left : '[bar, foo]' Right : '[bar, fo]' 174 │ } ╰──── Ran 7 tests. 6 succeeded, 1 failed. Error: × some tests failed ```
melMass
approved these changes
Oct 27, 2023
we should use `save-cache` instead of `to nuon | save ...`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
as explained in #24 (comment), i encountered a cache bug when working on #39 => because the cache path can now be fully set by the user with
$env.GIT_REPOS_CACHE
, it does not have the.nuon
extension in general and thus we cannot assumeopen $env.GIT_REPOS_CACHE
to open the file as NUON data...description
in order to allow testing more of the internals of the
gm
commands, i propose in this PR to move the cache logic as much as possible fromgm
itself to a new internalfs/cache.nu
module.changelog
get-repo-store-cache-path
andcheck-cache-file
to a newfs/cache.nu
modulefs/cache.nu
tests
a new
cache-manipulation
test intests/mod.nu
.