Crash: undefined method `[]' for false:FalseClass - can't detect scheme from CLI
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
Research direction
Start with lib/slather/project.rb around configure_scheme at line 398, identified by the stack trace, and trace how the CLI --scheme value reaches that method. Compare that path with scheme loading from .slather.yml, which the reporter says works. Reproduce with the supplied slather coverage command and confirm the CLI invocation handles the scheme without crashing.
Written by the indexing model from the issue text.
Description
I found the following error:
Slathering...
undefined method `[]' for false:FalseClass
Are you sure your project is generating coverage? Make sure you enable code coverage in the Test section of your Xcode scheme.
Did you specify your Xcode scheme? (--scheme or 'scheme' in .slather.yml)
If you're using a workspace, did you specify it? (--workspace or 'workspace' in .slather.yml)
If you use a different Xcode configuration, did you specify it? (--configuration or 'configuration' in .slather.yml)
Click to see stacktrace
Traceback (most recent call last):
24: from /Users/rogerluan/.rbenv/versions/2.6.5/bin/bundle:23:in `<main>'
23: from /Users/rogerluan/.rbenv/versions/2.6.5/bin/bundle:23:in `load'
22: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-2.2.17/exe/bundle:37:in `<top (required)>'
21: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/friendly_errors.rb:130:in `with_friendly_errors'
20: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-2.2.17/exe/bundle:49:in `block in <top (required)>'
19: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/cli.rb:24:in `start'
18: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
17: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/cli.rb:30:in `dispatch'
16: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
15: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
14: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
13: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/cli.rb:494:in `exec'
12: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/cli/exec.rb:28:in `run'
11: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/cli/exec.rb:63:in `kernel_load'
10: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/cli/exec.rb:63:in `load'
9: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/bin/slather:23:in `<top (required)>'
8: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/bin/slather:23:in `load'
7: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/gems/slather-2.7.1/bin/slather:17:in `<top (required)>'
6: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/gems/clamp-1.3.2/lib/clamp/command.rb:140:in `run'
5: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run'
4: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/gems/clamp-1.3.2/lib/clamp/subcommand/execution.rb:18:in `execute'
3: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run'
2: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/gems/slather-2.7.1/lib/slather/command/coverage_command.rb:59:in `execute'
1: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/gems/slather-2.7.1/lib/slather/project.rb:324:in `configure'
/Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/gems/slather-2.7.1/lib/slather/project.rb:398:in `configure_scheme': undefined method `[]' for false:FalseClass (NoMethodError)
When executing:
bundle exec slather coverage \
--cobertura-xml \
--scheme MyProject-Package \
--source-directory Sources \
--binary-basename MyProject \
--output-directory Generated \
--ignore 'Tests/*' \
MyProject.xcodeproj
As you can see in the stacktrace, the crash is here: https://github.com/SlatherOrg/slather/blob/13d50220de561e5f89d3d3685ce94601cdbb196d/lib/slather/project.rb#L398
Apparently it's not picking up the --scheme argument correctly. I tried adding single and double quotes around the scheme value, with no luck.
But if I use a .slather.yml with a scheme, then everything works.
I did a quick code review but I couldn't spot the bug in the slather codebase
- Dominant language
- Ruby
- Stars
- 1.6k
- Forks
- 239
- Avg merge
- 10h 19m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SlatherOrg/slather
-
2.8.6: NoMethodError "undefined method 'first'" in profdata_coverage_dir whenever --scheme is usedOpen
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
SlatherOrg/slather#586 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
SlatherOrg/slather#582 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
SlatherOrg/slather#580 · 9 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 56/100
SlatherOrg/slather#578 · 3 comments · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
SlatherOrg/slather#577 ·
All issues in SlatherOrg/slather
Similar issues
-
bug: "Conversation information" accordion renders blank with 0px height when conversation has no attributesPossibly taken @gihovani claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
`hanami generate repository` would be a nice alias for `hanami generate repo`Possibly taken @sandbergja claimed this today. Openbug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
hanami/hanami-cli#455 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
asciidoctor/asciidoctor#4882 · 4 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
sclorg/s2i-ruby-container#660 · 1 comment ·