Crash: undefined method `[]' for false:FalseClass - can't detect scheme from CLI
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Ruby
- Stelle
- 1.6k
- Fork
- 239
- Merge medio
- 10h 19m
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SlatherOrg/slather
-
2.8.6: NoMethodError "undefined method 'first'" in profdata_coverage_dir whenever --scheme is usedAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
SlatherOrg/slather#586 · 2 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
SlatherOrg/slather#582 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
SlatherOrg/slather#580 · 9 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 56/100
SlatherOrg/slather#578 · 3 commenti · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
SlatherOrg/slather#577 ·
Tutte le issue di SlatherOrg/slather
Issue simili
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
bridgetownrb/bridgetown#1130 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
rapid7/metasploit-framework#22008 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
stripe/stripe-ruby#1994 ·
I maintainer di solito rispondono entro 1 giorno
-
[Fehler]: /abdeckstift wirft 500 — part_type aus der Phonemreduction-Umbenennung nicht mitgezogenApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
wort-schule/wort.schule#787 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
lugassawan/swe-workbench#799 ·
I maintainer di solito rispondono entro 1 giorno