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

Should not fail If committed changes has deleted file #160

Closed
dipak-pawar opened this issue Sep 19, 2017 · 3 comments · Fixed by #162
Closed

Should not fail If committed changes has deleted file #160

dipak-pawar opened this issue Sep 19, 2017 · 3 comments · Fixed by #162

Comments

@dipak-pawar
Copy link
Contributor

dipak-pawar commented Sep 19, 2017

Issue Overview

Currently we are only looking for ADD & MODIFY ChangeType

While extracting committed changes here we should look for DELETE OR RANAMED ChangeType & filter it later if not interested.

Expected Behaviour

ST should work fine with deleted test file.

Current Behaviour

ST is failing with exception

org.apache.maven.InternalErrorException: Internal error: java.lang.IllegalArgumentException: No enum constant org.arquillian.smart.testing.scm.ChangeType.DELETE
Steps To Reproduce
  1. Clone this reproducible project
  2. Run tests using cmd
mvn clean test -Dsmart.testing=new,changed,affected -Dscm.range.head=HEAD -Dscm.range.tail=HEAD~3

Note: I haven't tested this for RENAMED ChangeType. Please test this as well. I believe this will also fail.

@bartoszmajsak
Copy link
Member

Hah, good find :)

@bartoszmajsak
Copy link
Member

bartoszmajsak commented Sep 19, 2017

I think if we fix it we can cut new release, as this is really a blocker :)

@bartoszmajsak bartoszmajsak self-assigned this Sep 19, 2017
@bartoszmajsak
Copy link
Member

A bit of digging reveals interesting behaviour of JGit, which I guess is a bug (probably related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=434085)

From CLI (on the repo.bundle coming with the PR):

git diff --no-commit-id --name-status 6b4a8a3..76b6069
R085	strategies/changed/src/test/java/org/arquillian/smart/testing/vcs/git/DummyFilesDetectorTest.java	strategies/changed/src/test/java/org/arquillian/smart/testing/vcs/git/EvenMoreDummyFilesDetectorTest.java

but jgit results in:

0 = {DiffEntry@1633} "DiffEntry[DELETE strategies/changed/src/test/java/org/arquillian/smart/testing/vcs/git/DummyFilesDetectorTest.java]"
1 = {DiffEntry@1634} "DiffEntry[ADD strategies/changed/src/test/java/org/arquillian/smart/testing/vcs/git/EvenMoreDummyFilesDetectorTest.java]"

@bartoszmajsak bartoszmajsak added this to the 0.0.2 milestone Sep 19, 2017
bartoszmajsak added a commit that referenced this issue Sep 19, 2017
* ensures all change types are covered
* adds support for git RENAMEs in changed strategy
* test: functional test covering rename

* chore: renames findRename method to explaine rename renaming better ;)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants