-
Notifications
You must be signed in to change notification settings - Fork 1
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
Proposal for unit & integration testing #1
Commits on Oct 10, 2021
-
Draft: proposal for unit & integration testing
There's a lot going on, and I haven't documented any of it. But the idea is to be able to do unit tests without relying on real git, since it could be slow, use the network, or impact local state. So `cargo test --lib` will use mostly in-memory tests, reaching out to fake git binaries when necessary. The Integration tests (under the `tests/` folder) will run against the real git binary, and may do things like authenticate to remote hosts or create / remove branches.
Configuration menu - View commit details
-
Copy full SHA for 76b5fd0 - Browse repository at this point
Copy the full SHA 76b5fd0View commit details -
Fixes #3: Rewrite fake_git in Rust
* Rewrote fake_git sh scripts in Rust * Moved all executables to src/bin & removed from TOML * Updated tests to use new exes
J. Caleb Wherry committedOct 10, 2021 Configuration menu - View commit details
-
Copy full SHA for e187ac1 - Browse repository at this point
Copy the full SHA e187ac1View commit details -
Move
with_path
impl to tests module. Fixes #4.I wasn't 100% sure this would work at first, but you can split an `impl` block up over multiple sections. So since `with_path` doesn't need to be defined for the `Git` struct in application code, I moved it into the `test` module instead. If you don't do something like this, then marking `with_path` as private will generate a warning, since no other application code (even within its own module) uses it. Two alternative approaches: * Leave `with_path` where it is, but mark it as `#[cfg(test)]` * Change `new` to call `with_path`, so that `with_path` is used by something.
Configuration menu - View commit details
-
Copy full SHA for 956844e - Browse repository at this point
Copy the full SHA 956844eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 52c2d23 - Browse repository at this point
Copy the full SHA 52c2d23View commit details -
Configuration menu - View commit details
-
Copy full SHA for 234cec3 - Browse repository at this point
Copy the full SHA 234cec3View commit details
Commits on Oct 11, 2021
-
Custom error type for git invocations. Fixes #5.
Invoking git either raises an `io::Error` or returns a `std::process::ExitStatus`, the `success()` method of which may return `false`. The new type, `GitError`, is designed to encompass both of these cases and should simplify error handling when interacting with git subprocesses.
Configuration menu - View commit details
-
Copy full SHA for 5f90c9f - Browse repository at this point
Copy the full SHA 5f90c9fView commit details -
Comment out Cargo.lock in gitignore. Fixes #12.
Commented Cargo.lock from gitignore so that we have a record of why we did it. I think something like this is easy to forget so leaving it along with the original comment makes sense. Adding the version of Cargo.lock I get running on MacOs.
J. Caleb Wherry committedOct 11, 2021 Configuration menu - View commit details
-
Copy full SHA for 70661fd - Browse repository at this point
Copy the full SHA 70661fdView commit details -
Simplify pattern matching in fake_git. Fixes #13.
J. Caleb Wherry committedOct 11, 2021 Configuration menu - View commit details
-
Copy full SHA for 625c00d - Browse repository at this point
Copy the full SHA 625c00dView commit details -
Replace OsString/Path with String. Fixes #11.
J. Caleb Wherry committedOct 11, 2021 Configuration menu - View commit details
-
Copy full SHA for 7e42b1f - Browse repository at this point
Copy the full SHA 7e42b1fView commit details
Commits on Oct 12, 2021
-
We can add build/release/platform info once we have CI set up (see #2).
Configuration menu - View commit details
-
Copy full SHA for f5e9c5d - Browse repository at this point
Copy the full SHA f5e9c5dView commit details -
Configuration menu - View commit details
-
Copy full SHA for a436994 - Browse repository at this point
Copy the full SHA a436994View commit details
Commits on Oct 13, 2021
-
Match anything but '/' for origin name. Fixes #6.
As @calebwherry said in the original issue: > Using origin can cause issues with others not using that wordage. > Replace with "not slash" match as it can be anything. I tried to be clever and match hyphenated words, but then I tried to look up the actual definition of a remote name, and there does not seem to be one: https://stackoverflow.com/questions/41461152/which-characters-are-illegal-within-a-git-remote-name/41462742 So, it seems like the best thing to do is detect whatever isn't a slash, because we know those *can't* be allowed, since they are allowed in branch names (and therefore any ref with slashes in the remote or branch would parse ambiguously). Whatever else git tells us is obviously valid, since git is the authority here.
Configuration menu - View commit details
-
Copy full SHA for c0a8dae - Browse repository at this point
Copy the full SHA c0a8daeView commit details -
Configuration menu - View commit details
-
Copy full SHA for fc69b49 - Browse repository at this point
Copy the full SHA fc69b49View commit details -
Configuration menu - View commit details
-
Copy full SHA for 12704d2 - Browse repository at this point
Copy the full SHA 12704d2View commit details -
Add more prints in GitHub YAML for debugging
J. Caleb Wherry committedOct 13, 2021 Configuration menu - View commit details
-
Copy full SHA for 985096a - Browse repository at this point
Copy the full SHA 985096aView commit details -
J. Caleb Wherry committed
Oct 13, 2021 Configuration menu - View commit details
-
Copy full SHA for aa25626 - Browse repository at this point
Copy the full SHA aa25626View commit details -
Add setup repo step in GH actions yml. Fixes #17
GitHub checks out the repo in a detached head state. We use a trick noted in the task to fix it.
J. Caleb Wherry committedOct 13, 2021 Configuration menu - View commit details
-
Copy full SHA for 9943f2b - Browse repository at this point
Copy the full SHA 9943f2bView commit details -
Add setup repo step in GH actions yml. Fixes #17
GitHub checks out the repo in a detached head state. We use a trick noted in the task to fix it. Try 2...
J. Caleb Wherry committedOct 13, 2021 Configuration menu - View commit details
-
Copy full SHA for 0025909 - Browse repository at this point
Copy the full SHA 0025909View commit details -
Add setup repo step in GH actions yml. Fixes #17
GitHub checks out the repo in a detached head state. We use a trick noted in the task to fix it. Try 3...
J. Caleb Wherry committedOct 13, 2021 Configuration menu - View commit details
-
Copy full SHA for 022dc6d - Browse repository at this point
Copy the full SHA 022dc6dView commit details -
Print statment to help debug this more...
J. Caleb Wherry committedOct 13, 2021 Configuration menu - View commit details
-
Copy full SHA for f0513fc - Browse repository at this point
Copy the full SHA f0513fcView commit details -
J. Caleb Wherry committed
Oct 13, 2021 Configuration menu - View commit details
-
Copy full SHA for ce0145f - Browse repository at this point
Copy the full SHA ce0145fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7efa1ba - Browse repository at this point
Copy the full SHA 7efa1baView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1756869 - Browse repository at this point
Copy the full SHA 1756869View commit details -
Configuration menu - View commit details
-
Copy full SHA for 748b183 - Browse repository at this point
Copy the full SHA 748b183View commit details