You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1532: Fix our git tests to actually test that we pushed r=jtgeibel a=sgrif
Our git tests aren't actually testing very much at the moment. We can
replace the entire body of `commit_and_push` with `Ok(())`, and the
test suite would pass. Right now all our tests do is check that we
manipulated files in a given directory, which is more of an
implementation detail than anything else.
Aside from not actually testing what we want, these tests also break
with the setup I want to use for async index updates. Once the index
updates are off the web server, there's no reason we need to keep a
local checkout of the index. We can afford to just do a full clone every
time, which simplifies our code. Once we do that though, our tests can't
observe the directory the commit was made in.
Pushing to a remote repository doesn't actually update the files you
changed on disk. Instead, to observe the changes that were committed, we
create a new clone of the repo and look at the files there. Almost all
of the tests are easy to change to this structure. One of our tests
manipulated a file in the location that it expected the server to
manipulate though. We'd have to push that for the test to be legit.
We could write a `commit_and_push` function for our tests, but that
function will be a pain in the ass. Instead we can just go though a full
crate upload twice to test what we want.
Co-authored-by: Sean Griffin <[email protected]>
0 commit comments