Skip to content
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

[AF-1102] Git repos disappearing when you clone a repo twice with a invalid remote in the second try #246

Merged
merged 1 commit into from Mar 16, 2018

Conversation

ederign
Copy link
Member

@ederign ederign commented Mar 16, 2018

No description provided.

@jhrcek
Copy link

jhrcek commented Mar 16, 2018

Jenkins execute full downstream build

@porcelli
Copy link
Member

good catch @ederign and @jhrcek - this issue happened since ever, thx for spot this issue.

Copy link

@jhrcek jhrcek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ederign I tested this locally and I'm no longer able to reproduce this issue. Thanks for this quick fix!
I just have an optional nitpick about expected exception testing..

assertEquals(new ListRefs(cloned.getRepository()).execute().size(),
new ListRefs(origin.getRepository()).execute().size());

final Git clonedWithNoEmptyRepo = new Clone(gitTarget,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: you can use

assertThatThrownBy( () -> /* some code that throws exception*/)
   .isInstanceOf(Clone.CloneException.class)
   .hasMessage("specific message"); //or hasMessageContaining("substring");

to only wrap the statement which is supposed to throw exception. This would not only give more useful error message in case that assertion fails, but also makes the test more informative (what kind of failure are we expecting and which statement is supposed to throw it?) and focused (it would fail if the same exception is accidentally thrown by some other statement in the test).

@ederign
Copy link
Member Author

ederign commented Mar 16, 2018

@jhrcek thanks for the hint and the detailed reproducer.

@ederign ederign merged commit ab3dbd6 into kiegroup:master Mar 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants