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

Look for groups matching the test target name outside of the main group #708

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

weibel
Copy link

@weibel weibel commented May 22, 2018

In our project we have an intricate group structure and at some point the group containing our specs moved into a subfolder in the hierarchy.

When we run pod install after adding EarlGrey it will fail with the error

RuntimeError - Test target group not found!
/Users/kasper/.rvm/gems/ruby-2.3.1/bundler/gems/EarlGrey-35532c4e95c6/gem/lib/earlgrey/configure_earlgrey.rb:369:in `copy_swift_files'
etc.

After looking through the code the culprit seemed to be the way the target names and group names are matched in configure_earlgrey.rb in copy_swift_files. In test_target_group = project_test_targets.find { |g| g.display_name == target.name } only the root groups are looked at, and it did not work for our project.

To solve the problem we have added a new method which will recurse through the group hierarchy until it finds a matching group name.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@googlebot
Copy link

CLAs look good, thanks!

Merge downstream changes
@tirodkar
Copy link
Collaborator

tirodkar commented Aug 3, 2018

Thanks for looking into this @weibel. Apologies for not getting to it faster. Can you add a simple test for it in our rspec as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants