Skip to content

Update insert-ignores.sh to current requirements #1450 - #1455

Merged
sjwarner-bp merged 1 commit into
exercism:masterfrom
hgvanpariya:insert-ignore
Jun 20, 2018
Merged

sjwarner-bp merged 1 commit into
exercism:masterfrom
hgvanpariya:insert-ignore

Conversation

@hgvanpariya

Copy link
Copy Markdown
Contributor

Reviewer Resources:

Track Policies

@sjwarner-bp sjwarner-bp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just running it locally for the first time, it looks like this also adds an @Ignore("Remove to run test") to the first test in each suite.

This is not in line with the policy linked in the issue ignore non-initial tests.

The old version of this script skips over the first test in each suite, and only adds @Ignore to subsequent tests.

Does that make sense? 🙂

Comment thread scripts/insert-ignores.sh Outdated
sed '1,/@Ignore/s/.*@Ignore//' > "$tempfile" \
&& mv "$tempfile" "$file"

#ignoreFound variable will check if already Ignore is imporeted or not.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Typo -> imporeted should be imported

Comment thread scripts/insert-ignores.sh Outdated
cat $file | sed 's/import org.junit.Test;/import org.junit.Test;\
import org.junit.Ignore;/' > $tempfile
mv "$tempfile" "$file"
pwd

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be indented?

@hgvanpariya

Copy link
Copy Markdown
Contributor Author

@sjwarner-bp : thank you for your comments ... I'll update it ...

@hgvanpariya

Copy link
Copy Markdown
Contributor Author

@sjwarner-bp : updated the script... please validate once...

@sjwarner-bp sjwarner-bp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is looking good so far! There are just a couple of tiny things left now.

I've just run it against a clean copy of master here, and from what I can see the import org.junit.Ignore still gets pulled in on test suites where it is not used (for example, it appears in GreeterTest.java - this should probably be conditional based on if we use it or not).

It also looks as though somehow file permissions are changed - the message:

old mode 100755
new mode 100644

seems to be quite common.

Other than that, this is looking good!

@sjwarner-bp

Copy link
Copy Markdown
Contributor

Also to add to the comment above, it seems like the indentation might be slightly wrong 🙂

@hgvanpariya

Copy link
Copy Markdown
Contributor Author

@sjwarner-bp : I'll update the script ...

@hgvanpariya

Copy link
Copy Markdown
Contributor Author

@sjwarner-bp , I've updated the script with following two changes :

  1. It will not add import import org.junit.Ignore; if any type of @Ignore is not found in the file
  2. indentation is fixed. ( line no. 31, is out of indentation, because, it will add extra space in the Test file it I'll add Tab in the beginning )

Please let me know if any further changes are needed.

@sjwarner-bp

Copy link
Copy Markdown
Contributor

Thanks for all the improvements with this! I'll pull it down and try it out at lunchtime 🙂

@sjwarner-bp sjwarner-bp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This look alright to me! I think this works correctly now.

Thanks for getting this done!

@sjwarner-bp
sjwarner-bp merged commit a0f9106 into exercism:master Jun 20, 2018
@sjwarner-bp

Copy link
Copy Markdown
Contributor

Thanks @hgvanpariya 🎆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants