git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] tests: fix autostash

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jun 8, 2013, 13:19 UTC
Message-ID
<CALkWK0=qVXL=DtJzYRGFLQQh3_-cGC_t_zpaiTL9KVKN4--mVg@mail.gmail.com>
In-Reply-To
<CAMP44s3rYXOmGWR3JM8xy8ON4pqDRhYWVMQqOAyODVr5myq+yg@mail.gmail.com>
Felipe Contreras wrote:
Show 5 quoted lines
> Yes you do. The rest of the tests expect that the previous rebase has
> been aborted.
>
> In fact, all the tests depend on the previous test finishing
> correctly, which is not the way tests should be written.

How else am I supposed to write them? If there is a stale state from the previous test, there isn't too much I can do. Or should I be cleaning up state at the beginning of each test, instead of at the end?

> Doing 'rm -rf $dotest' is even worst than 'git rebase --abort',
> because it relies on the implementation of 'git rebase', which might
> need to remove more files than $dotest.
Huh?  Tests aren't allowed to rely on how a command is implemented?
  $ git grep test_path t

Ofcourse they're implementation details. Even in this very test, I check $dotest/autostash plenty of times.

Have you read rr/rebase-autostash? The whole idea is to inject $dotest/autostash and teach various scripts about how their assumptions about $dotest have changed.

> This wouldn't be a problem if the tests were implemented correctly,
> but they are not, so 'git rebase --abort' is the only sane option.
Then show me how to do it correctly.
Previous: Felipe ContrerasNext: Felipe Contreras
Message 4 of 10 in “tests: fix autostash”
  1. tests: fix autostashFelipe Contreras, Jun 7, 2013
  2. Ramkumar RamachandraJun 8, 2013
  3. Felipe ContrerasJun 8, 2013
  4. Ramkumar RamachandraJun 8, 2013
  5. Felipe ContrerasJun 8, 2013
  6. Ramkumar RamachandraJun 8, 2013
  7. Felipe ContrerasJun 8, 2013
  8. Antoine PelisseJun 8, 2013
  9. Ramkumar RamachandraJun 8, 2013
  10. Jonathan NiederJun 8, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.