TestTask fails with -n but works with --name
Nessuno ha ancora preso questa issue.
- Lingua principale
- Ruby
- Stelle
- 2.5k
- Fork
- 650
- Merge medio
- 6m
- PR unite (30g)
- 3
Descrizione
Just noticed an issue with TestTask that it doesn't properly recognize the -n option as a shorthand of --n as documented:
$ bundle exec rake test TESTOPTS='--help'
...
-n, --name=NAME Runs tests matching NAME.
Use '/PATTERN/' for NAME to use regular expression.
Regular expression accepts options.
Example: '/taRget/i' matches 'target' and 'TARGET'
...
It works when I run:
🐚 bundle exec rake test TEST=test/gnuplot_printer_test.rb TESTOPTS='--name=/write/'
/home/user/.asdf/installs/ruby/3.2.2/bin/ruby -w -I"lib" /home/user/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb "test/gnuplot_printer_test.rb" --name=/write/
Loaded suite /home/user/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.0.6/lib/rake/rake_test_loader
Started
.
Finished in 0.001170365 seconds.
--------------------------------------------------------------------------------
1 tests, 4 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
--------------------------------------------------------------------------------
But it fails when I use a shorthand:
🐚 bundle exec rake test TEST=test/gnuplot_printer_test.rb TESTOPTS='-n /write/'
/home/user/.asdf/installs/ruby/3.2.2/bin/ruby -w -I"lib" /home/user/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb "test/gnuplot_printer_test.rb" -n /write/
File does not exist: /write
rake aborted!
Command failed with status (1): [ruby -w -I"lib" /home/user/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb "test/gnuplot_printer_test.rb" -n /write/]
/home/user/.asdf/installs/ruby/3.2.2/bin/bundle:25:in `load'
/home/user/.asdf/installs/ruby/3.2.2/bin/bundle:25:in `<main>'
Tasks: TOP => test
(See full trace by running task with --trace)
In case that matters, using Test::Unit 3.5.7 framework.
-- rake, version 13.0.6
Guida per i contributori
Apri la guida per i contributori
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.
Direzione di ricerca
Riproduci il problema tramite il task di test con test/gnuplot_printer_test.rb, confrontando TESTOPTS='--name=/write/' con TESTOPTS='-n /write/'. Inizia da TestTask e dall'entry point rake_test_loader.rb menzionato nell'output del comando. Il lavoro è completato quando la forma abbreviata seleziona lo stesso test invece di trattare /write/ come un file.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- ruby
- Ambito
- cli, testing-qa
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100