Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[RFR] Fix assert for a project in a non-existed git repository (was: [egit-dev] Is org.eclipse.egit.core--All-Tests broken in 'master'?)

Mykola Nikishov <mn@xxxxxxxxx> writes:

> Ok, run tests and if I'm not mistaken you'll get exactly this:
>
> --8<---------------cut here---------------start------------->8---
> org.eclipse.egit.core--All-Tests
> org.eclipse.egit.core.op.T0001_ConnectProviderOperationTest
> testNoRepository(org.eclipse.egit.core.op.T0001_ConnectProviderOperationTest)
> junit.framework.AssertionFailedError
> 	at junit.framework.Assert.fail(Assert.java:47)
> 	at junit.framework.Assert.assertTrue(Assert.java:20)
> 	at junit.framework.Assert.assertTrue(Assert.java:27)
> 	at org.eclipse.egit.core.op.T0001_ConnectProviderOperationTest.testNoRepository(T0001_ConnectProviderOperationTest.java:44)
>
> [...]
>
> --8<---------------cut here---------------end--------------->8---

As I can see it was broken long before origin/eclipse-post and fails all
the time for a project which doesn't has an existing git repository in
its parent directories:

--8<---------------cut here---------------start------------->8---
commit 025d26216af17edb60c40e2046d30d4d9cc6571c
Author: Shawn O. Pearce <spearce@xxxxxxxxxxx>
Date:   Tue Sep 29 18:22:48 2009 -0700
--8<---------------cut here---------------end--------------->8---

Preconditions for this test:
- project isn't nested into another existed git repository

Test set up is:
- Create test project in the directory where there is no git repository.
- Don't create new git repository under the project's root.

And logic behind this unit test, I guess, that trying to connect a
project without a specific git repository should fail, right? But this
test expects a shared project:

--8<---------------cut here---------------start------------->8---
// We are shared because we declared as shared
assertTrue(RepositoryProvider.isShared(project.getProject()));
--8<---------------cut here---------------end--------------->8---

Expecting it will be shared seems strange to me. This is fixed
http://egit.eclipse.org/r/93, please review it.

> It's time to check the same for a project nested into a git
> repository. I use a default path '${workspace_loc}/../junit-workspace'
> for that matter because it points to
> '/home/mn/workspace-1/../junit-workspace' nested into a git repository
> '/home/mn/.git'. Now you'll get a bunch of failures:

However, it will pass for a test project which has a git repository in
its parent directories. ConnectProviderOperation had a bug which is the
reason for this behevior and is fixed as a part of
http://egit.eclipse.org/r/84.

[...]

> Is it only me who had caught these problems?

Or am I missed the point completely?

-- 
MAN-UANIC


Back to the top