From: Felipe Contreras <hidden> Date: 2016-06-15 22:57:36
We should call 'git rebase --abort', like a normal user would do.
Signed-off-by: Felipe Contreras <redacted>
---
t/t3420-rebase-autostash.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Incorrect. I don't assume that --abort works yet, in this test. It
is non-trivial to get --abort to work with autostash, and this is
tested in a separate test: see "rebase$type: --abort" in the same
file.
Incorrect. I don't assume that --abort works yet, in this test.
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.
# failed 19 among 22 test(s)
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.
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.
--
Felipe Contreras
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.
From: Felipe Contreras <hidden> Date: 2016-06-15 22:57:36
On Sat, Jun 8, 2013 at 8:19 AM, Ramkumar Ramachandra [off-list ref] wrote:
Felipe Contreras wrote:
quoted
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.
The more the test relies on implementation details, the worst.
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.
quoted
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.
From: Felipe Contreras <hidden> Date: 2016-06-15 22:57:36
On Sat, Jun 8, 2013 at 9:04 AM, Ramkumar Ramachandra [off-list ref] wrote:
Felipe Contreras wrote:
quoted
quoted
Ofcourse they're implementation details. Even in this very test, I
check $dotest/autostash plenty of times.
The more the test relies on implementation details, the worst.
I'm not convinced about this.
There's even a model called test-driven development, where you start
developing the tests even before there's any implementation. There's
also black-box testing.
There's reasons for that.
quoted
quoted
Then show me how to do it correctly.
Something like this.
Yeah, this is definitely better. Can you submit this patch?
From: Antoine Pelisse <hidden> Date: 2016-06-15 22:57:36
On Sat, Jun 8, 2013 at 4:04 PM, Ramkumar Ramachandra [off-list ref] wrote:
Felipe Contreras wrote:
quoted
quoted
Ofcourse they're implementation details. Even in this very test, I
check $dotest/autostash plenty of times.
The more the test relies on implementation details, the worst.
I'm not convinced about this.
My understanding of these tests is that they make sure new/better
implementations don't break the user experience/defined behavior. If
the test relies on the implementation, then they lose most of their
interest.
The more the test relies on implementation details, the worst.
I'm not convinced about this.
My understanding of these tests is that they make sure new/better
implementations don't break the user experience/defined behavior. If
the test relies on the implementation, then they lose most of their
interest.
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:57:36
Ramkumar Ramachandra wrote:
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?
That's one strategy. "test_when_finished" to restore the set-up
state is another.
Making tests skippable unless labelled otherwise is currently an
aspirational goal rather than a practical one. Hopefully some day
we'll get there and the test harness can start checking it. :) It
makes reorganizing test scripts, for example by reordering tests, much
easier.
Thanks,
Jonathan